java.lang.NoClassDefFoundError: org/hamcrest/SelfDescribing using Maven - java

I'm trying to run the junit webdriver example from sauce labs, but I get the following error when I run 'mvn test':
java.lang.NoClassDefFoundError: org/hamcrest/SelfDescribing
Here is the full pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>sauce-project</artifactId>
<groupId>com.sparkcentral</groupId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>sauce_quickstart</name>
<description>A sample Maven project that demonstrates how to integrate Sauce OnDemand with WebDriver tests
that run using JUnit
</description>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.saucelabs</groupId>
<artifactId>sauce_junit</artifactId>
<version>[1.0.0,)</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>LATEST</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<redirectTestOutputToFile>true</redirectTestOutputToFile>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>saucelabs-repository</id>
<url>https://repository-saucelabs.forge.cloudbees.com/release</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</project>
The project was created by running:
mvn archetype:generate -DarchetypeRepository=http://repository-saucelabs.forge.cloudbees.com/release -DarchetypeGroupId=com.saucelabs -DarchetypeArtifactId=quickstart-webdriver-junit -DarchetypeVersion=1.0.7 -DsauceUserName=<USERNAME> -DsauceAccessKey=<KEY>
I've tried adding an exclusion for hamcrest and also tried using junit 4.11, but I keep getting java.lang.NoClassDefFoundError: org/hamcrest/SelfDescribing
Output from mvn dependency:tree:
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.sparkcentral:sauce-project:jar:1.0-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. # line 37, column 21
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-surefire-plugin is missing. # line 44, column 21
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building sauce_quickstart 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) # sauce-project ---
[INFO] com.sparkcentral:sauce-project:jar:1.0-SNAPSHOT
[INFO] +- junit:junit:jar:4.10:test
[INFO] | \- org.hamcrest:hamcrest-core:jar:1.1:test
[INFO] +- com.saucelabs:sauce_junit:jar:2.1.3:test
[INFO] | +- com.saucelabs:sauce_java_common:jar:2.1.3:test
[INFO] | \- com.saucelabs:saucerest:jar:1.0.9:test
[INFO] | +- com.googlecode.json-simple:json-simple:jar:1.1:test
[INFO] | +- org.apache.httpcomponents:httpclient:jar:4.3.1:test
[INFO] | | +- org.apache.httpcomponents:httpcore:jar:4.3:test
[INFO] | | +- commons-logging:commons-logging:jar:1.1.3:test
[INFO] | | \- commons-codec:commons-codec:jar:1.6:test
[INFO] | \- org.json:json:jar:20090211:test
[INFO] \- org.seleniumhq.selenium:selenium-java:jar:2.42.2:test
[INFO] +- org.seleniumhq.selenium:selenium-chrome-driver:jar:2.42.2:test
[INFO] | \- org.seleniumhq.selenium:selenium-remote-driver:jar:2.42.2:test
[INFO] | +- cglib:cglib-nodep:jar:2.1_3:test
[INFO] | \- com.google.guava:guava:jar:15.0:test
[INFO] +- org.seleniumhq.selenium:selenium-htmlunit-driver:jar:2.42.2:test
[INFO] | \- net.sourceforge.htmlunit:htmlunit:jar:2.14:test
[INFO] | +- xalan:xalan:jar:2.7.1:test
[INFO] | | \- xalan:serializer:jar:2.7.1:test
[INFO] | +- commons-collections:commons-collections:jar:3.2.1:test
[INFO] | +- org.apache.commons:commons-lang3:jar:3.2.1:test
[INFO] | +- org.apache.httpcomponents:httpmime:jar:4.3.2:test
[INFO] | +- net.sourceforge.htmlunit:htmlunit-core-js:jar:2.14:test
[INFO] | +- xerces:xercesImpl:jar:2.11.0:test
[INFO] | | \- xml-apis:xml-apis:jar:1.4.01:test
[INFO] | +- net.sourceforge.nekohtml:nekohtml:jar:1.9.20:test
[INFO] | +- net.sourceforge.cssparser:cssparser:jar:0.9.13:test
[INFO] | | \- org.w3c.css:sac:jar:1.3:test
[INFO] | \- org.eclipse.jetty:jetty-websocket:jar:8.1.14.v20131031:test
[INFO] | +- org.eclipse.jetty:jetty-util:jar:8.1.14.v20131031:test
[INFO] | +- org.eclipse.jetty:jetty-io:jar:8.1.14.v20131031:test
[INFO] | \- org.eclipse.jetty:jetty-http:jar:8.1.14.v20131031:test
[INFO] +- org.seleniumhq.selenium:selenium-firefox-driver:jar:2.42.2:test
[INFO] | +- commons-io:commons-io:jar:2.4:test
[INFO] | \- org.apache.commons:commons-exec:jar:1.1:test
[INFO] +- org.seleniumhq.selenium:selenium-ie-driver:jar:2.42.2:test
[INFO] | +- net.java.dev.jna:jna:jar:3.4.0:test
[INFO] | \- net.java.dev.jna:platform:jar:3.4.0:test
[INFO] +- org.seleniumhq.selenium:selenium-safari-driver:jar:2.42.2:test
[INFO] +- org.seleniumhq.selenium:selenium-support:jar:2.42.2:test
[INFO] | \- org.seleniumhq.selenium:selenium-api:jar:2.42.2:test
[INFO] \- org.webbitserver:webbit:jar:0.4.14:test
[INFO] \- io.netty:netty:jar:3.5.2.Final:test
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.328 s
[INFO] Finished at: 2014-07-01T10:46:54-07:00
[INFO] Final Memory: 9M/81M
[INFO] ------------------------------------------------------------------------
Any advice?

How about adding the dependency for hamcrest in your pom?
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<version>1.3</version>
</dependency>
Also see this related SO question.

I've just added:
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-library</artifactId>
</dependency>
after
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<scope>test</scope>
</dependency>
and it worked in my project.

Related

SpringBoot Application fails startup when adding dependency

I have an existing SpringBoot Application that was running with no issue. I then created a Java library—a standalone repository with only static Java code, no main class. My library is deployed as a GitHub Maven package.
I then proceeded with setting up my GitHub packages repository in my local Maven settings and added the dependency to my original SpringBoot application. The import process is successful, my library's Jar is in the classpath and compilation and build are successful.
What happens next is I run the application now, and I get the following stacktrace:
02:36:51.110 [main] DEBUG org.springframework.boot.context.logging.ClasspathLoggingApplicationListener - Application failed to start with classpath: [<redacted list of classpath dependencies, including my new library>]
02:36:51.223 [main] ERROR org.springframework.boot.SpringApplication - Application run failed
java.lang.NoSuchMethodError: org.springframework.boot.builder.SpringApplicationBuilder.<init>([Ljava/lang/Object;)V
at org.springframework.cloud.bootstrap.BootstrapApplicationListener.bootstrapServiceContext(BootstrapApplicationListener.java:161)
at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:102)
at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:68)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:127)
at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:80)
at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:53)
at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:345)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:308)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1237)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226)
at my.org.transfer.TransferServicesApiApplication.main(TransferServicesApiApplication.java:18)
Process finished with exit code 1
I'm not sure what else to try and a night of Googling lead me nowhere.
This is my application's pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.4.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>my.org</groupId>
<artifactId>appname</artifactId>
<version>0.0.1-SNAPSHOT</version>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency> <!-- my library import -->
<groupId>my.org</groupId>
<artifactId>mylibrary</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.12</version>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
<version>0.9.1</version>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.10.6</version>
</dependency>
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>19.0.0</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.7</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.14</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.2</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.4</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>5.2.7.RELEASE</version>
</dependency>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-booter</artifactId>
<version>2.22.2</version>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.9.4</version>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.9.2</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.9.2</version>
</dependency>
<dependency>
<groupId>org.influxdb</groupId>
<artifactId>influxdb-java</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<goalPrefix>formatter</goalPrefix>
<executable>true</executable>
</configuration>
</plugin>
<plugin>
<groupId>net.revelc.code.formatter</groupId>
<artifactId>formatter-maven-plugin</artifactId>
<version>2.12.0</version>
</plugin>
</plugins>
</build>
</project>
My library's pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.4.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>my.org</groupId>
<artifactId>mylibrary</artifactId>
<version>0.0.1-SNAPSHOT</version>
<properties>
<java.version>1.8</java.version>
</properties>
<distributionManagement>
<repository>
<id>github</id>
<name>Github Packages</name>
<url>https://maven.pkg.github.com/my-org/library-repo</url>
</repository>
</distributionManagement>
<dependencies>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-secretsmanager</artifactId>
<version>1.11.793</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.12</version>
</dependency>
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>20.1.0</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
<version>4.4</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-aws-secrets-manager-config</artifactId>
<version>2.1.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.10</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<version>2.0.7</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-easymock</artifactId>
<version>2.0.7</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito2</artifactId>
<version>2.0.7</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>net.revelc.code.formatter</groupId>
<artifactId>formatter-maven-plugin</artifactId>
<version>2.12.0</version>
</plugin>
</plugins>
</build>
</project>
Thanks much.
Edit: set spring-boot-starter-parent version in application pom to match the version in the library pom. No changes.
Edit 2: This is the output of mvn dependency:tree (my library-injected dependency at the bottom):
[INFO] my.org.hopscotchtrading:transfer-services-api:jar:0.0.1-SNAPSHOT
[INFO] +- org.springframework.boot:spring-boot-starter:jar:2.3.4.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot:jar:2.3.4.RELEASE:compile
[INFO] | | \- org.springframework:spring-context:jar:5.2.9.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-autoconfigure:jar:2.3.4.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-logging:jar:2.3.4.RELEASE:compile
[INFO] | | +- ch.qos.logback:logback-classic:jar:1.2.3:compile
[INFO] | | | \- ch.qos.logback:logback-core:jar:1.2.3:compile
[INFO] | | +- org.apache.logging.log4j:log4j-to-slf4j:jar:2.13.3:compile
[INFO] | | | \- org.apache.logging.log4j:log4j-api:jar:2.13.3:compile
[INFO] | | \- org.slf4j:jul-to-slf4j:jar:1.7.30:compile
[INFO] | +- jakarta.annotation:jakarta.annotation-api:jar:1.3.5:compile
[INFO] | +- org.springframework:spring-core:jar:5.2.9.RELEASE:compile
[INFO] | | \- org.springframework:spring-jcl:jar:5.2.9.RELEASE:compile
[INFO] | \- org.yaml:snakeyaml:jar:1.26:compile
[INFO] +- org.springframework.boot:spring-boot-starter-test:jar:2.3.4.RELEASE:test
[INFO] | +- org.springframework.boot:spring-boot-test:jar:2.3.4.RELEASE:test
[INFO] | +- org.springframework.boot:spring-boot-test-autoconfigure:jar:2.3.4.RELEASE:test
[INFO] | +- com.jayway.jsonpath:json-path:jar:2.4.0:test
[INFO] | | \- net.minidev:json-smart:jar:2.3:test
[INFO] | | \- net.minidev:accessors-smart:jar:1.2:test
[INFO] | | \- org.ow2.asm:asm:jar:5.0.4:test
[INFO] | +- jakarta.xml.bind:jakarta.xml.bind-api:jar:2.3.3:test
[INFO] | | \- jakarta.activation:jakarta.activation-api:jar:1.2.2:test
[INFO] | +- org.assertj:assertj-core:jar:3.16.1:test
[INFO] | +- org.hamcrest:hamcrest:jar:2.2:test
[INFO] | +- org.junit.jupiter:junit-jupiter:jar:5.6.2:test
[INFO] | | +- org.junit.jupiter:junit-jupiter-api:jar:5.6.2:test
[INFO] | | | +- org.opentest4j:opentest4j:jar:1.2.0:test
[INFO] | | | \- org.junit.platform:junit-platform-commons:jar:1.6.2:test
[INFO] | | +- org.junit.jupiter:junit-jupiter-params:jar:5.6.2:test
[INFO] | | \- org.junit.jupiter:junit-jupiter-engine:jar:5.6.2:test
[INFO] | +- org.junit.vintage:junit-vintage-engine:jar:5.6.2:test
[INFO] | | +- org.apiguardian:apiguardian-api:jar:1.1.0:test
[INFO] | | +- org.junit.platform:junit-platform-engine:jar:1.6.2:test
[INFO] | | \- junit:junit:jar:4.13:test
[INFO] | +- org.mockito:mockito-core:jar:3.3.3:test
[INFO] | | +- net.bytebuddy:byte-buddy:jar:1.10.14:compile
[INFO] | | +- net.bytebuddy:byte-buddy-agent:jar:1.10.14:test
[INFO] | | \- org.objenesis:objenesis:jar:2.6:test
[INFO] | +- org.mockito:mockito-junit-jupiter:jar:3.3.3:test
[INFO] | +- org.skyscreamer:jsonassert:jar:1.5.0:test
[INFO] | | \- com.vaadin.external.google:android-json:jar:0.0.20131108.vaadin1:test
[INFO] | +- org.springframework:spring-test:jar:5.2.9.RELEASE:test
[INFO] | \- org.xmlunit:xmlunit-core:jar:2.7.0:test
[INFO] +- org.springframework.boot:spring-boot-starter-web:jar:2.3.4.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-json:jar:2.3.4.RELEASE:compile
[INFO] | | +- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar:2.11.2:compile
[INFO] | | +- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.11.2:compile
[INFO] | | \- com.fasterxml.jackson.module:jackson-module-parameter-names:jar:2.11.2:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-tomcat:jar:2.3.4.RELEASE:compile
[INFO] | | +- org.apache.tomcat.embed:tomcat-embed-core:jar:9.0.38:compile
[INFO] | | +- org.glassfish:jakarta.el:jar:3.0.3:compile
[INFO] | | \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:9.0.38:compile
[INFO] | \- org.springframework:spring-webmvc:jar:5.2.9.RELEASE:compile
[INFO] | +- org.springframework:spring-aop:jar:5.2.9.RELEASE:compile
[INFO] | \- org.springframework:spring-expression:jar:5.2.9.RELEASE:compile
[INFO] +- org.projectlombok:lombok:jar:1.18.12:compile
[INFO] +- io.jsonwebtoken:jjwt:jar:0.9.1:compile
[INFO] | \- com.fasterxml.jackson.core:jackson-databind:jar:2.11.2:compile
[INFO] | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.11.2:compile
[INFO] | \- com.fasterxml.jackson.core:jackson-core:jar:2.11.2:compile
[INFO] +- joda-time:joda-time:jar:2.10.6:compile
[INFO] +- org.jetbrains:annotations:jar:19.0.0:compile
[INFO] +- commons-io:commons-io:jar:2.7:compile
[INFO] +- commons-codec:commons-codec:jar:1.14:compile
[INFO] +- commons-collections:commons-collections:jar:3.2.2:compile
[INFO] +- commons-lang:commons-lang:jar:2.4:compile
[INFO] +- org.springframework:spring-web:jar:5.2.7.RELEASE:compile
[INFO] | \- org.springframework:spring-beans:jar:5.2.9.RELEASE:compile
[INFO] +- org.apache.maven.surefire:surefire-booter:jar:2.22.2:compile
[INFO] | \- org.apache.maven.surefire:surefire-api:jar:2.22.2:compile
[INFO] | \- org.apache.maven.surefire:surefire-logger-api:jar:2.22.2:compile
[INFO] +- commons-beanutils:commons-beanutils:jar:1.9.4:compile
[INFO] | \- commons-logging:commons-logging:jar:1.2:compile
[INFO] +- javax.validation:validation-api:jar:2.0.1.Final:compile
[INFO] +- io.springfox:springfox-swagger2:jar:2.9.2:compile
[INFO] | +- io.swagger:swagger-annotations:jar:1.5.20:compile
[INFO] | +- io.swagger:swagger-models:jar:1.5.20:compile
[INFO] | +- io.springfox:springfox-spi:jar:2.9.2:compile
[INFO] | | \- io.springfox:springfox-core:jar:2.9.2:compile
[INFO] | +- io.springfox:springfox-schema:jar:2.9.2:compile
[INFO] | +- io.springfox:springfox-swagger-common:jar:2.9.2:compile
[INFO] | +- io.springfox:springfox-spring-web:jar:2.9.2:compile
[INFO] | +- com.google.guava:guava:jar:20.0:compile
[INFO] | +- com.fasterxml:classmate:jar:1.5.1:compile
[INFO] | +- org.slf4j:slf4j-api:jar:1.7.30:compile
[INFO] | +- org.springframework.plugin:spring-plugin-core:jar:1.2.0.RELEASE:compile
[INFO] | +- org.springframework.plugin:spring-plugin-metadata:jar:1.2.0.RELEASE:compile
[INFO] | \- org.mapstruct:mapstruct:jar:1.2.0.Final:compile
[INFO] +- io.springfox:springfox-swagger-ui:jar:2.9.2:compile
[INFO] +- org.influxdb:influxdb-java:jar:2.18:compile
[INFO] | +- com.squareup.retrofit2:retrofit:jar:2.8.1:compile
[INFO] | +- com.squareup.retrofit2:converter-moshi:jar:2.8.1:compile
[INFO] | | \- com.squareup.moshi:moshi:jar:1.8.0:compile
[INFO] | +- org.msgpack:msgpack-core:jar:0.8.20:compile
[INFO] | +- com.squareup.okhttp3:okhttp:jar:3.14.9:compile
[INFO] | | \- com.squareup.okio:okio:jar:1.17.2:compile
[INFO] | \- com.squareup.okhttp3:logging-interceptor:jar:3.14.9:compile
[INFO] \- my.org:mylibrary:jar:0.0.1-SNAPSHOT:compile
[INFO] +- com.amazonaws:aws-java-sdk-secretsmanager:jar:1.11.793:compile
[INFO] | +- com.amazonaws:aws-java-sdk-core:jar:1.11.793:compile
[INFO] | | +- org.apache.httpcomponents:httpclient:jar:4.5.12:compile
[INFO] | | | \- org.apache.httpcomponents:httpcore:jar:4.4.13:compile
[INFO] | | +- software.amazon.ion:ion-java:jar:1.0.2:compile
[INFO] | | \- com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:jar:2.11.2:compile
[INFO] | \- com.amazonaws:jmespath-java:jar:1.11.793:compile
[INFO] +- org.apache.commons:commons-collections4:jar:4.4:compile
[INFO] +- org.springframework.cloud:spring-cloud-aws-secrets-manager-config:jar:2.1.1.RELEASE:compile
[INFO] | \- org.springframework.cloud:spring-cloud-context:jar:1.3.2.RELEASE:compile
[INFO] | \- org.springframework.security:spring-security-crypto:jar:5.3.4.RELEASE:compile
[INFO] \- org.apache.commons:commons-lang3:jar:3.10:compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.147 s
[INFO] Finished at: 2020-09-19T13:06:54-05:00
[INFO] ------------------------------------------------------------------------
You're using different versions of spring-boot-starter-parent (2.3.1.RELEASE and 2.3.4.RELEASE) which is probably leading to inconsistent versions where the later or earlier don't have the method. Try using 2.3.4.RELEASE in your application.
[Update]
You're still getting inconsistent versions of org.springframework:* on the classpath:
[INFO] | \- org.springframework:spring-webmvc:jar:5.2.9.RELEASE:compile
[INFO] | +- org.springframework:spring-aop:jar:5.2.9.RELEASE:compile
[INFO] | \- org.springframework:spring-expression:jar:5.2.9.RELEASE:compile
...
[INFO] +- org.springframework:spring-web:jar:5.2.7.RELEASE:compile
In your application pom.xml remove the explicit dependency from
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>5.2.7.RELEASE</version>
</dependency>
and any other dependency that is specified in the parent so you get all 5.2.9 versions in the dependency output.
Finally, there is discussion like here about requiring specific versions for Spring Boot and the latest version of spring-cloud-aws-secrets-manager-config is 2.2.4.RELEASE which makes me think your library's POM needs to be updated to use the latest.

A required class was missing while executing org.eclipse.jetty:jetty-maven-plugin:9.2.3.v20140905:run: javax/ws/rs/client/RxInvokerProvider

I keep on getting this error message:
A required class was missing while executing org.eclipse.jetty:jetty-maven-plugin:9.2.3.v20140905:run: javax/ws/rs/client/RxInvokerProvider
I have tried to remove the maven repo so that it is forced to download the library again, but with no result. If I manually add this dependency it complains on another thing and so on which makes me think it is something else that causes this.
Anyone have any clue? here is my pom.xml as well
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>se.hrmsoftware.hrm</groupId>
<artifactId>sleepy-oyster-projects</artifactId>
<version>1.2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>war</packaging>
<artifactId>sleepy-common-ws</artifactId>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.glassfish.jersey</groupId>
<artifactId>jersey-bom</artifactId>
<version>${jersey.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<!-- if your container implements Servlet API older than 3.0, use "jersey-container-servlet-core" -->
<artifactId>jersey-container-servlet-core</artifactId>
<version>2.17</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-jackson</artifactId>
<version>2.17</version>
</dependency>
<dependency>
<groupId>se.hrmsoftware.hrm</groupId>
<artifactId>sleepy-commons</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<webXml>src/main/webapp/WEB-INF/web.xml</webXml>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<inherited>true</inherited>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<jersey.version>2.26</jersey.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>
Also this project have been working but now it won't start it anymore.
Here is the maven dependency tree:
se.hrmsoftware.hrm:sleepy-common-ws:war:1.2-SNAPSHOT
[INFO] +- org.glassfish.jersey.containers:jersey-container-servlet-core:jar:2.17:compile
[INFO] | +- org.glassfish.hk2.external:javax.inject:jar:2.4.0-b10:compile
[INFO] | +- org.glassfish.jersey.core:jersey-common:jar:2.26:compile
[INFO] | | +- javax.annotation:javax.annotation-api:jar:1.2:compile
[INFO] | | \- org.glassfish.hk2:osgi-resource-locator:jar:1.0.1:compile
[INFO] | +- org.glassfish.jersey.core:jersey-server:jar:2.26:compile
[INFO] | | +- org.glassfish.jersey.core:jersey-client:jar:2.26:compile
[INFO] | | +- org.glassfish.jersey.media:jersey-media-jaxb:jar:2.26:compile
[INFO] | | \- javax.validation:validation-api:jar:1.1.0.Final:compile
[INFO] | \- javax.ws.rs:javax.ws.rs-api:jar:2.0.1:compile
[INFO] +- org.glassfish.jersey.media:jersey-media-json-jackson:jar:2.17:compile
[INFO] | +- org.glassfish.jersey.ext:jersey-entity-filtering:jar:2.26:compile
[INFO] | +- com.fasterxml.jackson.jaxrs:jackson-jaxrs-base:jar:2.3.2:compile
[INFO] | | +- com.fasterxml.jackson.core:jackson-core:jar:2.3.2:compile
[INFO] | | \- com.fasterxml.jackson.core:jackson-databind:jar:2.3.2:compile
[INFO] | +- com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:jar:2.3.2:compile
[INFO] | | \- com.fasterxml.jackson.module:jackson-module-jaxb-annotations:jar:2.3.2:compile
[INFO] | \- com.fasterxml.jackson.core:jackson-annotations:jar:2.3.2:compile
[INFO] \- se.hrmsoftware.hrm:sleepy-commons:jar:1.2-SNAPSHOT:compile
[INFO] +- org.glassfish.jersey.containers:jersey-container-servlet:jar:2.26:compile
[INFO] +- net.sourceforge.jtds:jtds:jar:1.3.1:compile
[INFO] +- com.microsoft.sqlserver:mssql-jdbc:jar:6.2.2.jre8:compile
[INFO] +- org.slf4j:slf4j-api:jar:1.7.12:compile
[INFO] +- jcifs:jcifs:jar:1.3.17:compile
[INFO] | \- javax.servlet:servlet-api:jar:2.4:compile
[INFO] +- org.slf4j:slf4j-simple:jar:1.7.12:compile
[INFO] +- commons-logging:commons-logging:jar:1.1.1:compile
[INFO] +- com.mchange:c3p0:jar:0.9.5.1:compile
[INFO] | \- com.mchange:mchange-commons-java:jar:0.2.10:compile
[INFO] +- commons-net:commons-net:jar:3.3:compile
[INFO] +- org.springframework:spring-jdbc:jar:4.1.6.RELEASE:compile
[INFO] | +- org.springframework:spring-beans:jar:4.1.6.RELEASE:compile
[INFO] | +- org.springframework:spring-core:jar:4.1.6.RELEASE:compile
[INFO] | \- org.springframework:spring-tx:jar:4.1.6.RELEASE:compile
[INFO] \- com.vaadin:vaadin-server:jar:7.5.5:compile
[INFO] +- com.vaadin:vaadin-sass-compiler:jar:0.9.12:compile
[INFO] | +- org.w3c.css:sac:jar:1.3:compile
[INFO] | \- com.vaadin.external.flute:flute:jar:1.3.0.gg2:compile
[INFO] +- com.vaadin:vaadin-shared:jar:7.5.5:compile
[INFO] | +- com.vaadin.external.streamhtmlparser:streamhtmlparser-jsilver:jar:0.0.10.vaadin1:compile
[INFO] | \- com.vaadin.external.google:guava:jar:16.0.1.vaadin1:compile
[INFO] \- org.jsoup:jsoup:jar:1.8.1:compile
javax.ws.rs.client.RxInvokerProvider was introduced in JAX RS API 2.1
Yet your dependency tree has ...
[INFO] | \- javax.ws.rs:javax.ws.rs-api:jar:2.0.1:compile
You have a bad dependency.
Whenever you encounter "Also this project have been working but now it wont start it anymore." you need to figure out what was changed when the project broke. In order to do so, you need source control (like git, mercurial or bazaar). Check out commits until you find the one where it worked before the commit and not after. Then look into what was changed.
If you use git, then git bisect may be helpful. See https://git-scm.com/book/en/v2/Git-Tools-Debugging-with-Git#_binary_search for how to do this.
If you don't use source control, now is a good time to reconsider.

Getting org.springframework.beans.factory.SmartInitializingSingleton error after upgrading from Spring Security 2.0.2 to 3.2.5.RELEASE

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:aspectj-maven-plugin:1.6:compile (default) on project services: Compiler errors:
error can't determine implemented interfaces of missing type org.springframework.beans.factory.SmartInitializingSingleton
when batch building BuildConfig[null] #Files=2845 AopXmls=#0
[Xlint:cantFindType]
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.codehaus.mojo.aspectj.CompilationFailedException: Compiler errors:
error can't determine implemented interfaces of missing type org.springframework.beans.factory.SmartInitializingSingleton
when batch building BuildConfig[null] #Files=2845 AopXmls=#0
[Xlint:cantFindType]
Below is the pom.xml
http://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
versionUpgrade-SNAPSHOT
jar
CFT services layer
<prerequisites>
<maven>2.2.1</maven>
</prerequisites>
<pluginRepositories>
<pluginRepository>
<id>Finxera</id>
<name>Finxera Repo</name>
<url>http://10.10.200.125:8081/nexus/content/groups/public</url>
<layout>default</layout>
</pluginRepository>
</pluginRepositories>
<build>
<defaultGoal>install</defaultGoal>
<!-- enable filtering on the CPIISRV-revision.properties -->
<filters>
<filter>src/main/resources/CPIISERVICES-revision.properties</filter>
</filters>
<!--enable resourcing in resources folder for all the properties files -->
<resources>
<resource>
<filtering>true</filtering>
<directory>src/main/resources</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<!-- <version>2.0.1</version> -->
<version>3.0.0</version>
<configuration>
<findbugsXmlOutput>true</findbugsXmlOutput>
<findbugsXmlWithMessages>true</findbugsXmlWithMessages>
<xmlOutput>true</xmlOutput>
</configuration>
</plugin>
<!--This plugin increase the size of maven memory -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.2</version>
<configuration>
<argLine>-Xmx1024m</argLine>
<disableXmlReport>true</disableXmlReport>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.7</version>
<configuration>
<additionalProjectnatures>
<projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
</additionalProjectnatures>
<additionalBuildcommands>
<buildcommand>org.springframework.ide.eclipse.core.springbuilder</buildcommand>
</additionalBuildcommands>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
<wtpversion>1.5</wtpversion>
</configuration>
</plugin>
<plugin>
<artifactId>maven-idea-plugin</artifactId>
<version>2.2</version>
<configuration>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
<dependenciesAsLibraries>true</dependenciesAsLibraries>
<useFullNames>false</useFullNames>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<!-- <version>1.5</version> -->
<version>1.6</version>
<configuration>
<source>1.7</source>
<verbose>true</verbose>
<complianceLevel>1.7</complianceLevel>
<showWeaveInfo>true</showWeaveInfo>
<aspectLibraries>
<aspectLibrary>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
</aspectLibrary>
</aspectLibraries>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>${aspectj.version}</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjtools</artifactId>
<version>${aspectj.version}</version>
</dependency>
<!-- Added for Stack Upgrade begins -->
<!-- <dependency> <groupId>org.springframework</groupId> <artifactId>spring-aop</artifactId>
<version>4.0.4.RELEASE</version> </dependency> <dependency> <groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId> <version>1.8.1</version> </dependency> -->
<!-- https://mvnrepository.com/artifact/javax.transaction/javax.transaction-api -->
<!-- <dependency> <groupId>javax.transaction</groupId> <artifactId>javax.transaction-api</artifactId>
<version>1.2</version> </dependency> -->
<!-- Added for Stack Upgrade ends -->
</dependencies>
</plugin>
<plugin>
<!--<groupId>com.sun.tools.xjc.maven2</groupId> <artifactId>maven-jaxb-plugin</artifactId>
<version>1.1.1</version> -->
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<version>0.12.3</version>
<!-- <groupId>org.codehaus.mojo</groupId> <artifactId>jaxb2-maven-plugin</artifactId>
<version>1.6</version> -->
<executions>
<execution>
<id>kyc</id>
<phase>generate-sources</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<generatePackage>net.nationalpayment.core.services.external.exp</generatePackage>
<schemaDirectory>src/main/resources/kyc/</schemaDirectory>
<generateDirectory>${project.build.directory}/generated-sources/kyc</generateDirectory>
<verbose>true</verbose>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<testResources>
<testResource>
<directory>src/test/resources</directory>
<filtering>true</filtering>
</testResource>
</testResources>
</build>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.2</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.2</version>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>javax.cache</groupId>
<artifactId>cache-api</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>javax.transaction</groupId>
<artifactId>javax.transaction-api</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>${jdbc.groupId}</groupId>
<artifactId>${jdbc.artifactId}</artifactId>
<version>${jdbc.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${spring.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<!-- <version>2.0.2</version> -->
<version>3.2.5.RELEASE</version>
<exclusions>
<exclusion>
<!-- declare the exclusion here -->
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${spring.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>${hibernate.version}</version>
<!--<scope>test</scope> -->
<exclusions>
<exclusion>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.14</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.9.13</version>
</dependency>
</dependencies>
<properties>
<current.build.version>versionUpgrade-SNAPSHOT</current.build.version>
<!-- Application settings -->
<dao.framework>hibernate</dao.framework>
<web.framework>spring</web.framework>
<aspectj.version>1.7.4</aspectj.version>
<commons.fileupload.version>1.2.1</commons.fileupload.version>
<commons.io.version>1.3.2</commons.io.version>
<hibernate.version>4.0.1.Final</hibernate.version>
<spring.version>4.2.3.RELEASE</spring.version>
<springmodules.validation.version>0.8</springmodules.validation.version>
</properties>
Output of mvn dependency:tree. Could not paste entire out due to text length constraint. Removed all messages related to download and downloaded. Please bear with me as i am new to maven.
Apples-MacBook-Pro-2:services vimal$ mvn dependency:tree
[INFO] Scanning for projects...
[INFO] net.nationalpayment.cp20:services:jar:versionUpgrade-SNAPSHOT
[INFO] +- javax.cache:cache-api:jar:1.0.0:compile
[INFO] +- javax.transaction:javax.transaction-api:jar:1.2:compile
[INFO] +- mysql:mysql-connector-java:jar:5.1.28:compile
[INFO] +- org.easymock:easymock:jar:2.2:test
[INFO] +- junit:junit:jar:4.4:test
[INFO] +- org.springframework:spring-test:jar:4.2.3.RELEASE:test
[INFO] | \- org.springframework:spring-core:jar:4.2.3.RELEASE:compile
[INFO] +- org.springframework.security:spring-security-core:jar:2.0.2:compile
[INFO] | +- org.springframework:spring-support:jar:2.0.8:runtime
[INFO] | \- commons-collections:commons-collections:jar:3.2:compile
[INFO] +- commons-codec:commons-codec:jar:1.4:compile
[INFO] +- org.docx4j:docx4j:jar:3.1.0:compile
[INFO] | +- org.plutext:jaxb-svg11:jar:1.0.2:compile
[INFO] | +- org.plutext:jaxb-xslfo:jar:1.0.1:compile
[INFO] | +- org.plutext:jaxb-xmldsig-core:jar:1.0.0:compile
[INFO] | +- net.engio:mbassador:jar:1.1.10:compile
[INFO] | +- org.slf4j:slf4j-api:jar:1.7.2:compile
[INFO] | +- org.slf4j:slf4j-log4j12:jar:1.7.5:compile
[INFO] | +- org.apache.xmlgraphics:xmlgraphics-commons:jar:1.5:compile
[INFO] | +- org.apache.avalon.framework:avalon-framework-api:jar:4.3.1:compile
[INFO] | +- org.apache.avalon.framework:avalon-framework-impl:jar:4.3.1:compile
[INFO] | +- net.arnx:wmf2svg:jar:0.9.0:compile
[INFO] | +- org.apache.poi:poi-scratchpad:jar:3.8:compile
[INFO] | +- org.antlr:antlr-runtime:jar:3.3:compile
[INFO] | \- org.antlr:stringtemplate:jar:3.2.1:compile
[INFO] +- com.finxera:FinxeraEncryptionUtility:jar:1.3:compile
[INFO] | +- com.amazonaws:aws-java-sdk:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-support:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-simpledb:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-simpleworkflow:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-storagegateway:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-route53:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-s3:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-importexport:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-sts:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-sqs:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-rds:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-redshift:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-elasticbeanstalk:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-glacier:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-iam:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-datapipeline:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-elasticloadbalancing:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-emr:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-elasticache:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-elastictranscoder:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-ec2:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-dynamodb:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-sns:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-cloudtrail:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-cloudwatch:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-logs:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-cognitoidentity:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-cognitosync:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-directconnect:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-cloudformation:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-cloudfront:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-kinesis:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-opsworks:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-ses:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-autoscaling:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-cloudsearch:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-cloudwatchmetrics:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-swf-libraries:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-codedeploy:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-config:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-lambda:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-ecs:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-cloudhsm:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-ssm:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-workspaces:jar:1.9.33:compile
[INFO] | | +- com.amazonaws:aws-java-sdk-machinelearning:jar:1.9.33:compile
[INFO] | | \- com.amazonaws:aws-java-sdk-core:jar:1.9.33:compile
[INFO] | | \- com.fasterxml.jackson.core:jackson-databind:jar:2.3.2:compile
[INFO] | | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.3.0:compile
[INFO] | | \- com.fasterxml.jackson.core:jackson-core:jar:2.3.2:compile
[INFO] | +- com.amazonaws:aws-java-sdk-kms:jar:1.9.33:compile
[INFO] | +- org.apache.commons:commons-lang3:jar:3.1:compile
[INFO] | +- ch.qos.logback:logback-core:jar:1.0.0:compile
[INFO] | +- ch.qos.logback:logback-classic:jar:1.0.0:compile
[INFO] | +- com.jamonapi:jamon:jar:2.4:compile
[INFO] | \- com.google.guava:guava:jar:18.0:compile
[INFO] +- net.nationalpayment.sml:sml-framework:jar:1.0:compile
[INFO] | +- net.nationalpayment.sml:sml-model:jar:1.0:compile
[INFO] | | \- com.legsem.legstar:legstar-coxbapi:jar:1.5.8:compile
[INFO] | | \- org.codehaus.jackson:jackson-xc:jar:1.6.0:compile
[INFO] | \- com.legsem.legstar:legstar-coxbrt:jar:1.5.8:compile
[INFO] +- org.apache.poi:poi:jar:3.8:compile
[INFO] +- org.apache.poi:poi-ooxml:jar:3.8:compile
[INFO] | \- dom4j:dom4j:jar:1.6.1:compile
[INFO] +- org.apache.poi:poi-ooxml-schemas:jar:3.8:compile
[INFO] | \- org.apache.xmlbeans:xmlbeans:jar:2.3.0:compile
[INFO] | \- stax:stax-api:jar:1.0.1:compile
[INFO] +- joda-time:joda-time:jar:2.9.4:compile
[INFO] +- commons-net:commons-net:jar:2.0:compile
[INFO] +- bai-parser:bai-parser:jar:1.1:compile
[INFO] +- org.apache.commons:commons-vfs2:jar:2.0:compile
[INFO] | +- org.apache.maven.scm:maven-scm-api:jar:1.4:compile
[INFO] | | \- org.codehaus.plexus:plexus-utils:jar:1.5.6:compile
[INFO] | \- org.apache.maven.scm:maven-scm-provider-svnexe:jar:1.4:compile
[INFO] | +- org.apache.maven.scm:maven-scm-provider-svn-commons:jar:1.4:compile
[INFO] | \- regexp:regexp:jar:1.3:compile
[INFO] +- com.jcraft:jsch:jar:0.1.49:compile
[INFO] +- commons-io:commons-io:jar:1.4:compile
[INFO] +- org.springframework:spring-orm:jar:4.2.3.RELEASE:compile
[INFO] | +- org.springframework:spring-beans:jar:4.2.3.RELEASE:compile
[INFO] | \- org.springframework:spring-tx:jar:4.2.3.RELEASE:compile
[INFO] +- org.springframework:spring-aop:jar:4.2.3.RELEASE:compile
[INFO] | \- aopalliance:aopalliance:jar:1.0:compile
[INFO] +- org.springframework:spring-jdbc:jar:4.2.3.RELEASE:runtime
[INFO] +- org.springframework:spring-aspects:jar:4.2.3.RELEASE:compile
[INFO] | \- org.aspectj:aspectjweaver:jar:1.8.7:compile
[INFO] +- org.springframework:spring-context-support:jar:4.2.3.RELEASE:compile
[INFO] | \- org.springframework:spring-context:jar:4.2.3.RELEASE:compile
[INFO] | \- org.springframework:spring-expression:jar:4.2.3.RELEASE:compile
[INFO] +- javax.mail:mail:jar:1.4:compile
[INFO] | \- javax.activation:activation:jar:1.1:compile
[INFO] +- org.apache.velocity:velocity:jar:1.5:compile
[INFO] | \- oro:oro:jar:2.0.8:compile
[INFO] +- org.bouncycastle:bcprov-jdk16:jar:1.45:compile
[INFO] +- org.bouncycastle:bcpg-jdk16:jar:1.45:compile
[INFO] +- org.bouncycastle:bcmail-jdk16:jar:1.45:compile
[INFO] +- org.jasypt:jasypt:jar:1.6:compile
[INFO] +- commons-httpclient:commons-httpclient:jar:3.1:compile
[INFO] +- org.apache.httpcomponents:httpclient:jar:4.2.3:compile
[INFO] | \- org.apache.httpcomponents:httpcore:jar:4.2.2:compile
[INFO] +- org.ostermiller:utils:jar:1.07.00:compile
[INFO] +- org.apache.xmlgraphics:fop:jar:1.0:compile
[INFO] | +- org.apache.xmlgraphics:batik-svg-dom:jar:1.7:compile
[INFO] | | +- org.apache.xmlgraphics:batik-anim:jar:1.7:compile
[INFO] | | +- org.apache.xmlgraphics:batik-css:jar:1.7:compile
[INFO] | | +- org.apache.xmlgraphics:batik-dom:jar:1.7:compile
[INFO] | | +- org.apache.xmlgraphics:batik-parser:jar:1.7:compile
[INFO] | | +- org.apache.xmlgraphics:batik-util:jar:1.7:compile
[INFO] | | \- xml-apis:xml-apis-ext:jar:1.3.04:compile
[INFO] | +- org.apache.xmlgraphics:batik-bridge:jar:1.7:compile
[INFO] | | +- org.apache.xmlgraphics:batik-script:jar:1.7:compile
[INFO] | | | \- org.apache.xmlgraphics:batik-js:jar:1.7:compile
[INFO] | | \- org.apache.xmlgraphics:batik-xml:jar:1.7:compile
[INFO] | +- org.apache.xmlgraphics:batik-awt-util:jar:1.7:compile
[INFO] | +- org.apache.xmlgraphics:batik-gvt:jar:1.7:compile
[INFO] | +- org.apache.xmlgraphics:batik-transcoder:jar:1.7:compile
[INFO] | | \- org.apache.xmlgraphics:batik-svggen:jar:1.7:compile
[INFO] | +- org.apache.xmlgraphics:batik-extension:jar:1.7:compile
[INFO] | \- org.apache.xmlgraphics:batik-ext:jar:1.7:compile
[INFO] +- javax.xml:jaxrpc-api:jar:1.1:compile
[INFO] +- axis:axis:jar:1.4:compile
[INFO] | +- org.apache.axis:axis-jaxrpc:jar:1.4:compile
[INFO] | +- org.apache.axis:axis-saaj:jar:1.4:compile
[INFO] | \- commons-discovery:commons-discovery:jar:0.2:runtime
[INFO] +- org.apache.axis2:axis2-kernel:jar:1.4:compile
[INFO] | +- javax.servlet:servlet-api:jar:2.3:compile
[INFO] | +- commons-fileupload:commons-fileupload:jar:1.2:compile
[INFO] | +- org.apache.httpcomponents:httpcore-nio:jar:4.0-beta1:compile
[INFO] | +- wsdl4j:wsdl4j:jar:1.6.2:compile
[INFO] | +- backport-util-concurrent:backport-util-concurrent:jar:3.1:compile
[INFO] | +- org.codehaus.woodstox:wstx-asl:jar:3.2.4:compile
[INFO] | +- org.apache.ws.commons.schema:XmlSchema:jar:1.4.2:compile
[INFO] | +- org.apache.neethi:neethi:jar:2.0.4:compile
[INFO] | +- org.apache.woden:woden-api:jar:1.0M8:compile
[INFO] | | +- org.apache.ant:ant:jar:1.7.0:compile
[INFO] | | | \- org.apache.ant:ant-launcher:jar:1.7.0:compile
[INFO] | | \- xerces:xmlParserAPIs:jar:2.6.0:compile
[INFO] | +- org.apache.woden:woden-impl-dom:jar:1.0M8:compile
[INFO] | +- annogen:annogen:jar:0.1.0:compile
[INFO] | +- org.apache.geronimo.specs:geronimo-jms_1.1_spec:jar:1.1:compile
[INFO] | +- org.apache.ws.commons.axiom:axiom-dom:jar:1.2.7:compile
[INFO] | \- org.apache.geronimo.specs:geronimo-stax-api_1.0_spec:jar:1.0.1:compile
[INFO] +- org.apache.axis2:axis2-adb:jar:1.4:compile
[INFO] | \- org.apache.geronimo.specs:geronimo-activation_1.1_spec:jar:1.0.1:compile
[INFO] +- org.apache.ws.commons.axiom:axiom-api:jar:1.2.7:compile
[INFO] | +- org.apache.geronimo.specs:geronimo-javamail_1.4_spec:jar:1.2:compile
[INFO] | +- jaxen:jaxen:jar:1.1.1:compile
[INFO] | \- xml-apis:xml-apis:jar:1.3.04:compile
[INFO] +- org.apache.axis2:axis2:jar:1.4:compile
[INFO] +- org.apache.ws.commons.axiom:axiom-impl:jar:1.2.7:compile
[INFO] +- org.jdom:jdom:jar:1.1:compile
[INFO] +- org.codehaus.castor:castor-xml:jar:1.3.1:compile
[INFO] | \- org.codehaus.castor:castor-core:jar:1.3.1:compile
[INFO] +- org.codehaus.castor:spring-xml:jar:1.2.1:compile
[INFO] +- com.itextpdf:itextpdf:jar:5.1.3:compile
[INFO] +- com.lowagie:itext:jar:2.0.7:compile
[INFO] +- net.sf.jxls:jxls-core:jar:1.0-RC-2:compile
[INFO] | +- commons-beanutils:commons-beanutils:jar:1.8.2:compile
[INFO] | +- commons-digester:commons-digester:jar:2.0:compile
[INFO] | \- org.apache.commons:commons-jexl:jar:2.0.1:compile
[INFO] +- xerces:xercesImpl:jar:2.9.1:compile
[INFO] +- org.cdgsoftware:x937-BBX:jar:0.1.4.8:compile
[INFO] | +- com.sun.media:jai_codec:jar:1.1.3:compile
[INFO] | \- javax.media:jai_core:jar:1.1.3:compile
[INFO] +- org.bancbox.payment21:bancbox-payment21:jar:1.0.1:compile
[INFO] | +- org.apache.cxf:cxf-rt-frontend-jaxws:jar:2.7.3:compile
[INFO] | | +- xml-resolver:xml-resolver:jar:1.2:compile
[INFO] | | +- org.apache.cxf:cxf-api:jar:2.7.3:compile
[INFO] | | | \- org.codehaus.woodstox:woodstox-core-asl:jar:4.1.4:runtime
[INFO] | | | \- org.codehaus.woodstox:stax2-api:jar:3.1.1:runtime
[INFO] | | +- org.apache.cxf:cxf-rt-core:jar:2.7.3:compile
[INFO] | | +- org.apache.cxf:cxf-rt-bindings-soap:jar:2.7.3:compile
[INFO] | | | \- org.apache.cxf:cxf-rt-databinding-jaxb:jar:2.7.3:compile
[INFO] | | +- org.apache.cxf:cxf-rt-bindings-xml:jar:2.7.3:compile
[INFO] | | +- org.apache.cxf:cxf-rt-frontend-simple:jar:2.7.3:compile
[INFO] | | \- org.apache.cxf:cxf-rt-ws-addr:jar:2.7.3:compile
[INFO] | | \- org.apache.cxf:cxf-rt-ws-policy:jar:2.7.3:compile
[INFO] | +- org.apache.cxf:cxf-rt-transports-http:jar:2.7.3:compile
[INFO] | \- org.apache.cxf:cxf-rt-ws-security:jar:2.7.3:compile
[INFO] | \- org.apache.ws.security:wss4j:jar:1.6.9:compile
[INFO] | +- org.apache.santuario:xmlsec:jar:1.5.3:compile
[INFO] | \- org.opensaml:opensaml:jar:2.5.1-1:compile
[INFO] | \- org.opensaml:openws:jar:1.4.2-1:compile
[INFO] | \- org.opensaml:xmltooling:jar:1.3.2-1:compile
[INFO] +- com.paypal:paypal_stubs:jar:4.3.1:compile
[INFO] +- com.paypal:paypal_base:jar:4.3.1:compile
[INFO] +- commons-configuration:commons-configuration:jar:1.8:compile
[INFO] +- com.bancbox:generate-key:jar:1.0.0:compile
[INFO] | +- org.apache.commons:commons-math3:jar:3.0:compile
[INFO] | \- commons-cli:commons-cli:jar:1.2:compile
[INFO] +- com.braintreepayments.gateway:braintree-java:jar:2.46.0:compile
[INFO] +- com.chrislaforetsoftware:fedwireparser:jar:1.0:compile
[INFO] +- com.litle:litle-sdk-for-java:jar:8.17.0:compile
[INFO] | +- org.apache.httpcomponents:fluent-hc:jar:4.2.3:compile
[INFO] | +- org.apache.httpcomponents:httpclient-cache:jar:4.2.3:compile
[INFO] | +- org.apache.httpcomponents:httpmime:jar:4.2.3:compile
[INFO] | +- javax.xml.bind:jaxb-api:jar:2.2.6:compile
[INFO] | +- com.sun.xml.bind:jaxb-impl:jar:2.2.6:compile
[INFO] | \- javax.xml:jsr173:jar:1.0:compile
[INFO] +- xalan:xalan:jar:2.7.1:compile
[INFO] | \- xalan:serializer:jar:2.7.1:compile
[INFO] +- com.google.code.gson:gson:jar:2.3.1:compile
[INFO] +- com.github.ffpojo:ffpojo:jar:1.0:compile
[INFO] +- cglib:cglib:jar:2.2:compile
[INFO] | \- asm:asm:jar:3.1:compile
[INFO] +- au.com.bytecode:opencsv:jar:2.4:compile
[INFO] +- org.dbunit:dbunit:jar:2.2:test
[INFO] | \- junit-addons:junit-addons:jar:1.4:test
[INFO] +- org.hibernate.javax.persistence:hibernate-jpa-2.0-api:jar:1.0.1.Final:compile
[INFO] +- org.hibernate:hibernate-core:jar:4.0.1.Final:compile
[INFO] | +- antlr:antlr:jar:2.7.7:compile
[INFO] | +- org.jboss.spec.javax.transaction:jboss-transaction-api_1.1_spec:jar:1.0.0.Final:compile
[INFO] | +- org.jboss.logging:jboss-logging:jar:3.1.0.CR2:compile
[INFO] | +- org.javassist:javassist:jar:3.15.0-GA:compile
[INFO] | \- org.hibernate.common:hibernate-commons-annotations:jar:4.0.1.Final:compile
[INFO] +- org.hibernate:hibernate-entitymanager:jar:4.0.1.Final:compile
[INFO] +- geronimo-spec:geronimo-spec-jta:jar:1.0.1B-rc4:provided
[INFO] +- commons-logging:commons-logging:jar:1.1.3:compile
[INFO] +- net.sf.ehcache:ehcache-core:jar:2.2.0:compile
[INFO] +- commons-validator:commons-validator:jar:1.4.0:compile
[INFO] +- commons-lang:commons-lang:jar:2.5:compile
[INFO] +- log4j:log4j:jar:1.2.14:compile
[INFO] +- org.codehaus.jackson:jackson-mapper-asl:jar:1.9.13:compile
[INFO] | \- org.codehaus.jackson:jackson-core-asl:jar:1.9.13:compile
[INFO] +- de.odysseus.staxon:staxon:jar:1.3:compile
[INFO] +- org.apache.lucene:lucene-core:jar:5.4.1:compile
[INFO] +- org.apache.lucene:lucene-analyzers-common:jar:5.4.1:compile
[INFO] +- org.apache.lucene:lucene-queryparser:jar:5.4.1:compile
[INFO] | \- org.apache.lucene:lucene-sandbox:jar:5.4.1:compile
[INFO] +- org.apache.lucene:lucene-queries:jar:5.4.1:compile
[INFO] \- com.rabbitmq:amqp-client:jar:3.4.1:compile
[INFO]
[INFO] BUILD SUCCESS
[INFO] Total time: 2:08.333s
[INFO] Finished at: Tue Aug 30 12:11:28 IST 2016
[INFO] Final Memory: 21M/200M
I am using Spring 4.2.3.RELEASE.
Thanks in advance.
Recommended Options
Go to spring boot initializr site, select spring security stack as shown in below and generate the sample application/pom file and refactor your dependencies accordingly.
As spring-boot uses the concept of opinionated dependencies and Bill of Materials, it will pull up your appropriate version of your dependencies which will resolve your jar conflict.
SmartInitializingSingleton may require newer version of Spring than the version, which is in your pom:
<version>3.2.5.RELEASE</version>
Try:
<version>4.2.3.RELEASE</version>
You may be also mising various versions of Spring in your pom file. Put the same version in all Spring dependencies.

How to import artifact from one subproject into another in multimodule project?

Collegues, i have subproject utils in my multimodule project. The pom looks like:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>parent</artifactId>
<groupId>com.comp.kort</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>utils</artifactId>
<dependencies>
<dependency>
<groupId>com.sun.mail</groupId>
<artifactId>javax.mail</artifactId>
<version>1.5.5</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>${project.build.sourceJdk}</source>
<target>${project.build.targetJdk}</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
</plugins>
</build>
</project>
I run command mvn clean install and utils-1.0-SNAPSHOT.jar is created in the local maven repository.
After that i add next dependency into pom of another subproject
<dependency>
<groupId>com.comp.kort</groupId>
<artifactId>utils</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
But when i add import com.comp.kort to classes of my second subproject i receive Can't resolve symbol 'kort'.
What should i to import com.comp.kort in the second subproject correctly?
mvn dependency:tree on my second subproject shows:
[INFO] com.comp.kort:kort-sp-integration:jar:1.0-SNAPSHOT
[INFO] +- org.springframework.batch:spring-batch-core:jar:3.0.7.RELEASE:compile
[INFO] | +- com.ibm.jbatch:com.ibm.jbatch-tck-spi:jar:1.0:compile
[INFO] | | \- javax.batch:javax.batch-api:jar:1.0:compile
[INFO] | +- com.thoughtworks.xstream:xstream:jar:1.4.7:compile
[INFO] | | +- xmlpull:xmlpull:jar:1.1.3.1:compile
[INFO] | | \- xpp3:xpp3_min:jar:1.1.4c:compile
[INFO] | +- org.codehaus.jettison:jettison:jar:1.2:compile
[INFO] | +- org.springframework.batch:spring-batch-infrastructure:jar:3.0.7.RELEASE:compile
[INFO] | | \- org.springframework.retry:spring-retry:jar:1.1.0.RELEASE:compile
[INFO] | +- org.springframework:spring-aop:jar:4.0.5.RELEASE:compile
[INFO] | | \- aopalliance:aopalliance:jar:1.0:compile
[INFO] | +- org.springframework:spring-beans:jar:4.0.5.RELEASE:compile
[INFO] | +- org.springframework:spring-context:jar:4.0.5.RELEASE:compile
[INFO] | | \- org.springframework:spring-expression:jar:4.0.5.RELEASE:compile
[INFO] | +- org.springframework:spring-core:jar:4.0.5.RELEASE:compile
[INFO] | \- org.springframework:spring-tx:jar:4.0.5.RELEASE:compile
[INFO] +- org.springframework:spring-jdbc:jar:4.2.6.RELEASE:compile
[INFO] +- org.apache.commons:commons-dbcp2:jar:2.1.1:compile
[INFO] | +- org.apache.commons:commons-pool2:jar:2.4.2:compile
[INFO] | \- commons-logging:commons-logging:jar:1.2:compile
[INFO] +- commons-io:commons-io:jar:2.2:compile
[INFO] +- log4j:log4j:jar:1.2.17:compile
[INFO] +- com.microsoft.sqlserver:sqljdbc4:jar:4.2:compile
[INFO] +- org.apache.commons:commons-lang3:jar:3.4:compile
[INFO] +- junit:junit:jar:4.12:test
[INFO] | \- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] +- com.sun.mail:javax.mail:jar:1.5.5:compile
[INFO] | \- javax.activation:activation:jar:1.1:compile
[INFO] \- com.comp.kort:utils:jar:1.0-SNAPSHOT:compile
It seems <scope>provided</scope> is not right, and you can remove it.
Provided is much like compile, but indicates you expect the JDK or a container to provide the dependency at runtime. For example, when building a web application for the Java Enterprise Edition, you would set the dependency on the Servlet API and related Java EE APIs to scope provided because the web container provides those classes. This scope is only available on the compilation and test classpath, and is not transitive.
You can see here

Maven package error: An attached artifact must have a different ID than its corresponding main artifact

Geting this error on: mvn package
It fails to build every time with the same error, I've tried renaming the artifact, as well as changing dependencies for build in the pom file. Please see more details below:
Any help would be very much appreciated.
error:
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.599 s
[INFO] Finished at: 2014-09-29T14:49:45+01:00
[INFO] Final Memory: 33M/379M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.1.7.RELEASE:repackage (default) on project compiled: Execution default of goal org.springframework.boot:spring-boot-maven-plugin:1.1.7.RELEASE:repackage failed: For artifact {com.phil-hudson:compiled:1.0-SNAPSHOT:war}: An attached artifact must have a different ID than its corresponding main artifact. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
Process finished with exit code 1
pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.phil-hudson</groupId>
<artifactId>compiled</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
<properties>
<!-- Generic properties -->
<java.version>1.8</java.version>
</properties>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.1.5.RELEASE</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.3.2</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>com.wordnik</groupId>
<artifactId>swagger-jaxrs_2.10</artifactId>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.9.13</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
<version>2.2.8-b01</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.2-promoted-b65</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-servlet-api</artifactId>
<version>8.0.12</version>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.1</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>1.1.7.RELEASE</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.3</version>
<configuration>
<warName>disney-product-feed</warName>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-releases</id>
<url>http://repo.spring.io/libs-release</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-releases</id>
<url>http://repo.spring.io/libs-release</url>
</pluginRepository>
</pluginRepositories>
</project>
mvn dependency:tree
[INFO] +- org.springframework.boot:spring-boot-starter-web:jar:1.1.5.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter:jar:1.1.5.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot:jar:1.1.5.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot-autoconfigure:jar:1.1.5.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot-starter-logging:jar:1.1.5.RELEASE:compile
[INFO] | | | +- org.slf4j:jcl-over-slf4j:jar:1.7.7:compile
[INFO] | | | +- org.slf4j:jul-to-slf4j:jar:1.7.7:compile
[INFO] | | | +- org.slf4j:log4j-over-slf4j:jar:1.7.7:compile
[INFO] | | | \- ch.qos.logback:logback-classic:jar:1.1.2:compile
[INFO] | | | \- ch.qos.logback:logback-core:jar:1.1.2:compile
[INFO] | | \- org.yaml:snakeyaml:jar:1.13:runtime
[INFO] | +- org.springframework.boot:spring-boot-starter-tomcat:jar:1.1.5.RELEASE:compile
[INFO] | | +- org.apache.tomcat.embed:tomcat-embed-core:jar:7.0.54:compile
[INFO] | | +- org.apache.tomcat.embed:tomcat-embed-el:jar:7.0.54:compile
[INFO] | | \- org.apache.tomcat.embed:tomcat-embed-logging-juli:jar:7.0.54:compile
[INFO] | +- org.hibernate:hibernate-validator:jar:5.0.3.Final:compile
[INFO] | | +- javax.validation:validation-api:jar:1.1.0.Final:compile
[INFO] | | +- org.jboss.logging:jboss-logging:jar:3.1.1.GA:compile
[INFO] | | \- com.fasterxml:classmate:jar:1.0.0:compile
[INFO] | +- org.springframework:spring-core:jar:4.0.6.RELEASE:compile
[INFO] | \- org.springframework:spring-webmvc:jar:4.0.6.RELEASE:compile
[INFO] | \- org.springframework:spring-expression:jar:4.0.6.RELEASE:compile
[INFO] +- org.springframework:spring-web:jar:4.0.6.RELEASE:compile
[INFO] | +- org.springframework:spring-aop:jar:4.0.6.RELEASE:compile
[INFO] | | \- aopalliance:aopalliance:jar:1.0:compile
[INFO] | +- org.springframework:spring-beans:jar:4.0.6.RELEASE:compile
[INFO] | \- org.springframework:spring-context:jar:4.0.6.RELEASE:compile
[INFO] +- com.fasterxml.jackson.core:jackson-databind:jar:2.3.3:compile
[INFO] | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.3.3:compile
[INFO] | \- com.fasterxml.jackson.core:jackson-core:jar:2.3.3:compile
[INFO] +- org.apache.commons:commons-lang3:jar:3.3.2:compile
[INFO] +- org.springframework.boot:spring-boot-starter-test:jar:1.1.5.RELEASE:compile
[INFO] | +- junit:junit:jar:4.11:compile
[INFO] | +- org.mockito:mockito-core:jar:1.9.5:compile
[INFO] | | \- org.objenesis:objenesis:jar:1.0:compile
[INFO] | +- org.hamcrest:hamcrest-core:jar:1.3:compile
[INFO] | +- org.hamcrest:hamcrest-library:jar:1.3:compile
[INFO] | \- org.springframework:spring-test:jar:4.0.6.RELEASE:compile
[INFO] +- javax.inject:javax.inject:jar:1:compile
[INFO] +- com.wordnik:swagger-jaxrs_2.10:jar:1.3.2:compile
[INFO] | +- org.scala-lang:scala-library:jar:2.10.0:compile
[INFO] | +- com.wordnik:swagger-core_2.10:jar:1.3.2:compile
[INFO] | | +- commons-lang:commons-lang:jar:2.4:compile
[INFO] | | +- org.slf4j:slf4j-api:jar:1.7.7:compile
[INFO] | | +- com.fasterxml.jackson.module:jackson-module-scala_2.10:jar:2.1.5:compile
[INFO] | | | +- com.thoughtworks.paranamer:paranamer:jar:2.3:compile
[INFO] | | | \- org.scala-lang:scala-reflect:jar:2.10.0:compile
[INFO] | | +- com.fasterxml.jackson.module:jackson-module-jsonSchema:jar:2.1.0:compile
[INFO] | | +- com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:jar:2.0.0:compile
[INFO] | | | \- com.fasterxml.jackson.module:jackson-module-jaxb-annotations:jar:2.0.0:compile
[INFO] | | +- com.wordnik:swagger-annotations:jar:1.3.2:compile
[INFO] | | +- org.json4s:json4s-ext_2.10:jar:3.2.4:compile
[INFO] | | | +- joda-time:joda-time:jar:2.3:compile
[INFO] | | | \- org.joda:joda-convert:jar:1.2:compile
[INFO] | | +- org.json4s:json4s-native_2.10:jar:3.2.4:compile
[INFO] | | | \- org.json4s:json4s-core_2.10:jar:3.2.4:compile
[INFO] | | | +- org.json4s:json4s-ast_2.10:jar:3.2.4:compile
[INFO] | | | \- org.scala-lang:scalap:jar:2.10.0:compile
[INFO] | | | \- org.scala-lang:scala-compiler:jar:2.10.0:compile
[INFO] | | \- org.json4s:json4s-jackson_2.10:jar:3.2.4:compile
[INFO] | +- javax.ws.rs:jsr311-api:jar:1.1.1:compile
[INFO] | \- org.reflections:reflections:jar:0.9.8:compile
[INFO] | +- com.google.guava:guava:jar:11.0.2:compile
[INFO] | | \- com.google.code.findbugs:jsr305:jar:1.3.9:compile
[INFO] | +- javassist:javassist:jar:3.12.1.GA:compile
[INFO] | \- dom4j:dom4j:jar:1.6.1:compile
[INFO] | \- xml-apis:xml-apis:jar:1.0.b2:compile
[INFO] +- org.codehaus.jackson:jackson-mapper-asl:jar:1.9.13:compile
[INFO] | \- org.codehaus.jackson:jackson-core-asl:jar:1.9.13:compile
[INFO] +- com.sun.xml.bind:jaxb-core:jar:2.2.8-b01:compile
[INFO] | +- javax.xml.bind:jaxb-api:jar:2.2.9:compile
[INFO] | \- com.sun.istack:istack-commons-runtime:jar:2.16:compile
[INFO] +- com.sun.xml.bind:jaxb-impl:jar:2.2-promoted-b65:compile
[INFO] +- org.apache.tomcat:tomcat-servlet-api:jar:8.0.12:compile
[INFO] \- javax.servlet.jsp:jsp-api:jar:2.1:provided
As Dimitri suggested, I solved this by adding classifier to spring-boot-maven-plugin:
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<classifier>boot</classifier>
</configuration>
</plugin>
Looks like a bug in spring-boot-maven-plugin together with your version of Maven.
As far as I can tell, Maven knows that the WAR plugin will generate the file target/compiled-1.0-SNAPSHOT.war. when it asks the spring-boot-maven-plugin for its output, it will get the same name. Since Maven doesn't know what the plugin does, it will assume that both are configured to create the same output file and stop since that can't be what you want (the files will overwrite each other).
Try with the latest version of Maven or file a bug against the spring-boot-maven-plugin. Let them know which version of Maven you're using.
I am currently facing the same issue.
However, providing the required parameter finalName, I can see that the .war file is well boot-ified.
Please note that I still encounter the error message in both cases (with and without the finalName).
Here is the link to the issue I opened on the Spring Boot project: https://github.com/spring-projects/spring-boot/issues/2060
All that is required is to include a <finalName> tag in the build section.
<build>
<finalName>myJar</finalName>
</build>

Categories