Jira Java REST's Maven Dependency Needed for Priority Level Constants/Id's - jira

I'm using Jira's Java REST API but when I create an issue, I'm not finding the constant/Id to set the priority Id. I'm using the setProrityId() method of the issue builder. Which Maven dependency (or Java Jira package to import) do I need for the Priority Constant/Id? For example, setPriorityId(4L); where is 4L defined as a constant such as "LOW". Here's my Maven dependency:
<dependency>
<groupId>com.atlassian.jira</groupId>
<artifactId>jira-rest-java-client-core</artifactId>
<version>4.0.0</version>
</dependency>
<dependency>
<groupId>com.atlassian.fugue</groupId>
<artifactId>fugue</artifactId>
<version>2.6.1</version>
</dependency>

Related

SLF4J error when running Grails application created with Application Forge [duplicate]

My application is to be deployed on both tcServer and WebSphere 6.1. This application uses ehCache and so requires slf4j as a dependency.
As a result I've added the slf4j-api.jar (1.6) jar to my war file bundle.
The application works fine in tcServer except for the following error:
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
However, when I deploy in WebSphere I get a java.lang.NoClassDefFoundError: org.slf4j.impl.StaticLoggerBinder.
Also accompanied by Failed to load class "org.slf4j.impl.StaticMDCBinder"
I've checked the classpaths of both application servers and there is no other slf4j jar.
Does anyone have any ideas what may be happening here?
I had the same issue with WebSphere 6.1. As Ceki pointed out, there were tons of jars that WebSphere was using and one of them was pointing to an older version of slf4j.
The No-Op fallback happens only with slf4j -1.6+ so anything older than that will throw an exception and halts your deployment.
There is a documentation in SLf4J site which resolves this. I followed that and added slf4j-simple-1.6.1.jar to my application along with slf4j-api-1.6.1.jar which I already had.
If you use Maven, add the following dependencies, with ${slf4j.version} being the latest version of slf4j
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>${slf4j.version}</version>
</dependency>
This solved my issue.
This is for those who came here from google search.
If you use maven just add the following
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.5</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.5</version>
</dependency>
Or
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.5</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.6.4</version>
</dependency>
Simply add this to your pom.xml:
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.21</version>
</dependency>
Quite a few answers here recommend adding the slf4j-simple dependency to your maven pom file. You might want to check for the most current version.
At https://mvnrepository.com/artifact/org.slf4j/slf4j-simple
you'll find the latest version of the SLF4J Simple Binding. Pick the one that suites you best (still 1.7.32 from 2021-07 is the stable version as of 2021-10) and include it to your pom.xml.
For your convenience some dependencies are shown here - but they might not be up-to-date when you read this!
Alpha Version of 2021-08
<!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-simple -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>2.0.0-alpha5</version>
</dependency>
Beta Version of Feb 2019
<!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-simple -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.8.0-beta4</version>
</dependency>
Stable Version 2021-07
<!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-simple -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.32</version>
</dependency>
I removed the scope test part thanks to the comment below.
You need to add following jar file in your classpath: slf4j-simple-1.6.2.jar. If you don't have it, please download it. Please refer to http://www.slf4j.org/codes.html#multiple_bindings
Sometime we should see the note from the warnin SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details..
This happens when no appropriate SLF4J binding could be found on the class path
You can search the reason why this warning comes.
Adding one of the jar from *slf4j-nop.jar, slf4j-simple.jar, slf4j-log4j12.jar, slf4j-jdk14.jar or logback-classic.jar* to the class path should solve the problem.
compile "org.slf4j:slf4j-simple:1.6.1"
for example add the above code to your build.gradle or the corresponding code to pom.xml for maven project.
I was facing same error. I have configured slf4j-api, slf4j-log4j12 and log4j, in my local development. All configuration was fine, but slf4j-log4j12 dependency which I copied from mvnrepository had test scope <scope>test</scope>. When I removed this every thing is fine.
Some times silly mistakes breaks our head ;)
put file slf4j-log4j12-1.6.4.jar in the classpath will do the trick.
SLF4j is an abstraction for various logging frameworks. Hence apart from having slf4j you need to include any of your logging framework like log4j or logback (etc) in your classpath.
To have an idea refer the First Baby Step in http://logback.qos.ch/manual/introduction.html
If you are using maven to dependency management so you can just add following dependency in pom.xml
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.5.6</version>
</dependency>
For non-Maven users
Just download the library and put it into your project classpath.
Here you can see details: http://www.mkyong.com/wicket/java-lang-classnotfoundexception-org-slf4j-impl-staticloggerbinder/
I got into this issue when I get the following error:
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
when I was using slf4j-api-1.7.5.jar in my libs.
Inspite I tried with the whole suggested complement jars, like slf4j-log4j12-1.7.5.jar, slf4j-simple-1.7.5 the error message still persisted. The problem finally was solved when I added slf4j-jdk14-1.7.5.jar to the java libs.
Get the whole slf4j package at http://www.slf4j.org/download.html
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.21</version>
</dependency>
Put above mentioned dependency in pom.xml file
I was facing the similar problem with Spring-boot-2 applications with Java 9 library.
Adding the following dependency in my pom.xml solved the issue for me:
<dependency>
<groupId>com.googlecode.slf4j-maven-plugin-log</groupId>
<artifactId>slf4j-maven-plugin-log</artifactId>
<version>1.0.0</version>
</dependency>
Slf4j is a facade for the underlying logging frameworks like log4j, logback, java.util.logging.
To connect with underlying frameworks, slf4j uses a binding.
log4j - slf4j-log4j12-1.7.21.jar
java.util.logging - slf4j-jdk14-1.7.21.jar etc
The above error is thrown if the binding jar is missed. You can download this jar and add it to classpath.
For maven dependency,
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.21</version>
</dependency>
This dependency in addition to slf4j-log4j12-1.7.21.jar,it will pull slf4j-api-1.7.21.jar as well as log4j-1.2.17.jar into your project
Reference: http://www.slf4j.org/manual.html
Please add the following dependencies to pom to resolve this issue.
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.25</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.25</version>
</dependency>
As an alternative to the jar inclusion and pure maven solutions, you can include it from maven with gradle.
Example for version 1.7.25
// https://mvnrepository.com/artifact/org.slf4j/slf4j-simple
api group: 'org.slf4j', name: 'slf4j-simple', version: '1.7.25'
Put this within the dependencies of your build.gradle file.
In the Websphere case, you have an older version of slf4j-api.jar, 1.4.x. or 1.5.x lying around somewhere. The behavior you observe on tcServer, that is fail-over to NOP, occurs on slf4j versions 1.6.0 and later. Make sure that you are using slf4j-api-1.6.x.jar on all platforms and that no older version of slf4j-api is placed on the class path.
I am working in a project Struts2+Spring. So it need a dependency slf4j-api-1.7.5.jar.
If I run the project, I am getting error like
Failed to load class "org.slf4j.impl.StaticLoggerBinder"
I solved my problem by adding the slf4j-log4j12-1.7.5.jar.
So add this jar in your project to solve the issue.
As SLF4J Manual states
The Simple Logging Facade for Java (SLF4J) serves as a simple facade
or abstraction for various logging frameworks, such as
java.util.logging, logback and log4j.
and
The warning will disappear as soon as you add a binding to your class path.
So you should choose which binding do you want to use.
NoOp binding (slf4j-nop)
Binding for NOP, silently discarding all logging.
Check fresh version at https://search.maven.org/search?q=g:org.slf4j%20AND%20a:slf4j-nop&core=gav
Simple binding (slf4j-simple)
outputs all events to System.err. Only messages of level INFO and higher are printed. This binding may be useful in the context of small applications.
Check fresh version at https://search.maven.org/search?q=g:org.slf4j%20AND%20a:slf4j-simple&core=gav
Bindings for the logging frameworks (java.util.logging, logback, log4j)
You need one of these bindings if you are going to write log to a file.
See description and instructions at https://www.slf4j.org/manual.html#projectDep
My opinion
I would recommend Logback because it's a successor to the log4j project.
Check latest version of the binding for it at https://search.maven.org/search?q=g:ch.qos.logback%20AND%20a:logback-classic&core=gav
You get console output out of the box but if you need to write logs into file just put FileAppender configuration to the src/main/resources/logback.xml or to the src/test/resources/logback-test.xml just like this:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<!-- encoders are assigned the type
ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<appender name="FILE" class="ch.qos.logback.core.FileAppender">
<file>logs/logs.log</file>
<encoder>
<pattern>%date %level [%thread] %logger{10} - %msg%n</pattern>
</encoder>
</appender>
<root level="debug">
<appender-ref ref="STDOUT" />
<appender-ref ref="FILE" />
</root>
<logger level="DEBUG" name="com.myapp"/>
</configuration>
(See detailed description in manual: https://logback.qos.ch/manual/configuration.html)
this can resolve using the same version. I tried this and solved it
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.5</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.5</version>
</dependency>
I added this dependency to resolve this issue:
https://mvnrepository.com/artifact/org.slf4j/slf4j-simple/1.7.25
Most likely your problem was because of <scope>test</scope> (in some cases also <scope>provided</scope>), as mentioned #thangaraj.
Documentation says:
This scope indicates that the dependency is not required for normal
use of the application, and is only available for the test compilation
and execution phases. Test dependencies aren’t transitive and are only present for test and execution classpaths.
So, if you don't need dependecies for test purposes then you can use instead of (what you will see in mvnrepository):
<!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-nop -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-nop</artifactId>
<version>1.7.24</version>
<scope>test</scope>
</dependency>
Without any scopes (by default would be compile scope when no other scope is provided):
<!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-nop -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-nop</artifactId>
<version>1.7.25</version>
</dependency>
This is the same as:
<!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-nop -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-nop</artifactId>
<version>1.7.25</version>
<scope>compile</scope>
</dependency>
Here are my 5 cents...
I had the same issues while running tests. So I've fixed it by adding an implementation for the test runtime only. I'm using gradle for this project.
// https://mvnrepository.com/artifact/ch.qos.logback/logback-classic
testRuntimeOnly group: 'ch.qos.logback', name: 'logback-classic',
version: '1.2.3'
encountered the same problem on payara 5.191
jcl-over-slf4j together with slf4j-log4j12 solved the problem
<properties>
<slf4j.version>1.7.29</slf4j.version>
</properties>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j.version}</version>
</dependency>
As per the SLF4J Error Codes
Failed to load class org.slf4j.impl.StaticLoggerBinder
This warning message is reported when the org.slf4j.impl.StaticLoggerBinder class could not be loaded into memory. This happens when no appropriate SLF4J binding could be found on the class path. Placing one (and only one) of slf4j-nop.jar slf4j-simple.jar, slf4j-log4j12.jar, slf4j-jdk14.jar or logback-classic.jar on the class path should solve the problem.
Note that slf4j-api versions 2.0.x and later use the ServiceLoader mechanism. Backends such as logback 1.3 and later which target slf4j-api 2.x, do not ship with org.slf4j.impl.StaticLoggerBinder. If you place a logging backend which targets slf4j-api 2.0.x, you need slf4j-api-2.x.jar on the classpath. See also relevant faq entry.
SINCE 1.6.0 As of SLF4J version 1.6, in the absence of a binding, SLF4J will default to a no-operation (NOP) logger implementation.
If you are responsible for packaging an application and do not care about logging, then placing slf4j-nop.jar on the class path of your application will get rid of this warning message. Note that embedded components such as libraries or frameworks should not declare a dependency on any SLF4J binding but only depend on slf4j-api. When a library declares a compile-time dependency on a SLF4J binding, it imposes that binding on the end-user, thus negating SLF4J's purpose.
for me the total fix was:
1
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.5</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.5</version>
</dependency>
plus
2 create file log4j.properties
and add inside:
# Root logger option
log4j.rootLogger=INFO, stdout
# Direct log messages to stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
else I got some exceptions in the console.
According to SLF4J official documentation
Failed to load class org.slf4j.impl.StaticLoggerBinder
This warning message is reported when the
org.slf4j.impl.StaticLoggerBinder class could not be loaded into
memory. This happens when no appropriate SLF4J binding could be found
on the class path. Placing one (and only one) of slf4j-nop.jar,
slf4j-simple.jar, slf4j-log4j12.jar, slf4j-jdk14.jar or
logback-classic.jar on the class path should solve the problem.
Simply add this jar along with slf4j api.jar to your classpath to get things done.
Best of luck
I solve it adding this library: slf4j-simple-1.7.25.jar
You can download this in official web https://www.slf4j.org/download.html
For me the issue was:
Using Hibernate, I saw that it already used slf4j, and it was in my classpath already, so I decided to use it.
The next step - adding imlementor for slf4j, so I added to maven:
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
<version>1.7.25</version>
</dependency>
But it failed with error! SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder”
The solution was:
Hibernate's dependency of slf4j was version 1.7.26, and I added minor version dependency 1.7.25. So when I fixed this - all became OK
I know this post is a little old, but in case anyone else runs into this problem:
Add slf4j-jdk14-X.X.X.jar to your CLASSPATH (where X.X.X is the version number - e.g. slf4j-jdk14-1.7.5.jar).
HTH
Peter

Making dropwizard 1.0.5 work with Powermock

How can I make Powermock work with dropwizard version 1.0.5. I have tried to include all kinds of versions of powermock to my project each time a get a different kind of error.
For example when I use:
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<version>1.6.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito</artifactId>
<version>1.6.1</version>
<scope>test</scope>
</dependency>
I get:
java.lang.AbstractMethodError: org.powermock.api.mockito.internal.mockmaker.PowerMockMaker.isTypeMockable(Ljava/lang/Class;)Lorg/mockito/plugins/MockMaker$TypeMockability;
at org.mockito.internal.util.MockUtil.typeMockabilityOf(MockUtil.java:26)
Using version 1.5.4 gives me:
org.powermock.reflect.exceptions.FieldNotFoundException: Field 'fTestClass' was not found in class org.junit.internal.runners.MethodValidator.
I have even tried to use version 1.7.3 and <artifactId>powermock-api-mockito2</artifactId>
My test class is as simple as this
#RunWith(PowerMockRunner.class)
#PrepareForTest(MyStaticMethodClass.class)
public class TestStaticMethods {
#Test
public void testMyStatic() {
PowerMockito.mockStatic(MyStaticMethodClass.class);
Mockito.when(MyStaticMethodClass.getString()).thenReturn("Hello World");
String result = MyStaticMethodClass.getString();
Assert.assertEquals("Helo World", result);
}
}
I have looked into the documentation of powermock my junit version is 4.12 https://github.com/powermock/powermock/wiki/Mockito-Maven
I have the following external libraries
Are they fetched from
<dependency>
<groupId>io.dropwizard</groupId>
<artifactId>dropwizard-testing</artifactId>
<scope>test</scope>
</dependency>
Tried to exclude them but they don't disappear I am using Intellij as my IDE.
Is it because of these libraries that there might be some conflicting initializations of the testing environment?
EDIT 1
Ok, so I have tried to create a small java project with nothing other than a the following dependencies:
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<version>1.7.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito</artifactId>
<version>1.7.3</version>
<scope>test</scope>
</dependency>
my libraries are:
And my test file is exactly the same as above, then it works perfectly fine. So I guess it has to do something with Dropwizard...?
I have created a simple project using DropWizard and PowerMock and the tests execution were successful using all different versions of PM (1.6.1, 1.7.3 and 1.5.4), both using Intellij and Maven.
Having said that, it is strange that the dropwizard-testing artifact is pulling different versions of mockito (1.10.8 for all and 2.0.54-beta for core). You can exclude the mockito-core dependency from the dropwizard-testing artifact and that will at least ensure that there are no conflicting versions of mockito.
<dependency>
<groupId>io.dropwizard</groupId>
<artifactId>dropwizard-testing</artifactId>
<version>${dropwizard.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
</exclusion>
</exclusions>
</dependency>
I have also tested with versions 1.1.7 and 1.2.4 of DW but both worked fine for me.

Parent POM is taking the same version which I am giving in the module version

I have a multi module maven project for e.g.
A
B
C
D
E
Currently this project is working fine and have a single job to build all the modules and upload to the artifactory with some version for e.g. 4.0.0-.They are using versions:set -DnewVersion=4.0.0-${BUILD_NUMBER} from Jenkins job.Now my next task is to split this project into module so they dev team can build each module independetly but my issue is some modules is having the dependecy on other modules for e.g
Module B is having dependecy on module A and Module C.if I build the module A first then it generate the number 4.0.0-00001 and upload it to the artifactory and then I build the module C then it generate the build 4.0.0-00005.Now the question comes how could I build the module B which is having the dependency on module A and C.In my opinion I need to define the version of module A and C explicitly in the dependency section.
<dependency>
<groupId>com.xyz.engine</groupId>
<artifactId>A</artifactId>
<version>4.0.0-00005</version>
</dependency>
From my module POM I am calling my parent POM and In jenkins job I am giving
versions:set -DnewVersion=4.0.0-${BUILD_NUMBER} for versioning purpose if I explicity define the version of A module then it is also passing the same value to the Parent POM and searching for it which is not avilable.Below is my module POM file
<?xml version="1.0"?>
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.truvenhealth.analyticsengine</groupId>
<artifactId>AnalyticsEngine</artifactId>
<version>4.0.0-00002</version>
</parent>
<artifactId>LicenseVerifier</artifactId>
<name>LicenseVerifier</name>
<packaging>jar</packaging>
<dependencies>
<!-- Modules dependencies -->
<dependency>
<groupId>com.xyz.engine</groupId>
<artifactId>Common</artifactId>
<version>4.0.0-00007</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-expression</artifactId>
</dependency>
<!-- External dependencies -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjtools</artifactId>
<version>1.6.2</version>
</dependency>
<dependency>
<groupId>com.verhas</groupId>
<artifactId>license3j</artifactId>
<version>1.0.4</version>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>false</filtering>
</resource>
</resources>
<plugins>
<!-- Plugin configurations inherited from the parent POM -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.projectlombok</groupId>
<artifactId>lombok-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
it is taking the same value for Parent POM which I assigned to Common module .I am keeping the Parent POM in separate repository it should not take the same value it should only take that value which I am defining for the Parent POM and it should download it from their and provide all the values to module POM and the build should be created for module LicenseVerifier with different version.
If you have a multi module build which looks like this:
root (pom.xml parent of all modules)
+---- module-a (pom.xml)
+---- module-b (pom.xml)
+---- module-c (pom.xml)
+---- module-d (pom.xml)
To build a module separately you can do this via Maven like this:
mvn -pl module-a clean package
This will build the module-a only and get the dependencies of other modules from the remote repository. Or you can enhance that like this:
mvn -pl module-a -amd clean package
where the option -amd means --also-make-dependents. If a developer needs a particular state you can do this by a mvn install first and afterwards only build the module you would like to build.
A very important thing in relationship with multi module builds is to have the same version for all modules and the parent. So dependencies between those modules is no problem.
Starting with Maven 3.2.1 you can define the version via properties.
A simple change to prevent Maven from emitting warnings about versions
with property expressions. Allowed property expressions in versions
include ${revision}, ${changelist}, and ${sha1}. These properties can
be set externally, but eventually a mechanism will be created in Maven
where these properties can be injected in a standard way. For example
you may want to glean the current Git revision and inject that value
into ${sha1}. This is by no means a complete solution for continuous
delivery but is a step in the right direction.
Furthermore during development i would prefer the SNAPSHOT versions which the cleanup in the repository manager simpler. So in essence i don't any need to separate the modules which logicaly belong together.
Apart from that if you use the same version within your multimodule build you can use things like this: ${project.version} to define the version of a dependency which is part of the reactor.

Is it possible in Maven to use an external file to define dependency versions?

Specifically, is it possible to read a properties file, then use the properties defined in it
to specify the dependency versions, for example:
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>${commons-logging.version}</version> <!--should come from an external file -->
</dependency>
You can go the other way a round and let maven write the property file which contains the values for the dependenciy via Properties Maven Plugin.
You can define a property like this in you pom file:
<properties>
<commons-logging.version>2.3</commons-logging.vesion>
</properties>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>${commons-logging.version}</version>
</dependency>
and read the file in your legacy build.

How Can I have an empty version tag in Maven3

I want a dependency to be resolved with no version. Maven 3 is forcing me to use a version, I can't provide a version for the system scope jar I'm resolving. Thanks.
You can use a system property define as below to resolve dependency.
<properties>
<org.springframework.version>3.0.5.RELEASE</org.springframework.version>
</properties>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${org.springframework.version}</version>
</dependency>
You also have the option to provide Dependency Version Ranges. You might want to do is something like <version>[1.2.3,)</version>

Resources