Maven Dependency Tree - Some dependencies of Spring use old version - java

I do not have so much experience with Maven (I apologies in advance, if you will find the following scenario trivial). In POM.xml, I specified Spring version:
<properties>
...
<spring.version>4.3.6.RELEASE</spring.version>
</properties>
and then, I use it for all the Spring dependencies:
...
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>${spring.version}</version>
</dependency>
...
But when I execute: mvn dependency:tree, I can see that some dependencies (for example: spring-core) use old version numbers. Can you explain this please.
Tracking admin$ mvn dependency:tree
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Tracking 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:3.0.0:tree (default-cli) # Tracking ---
[INFO] com.mycompany:Tracking:war:1.0-SNAPSHOT
[INFO] +- javax.persistence:persistence-api:jar:1.0.2:compile
[INFO] +- javax.validation:validation-api:jar:1.1.0.Final:compile
[INFO] +- javax.servlet:javax.servlet-api:jar:3.0.1:provided
[INFO] +- com.sun.jersey:jersey-server:jar:1.2:compile
[INFO] | +- com.sun.jersey:jersey-core:jar:1.2:compile
[INFO] | | \- javax.ws.rs:jsr311-api:jar:1.1.1:compile
[INFO] | \- asm:asm:jar:3.1:compile
[INFO] +- com.sun.jersey.contribs:jersey-spring:jar:1.17:compile
[INFO] | \- com.sun.jersey:jersey-servlet:jar:1.17:compile
[INFO] +- org.springframework:spring-aop:jar:3.0.0.RC3:compile
[INFO] | +- aopalliance:aopalliance:jar:1.0:compile
[INFO] | \- org.springframework:spring-asm:jar:3.0.0.RC3:compile
[INFO] +- org.springframework:spring-aspects:jar:4.3.6.RELEASE:compile
[INFO] | \- org.aspectj:aspectjweaver:jar:1.8.9:compile
[INFO] +- org.springframework:spring-beans:jar:3.0.0.RC3:compile
[INFO] +- org.springframework:spring-context:jar:3.0.0.RC3:compile
[INFO] +- org.springframework:spring-context-support:jar:4.3.6.RELEASE:compile
[INFO] +- org.springframework:spring-core:jar:3.0.0.RC3:compile
[INFO] | \- commons-logging:commons-logging:jar:1.1.1:compile
[INFO] +- org.springframework:spring-expression:jar:4.3.6.RELEASE:compile
[INFO] +- org.springframework:spring-instrument:jar:4.3.6.RELEASE:compile
[INFO] +- org.springframework:spring-instrument-tomcat:jar:4.3.6.RELEASE:compile
[INFO] +- org.springframework:spring-jdbc:jar:4.3.6.RELEASE:compile
[INFO] +- org.springframework:spring-jms:jar:4.3.6.RELEASE:compile
[INFO] +- org.springframework:spring-messaging:jar:4.3.6.RELEASE:compile
[INFO] +- org.springframework:spring-orm:jar:4.3.6.RELEASE:compile
[INFO] +- org.springframework:spring-oxm:jar:4.3.6.RELEASE:compile
[INFO] +- org.springframework:spring-test:jar:4.3.6.RELEASE:compile
[INFO] +- org.springframework:spring-tx:jar:4.3.6.RELEASE:compile
[INFO] +- org.springframework:spring-web:jar:3.0.0.RC3:compile
[INFO] +- org.springframework:spring-webmvc:jar:4.3.6.RELEASE:compile
[INFO] +- org.springframework:spring-webmvc-portlet:jar:4.3.6.RELEASE:compile
[INFO] +- org.springframework:spring-websocket:jar:4.3.6.RELEASE:compile
[INFO] +- javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api:jar:1.2.1:compile
[INFO] +- mysql:mysql-connector-java:jar:5.1.6:compile
[INFO] +- xerces:xercesImpl:jar:2.11.0:compile
[INFO] +- cglib:cglib:jar:3.2.4:compile
[INFO] | +- org.ow2.asm:asm:jar:5.1:compile
[INFO] | \- org.apache.ant:ant:jar:1.9.6:compile
[INFO] | \- org.apache.ant:ant-launcher:jar:1.9.6:compile
[INFO] +- org.apache.commons:commons-lang3:jar:3.5:compile
[INFO] +- org.liquibase:liquibase-maven-plugin:jar:3.0.4:compile
[INFO] | +- org.apache.maven:maven-plugin-api:jar:2.0:compile
[INFO] | +- org.apache.maven:maven-project:jar:2.0:compile
[INFO] | | +- org.apache.maven:maven-profile:jar:2.0:compile
[INFO] | | +- org.apache.maven:maven-model:jar:2.0:compile
[INFO] | | +- org.apache.maven:maven-artifact-manager:jar:2.0:compile
[INFO] | | | +- org.apache.maven:maven-repository-metadata:jar:2.0:compile
[INFO] | | | \- org.apache.maven.wagon:wagon-provider-api:jar:1.0-alpha-5:compile
[INFO] | | +- org.codehaus.plexus:plexus-utils:jar:1.0.4:compile
[INFO] | | +- org.apache.maven:maven-artifact:jar:2.0:compile
[INFO] | | \- org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-8:compile
[INFO] | | +- junit:junit:jar:3.8.1:compile
[INFO] | | \- classworlds:classworlds:jar:1.1-alpha-2:compile
[INFO] | \- org.liquibase:liquibase-core:jar:3.0.4:compile
[INFO] +- org.yaml:snakeyaml:jar:1.18:compile
[INFO] \- xml-apis:xml-apis:jar:1.4.01:compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.200 s
[INFO] Finished at: 2017-02-26T18:02:17+02:00
[INFO] Final Memory: 17M/220M
[INFO] ------------------------------------------------------------------------
Tracking admin$

If you want to use artifacts with version matching ${spring.version}, you need to provide core dependencies manually. Some Spring dependencies use artifacts with older versions.
Also useful thing is dependency exclusion which you can use here to say strictly to Maven that you don't want to use specific dependency from other dependencies.
Example of exclusion:
<dependencies>
<dependency>
<groupId>sample.spring</groupId>
<artifactId>spring-something</artifactId>
<version>${spring.version}</version>
<exclusions>
<exclusion>
<groupId>sample.spring</groupId> <!-- exclude spring-other from spring-something -->
<artifactId>spring-other</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>

Related

Error starting ApplicationContext: conflict with javax.persistence.Table

I am trying to run my project using spring-boot. It is possible to deploy the code as a jar and everything works fine. The tests do fail though.
I've been trying to use different version of my dependencies and did research on possible conflicts.
This is the extract of the POM.xml containing the dependencies:
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>4.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>5.0.1.RELEASE</version>
<scope>test</scope>
</dependency>
<!--
mockServletResponse.setContentType() needs
org/springframework/http/MediaType
which is in:
-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>5.0.1.RELEASE</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>javax.persistence-api</artifactId>
<version>2.2</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-c3p0</artifactId>
<version>5.4.15.Final</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.46</version>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.2.18</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.9.2</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.9.2</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.9.2</version>
</dependency>
</dependencies>
This is the error:
***************************
APPLICATION FAILED TO START
***************************
Description:
An attempt was made to call a method that does not exist. The attempt was made from the following location:
org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor$PersistenceElement.<init>(PersistenceAnnotationBeanPostProcessor.java:671)
The following method did not exist:
'javax.persistence.SynchronizationType javax.persistence.PersistenceContext.synchronization()'
The method's class, javax.persistence.PersistenceContext, is available from the following locations:
jar:file:/Users/elias/Documents/Uni/HTW/3.%20Semester/KBE/%c3%9cbung/htwb-kbe-repo-template-master/lib/javax.persistence.jar!/javax/persistence/PersistenceContext.class
jar:file:/Users/elias/.m2/repository/jakarta/persistence/jakarta.persistence-api/2.2.3/jakarta.persistence-api-2.2.3.jar!/javax/persistence/PersistenceContext.class
jar:file:/Users/elias/.m2/repository/javax/persistence/javax.persistence-api/2.2/javax.persistence-api-2.2.jar!/javax/persistence/PersistenceContext.class
It was loaded from the following location:
file:/Users/elias/Documents/Uni/HTW/3.%20Semester/KBE/%c3%9cbung/htwb-kbe-repo-template-master/lib/javax.persistence.jar
Action:
Correct the classpath of your application so that it contains a single, compatible version of javax.persistence.PersistenceContext
2021-01-23 10:46:32.515 ERROR 6964 --- [ main] o.s.test.context.TestContextManager : Caught exception while allowing TestExecutionListener [org.springframework.test.context.web.ServletTestExecutionListener#17d919b6] to prepare test instance [htw.kbe_beleg.controller.SongControllerTest#554188ac]
This is the output of mvn dependency:tree
[INFO] Scanning for projects...
[INFO]
[INFO] ---------------------< htwb.ai.KBE_Beleg:songsWS >----------------------
[INFO] Building A Songs Web Service 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:3.1.2:tree (default-cli) # songsWS ---
[INFO] htwb.ai.KBE_Beleg:songsWS:jar:0.0.1-SNAPSHOT
[INFO] +- org.springframework.boot:spring-boot-starter-web:jar:2.3.0.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter:jar:2.3.0.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot:jar:2.3.0.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot-autoconfigure:jar:2.3.0.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot-starter-logging:jar:2.3.0.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.2:compile
[INFO] | | | | \- org.apache.logging.log4j:log4j-api:jar:2.13.2: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.yaml:snakeyaml:jar:1.26:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-json:jar:2.3.0.RELEASE:compile
[INFO] | | +- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar:2.11.0:compile
[INFO] | | +- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.11.0:compile
[INFO] | | \- com.fasterxml.jackson.module:jackson-module-parameter-names:jar:2.11.0:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-tomcat:jar:2.3.0.RELEASE:compile
[INFO] | | +- org.glassfish:jakarta.el:jar:3.0.3:compile
[INFO] | | \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:9.0.35:compile
[INFO] | +- org.springframework:spring-web:jar:5.2.6.RELEASE:compile
[INFO] | | \- org.springframework:spring-beans:jar:5.2.6.RELEASE:compile
[INFO] | \- org.springframework:spring-webmvc:jar:5.2.6.RELEASE:compile
[INFO] | +- org.springframework:spring-aop:jar:5.2.6.RELEASE:compile
[INFO] | +- org.springframework:spring-context:jar:5.2.6.RELEASE:compile
[INFO] | \- org.springframework:spring-expression:jar:5.2.6.RELEASE:compile
[INFO] +- org.springframework.boot:spring-boot-starter-test:jar:2.3.0.RELEASE:test
[INFO] | +- org.springframework.boot:spring-boot-test:jar:2.3.0.RELEASE:test
[INFO] | +- org.springframework.boot:spring-boot-test-autoconfigure:jar:2.3.0.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] | | \- org.slf4j:slf4j-api:jar:1.7.30:compile
[INFO] | +- jakarta.xml.bind:jakarta.xml.bind-api:jar:2.3.3:compile
[INFO] | | \- jakarta.activation:jakarta.activation-api:jar:1.2.2:compile
[INFO] | +- org.assertj:assertj-core:jar:3.16.1:test
[INFO] | +- org.hamcrest:hamcrest:jar:2.2: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-core:jar:5.2.6.RELEASE:compile
[INFO] | | \- org.springframework:spring-jcl:jar:5.2.6.RELEASE:compile
[INFO] | +- org.springframework:spring-test:jar:5.2.6.RELEASE:test
[INFO] | \- org.xmlunit:xmlunit-core:jar:2.7.0:test
[INFO] +- org.springframework.boot:spring-boot-starter-data-jpa:jar:2.3.0.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-aop:jar:2.3.0.RELEASE:compile
[INFO] | | \- org.aspectj:aspectjweaver:jar:1.9.5:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-jdbc:jar:2.3.0.RELEASE:compile
[INFO] | | +- com.zaxxer:HikariCP:jar:3.4.5:compile
[INFO] | | \- org.springframework:spring-jdbc:jar:5.2.6.RELEASE:compile
[INFO] | +- jakarta.transaction:jakarta.transaction-api:jar:1.3.3:compile
[INFO] | +- jakarta.persistence:jakarta.persistence-api:jar:2.2.3:compile
[INFO] | +- org.hibernate:hibernate-core:jar:5.4.15.Final:compile
[INFO] | | +- org.javassist:javassist:jar:3.24.0-GA:compile
[INFO] | | +- antlr:antlr:jar:2.7.7:compile
[INFO] | | +- org.jboss:jandex:jar:2.1.3.Final:compile
[INFO] | | +- com.fasterxml:classmate:jar:1.5.1:compile
[INFO] | | +- org.dom4j:dom4j:jar:2.1.3:compile
[INFO] | | +- org.hibernate.common:hibernate-commons-annotations:jar:5.1.0.Final:compile
[INFO] | | \- org.glassfish.jaxb:jaxb-runtime:jar:2.3.3:compile
[INFO] | | +- org.glassfish.jaxb:txw2:jar:2.3.3:compile
[INFO] | | +- com.sun.istack:istack-commons-runtime:jar:3.0.11:compile
[INFO] | | \- com.sun.activation:jakarta.activation:jar:1.2.2:runtime
[INFO] | +- org.springframework.data:spring-data-jpa:jar:2.3.0.RELEASE:compile
[INFO] | | +- org.springframework.data:spring-data-commons:jar:2.3.0.RELEASE:compile
[INFO] | | +- org.springframework:spring-orm:jar:5.2.6.RELEASE:compile
[INFO] | | \- org.springframework:spring-tx:jar:5.2.6.RELEASE:compile
[INFO] | \- org.springframework:spring-aspects:jar:5.2.6.RELEASE:compile
[INFO] +- org.junit.jupiter:junit-jupiter-api:jar:5.6.2:test
[INFO] | +- org.apiguardian:apiguardian-api:jar:1.1.0: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-engine:jar:5.6.2:test
[INFO] | \- org.junit.platform:junit-platform-engine:jar:1.6.2:test
[INFO] +- javax.persistence:javax.persistence-api:jar:2.2:compile
[INFO] +- org.hibernate:hibernate-c3p0:jar:5.4.15.Final:compile
[INFO] | +- org.jboss.logging:jboss-logging:jar:3.4.1.Final:compile
[INFO] | \- com.mchange:c3p0:jar:0.9.5.3:compile
[INFO] | \- com.mchange:mchange-commons-java:jar:0.2.15:compile
[INFO] +- org.postgresql:postgresql:jar:42.2.18:compile
[INFO] | \- org.checkerframework:checker-qual:jar:3.5.0:runtime
[INFO] +- com.fasterxml.jackson.core:jackson-annotations:jar:2.9.2:compile
[INFO] +- javax.servlet:javax.servlet-api:jar:4.0.1:provided
[INFO] +- commons-io:commons-io:jar:2.6:compile
[INFO] +- com.fasterxml.jackson.core:jackson-core:jar:2.10.2:compile
[INFO] +- com.fasterxml.jackson.core:jackson-databind:jar:2.10.2:compile
[INFO] +- com.fasterxml.jackson.dataformat:jackson-dataformat-xml:jar:2.11.3:compile
[INFO] | +- com.fasterxml.jackson.module:jackson-module-jaxb-annotations:jar:2.11.0:compile
[INFO] | +- org.codehaus.woodstox:stax2-api:jar:4.2.1:compile
[INFO] | \- com.fasterxml.woodstox:woodstox-core:jar:6.2.1:compile
[INFO] +- com.auth0:java-jwt:jar:3.12.0:compile
[INFO] | \- commons-codec:commons-codec:jar:1.14:runtime
[INFO] +- io.github.cdimascio:dotenv-java:jar:2.2.0:compile
[INFO] +- org.junit.jupiter:junit-jupiter:jar:5.7.0:test
[INFO] | \- org.junit.jupiter:junit-jupiter-params:jar:5.6.2:test
[INFO] +- org.apache.tomcat.embed:tomcat-embed-core:jar:9.0.39:compile
[INFO] | \- org.apache.tomcat:tomcat-annotations-api:jar:9.0.35:compile
[INFO] +- org.hsqldb:hsqldb:jar:2.5.1:test
[INFO] \- org.mockito:mockito-core:jar:3.5.13:test
[INFO] +- net.bytebuddy:byte-buddy:jar:1.10.10:compile
[INFO] +- net.bytebuddy:byte-buddy-agent:jar:1.10.10:test
[INFO] \- org.objenesis:objenesis:jar:3.1:test
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.277 s
[INFO] Finished at: 2021-01-23T11:19:23+01:00
[INFO] ------------------------------------------------------------------------
I know similar questions have been asked before, but I could't fix my errors using them.

Found multiple occurrences of org.json.JSONObject on the class path: [duplicate]

This question already has answers here:
Maven + Spring Boot: Found multiple occurrences of org.json.JSONObject on the class path:
(6 answers)
Closed 2 years ago.
I have a basic SpringBoot 2.1.5.RELEASE app. Using Spring Initializer, JPA, embedded Tomcat, Thymeleaf template engine, and package as an executable JAR. When I init the app I see this message:
Found multiple occurrences of org.json.JSONObject on the class path:
jar:file:/Users/nunito/.m2/repository/com/vaadin/external/google/android-json/0.0.20131108.vaadin1/android-json-0.0.20131108.vaadin1.jar!/org/json/JSONObject.class
jar:file:/Users/nunito/.m2/repository/org/json/json/20160810/json-20160810.jar!/org/json/JSONObject.class
I have delete all the repositoy folders and start from scracth, but I still have the problem and I can't figure out when it comes from looking at my pom.xml:
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</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-jdbc</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.googlecode.libphonenumber</groupId>
<artifactId>libphonenumber</artifactId>
<version>8.9.0</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<!-- Spring Security -->
<!-- https://mvnrepository.com/artifact/org.springframework.security/spring-security-test -->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<!-- <version>4.5.4</version> -->
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
<version>0.9.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.ws.rs/javax.ws.rs-api -->
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<version>2.1.1</version>
</dependency>
<!-- Firebase dependencies -->
<dependency>
<groupId>com.google.firebase</groupId>
<artifactId>firebase-admin</artifactId>
<version>5.4.0</version>
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-firestore</artifactId>
<version>0.26.0-beta</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.google.guava/guava -->
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>23.0</version>
</dependency>
</dependencies>
and
[INFO]
[INFO] --- maven-dependency-plugin:3.1.1:tree (default-cli) # bonanssa-api ---
[INFO] io.bonanssa:bonanssa-api:jar:0.0.1-SNAPSHOT
[INFO] +- org.springframework.boot:spring-boot-starter:jar:2.1.5.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot:jar:2.1.5.RELEASE:compile
[INFO] | | \- org.springframework:spring-context:jar:5.1.7.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-autoconfigure:jar:2.1.5.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-logging:jar:2.1.5.RELEASE:compile
[INFO] | | +- org.apache.logging.log4j:log4j-to-slf4j:jar:2.11.2:compile
[INFO] | | | \- org.apache.logging.log4j:log4j-api:jar:2.11.2:compile
[INFO] | | \- org.slf4j:jul-to-slf4j:jar:1.7.26:compile
[INFO] | +- javax.annotation:javax.annotation-api:jar:1.3.2:compile
[INFO] | +- org.springframework:spring-core:jar:5.1.7.RELEASE:compile
[INFO] | | \- org.springframework:spring-jcl:jar:5.1.7.RELEASE:compile
[INFO] | \- org.yaml:snakeyaml:jar:1.23:runtime
[INFO] +- org.springframework.boot:spring-boot-starter-web:jar:2.1.5.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-json:jar:2.1.5.RELEASE:compile
[INFO] | | +- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar:2.9.8:compile
[INFO] | | +- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.9.8:compile
[INFO] | | \- com.fasterxml.jackson.module:jackson-module-parameter-names:jar:2.9.8:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-tomcat:jar:2.1.5.RELEASE:compile
[INFO] | | +- org.apache.tomcat.embed:tomcat-embed-core:jar:9.0.19:compile
[INFO] | | +- org.apache.tomcat.embed:tomcat-embed-el:jar:9.0.19:compile
[INFO] | | \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:9.0.19:compile
[INFO] | +- org.hibernate.validator:hibernate-validator:jar:6.0.16.Final:compile
[INFO] | | +- javax.validation:validation-api:jar:2.0.1.Final:compile
[INFO] | | +- org.jboss.logging:jboss-logging:jar:3.3.2.Final:compile
[INFO] | | \- com.fasterxml:classmate:jar:1.4.0:compile
[INFO] | +- org.springframework:spring-web:jar:5.1.7.RELEASE:compile
[INFO] | | \- org.springframework:spring-beans:jar:5.1.7.RELEASE:compile
[INFO] | \- org.springframework:spring-webmvc:jar:5.1.7.RELEASE:compile
[INFO] | \- org.springframework:spring-expression:jar:5.1.7.RELEASE:compile
[INFO] +- org.springframework.boot:spring-boot-starter-actuator:jar:2.1.5.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-actuator-autoconfigure:jar:2.1.5.RELEASE:compile
[INFO] | | \- org.springframework.boot:spring-boot-actuator:jar:2.1.5.RELEASE:compile
[INFO] | \- io.micrometer:micrometer-core:jar:1.1.4:compile
[INFO] | +- org.hdrhistogram:HdrHistogram:jar:2.1.9:compile
[INFO] | \- org.latencyutils:LatencyUtils:jar:2.0.3:compile
[INFO] +- org.springframework.boot:spring-boot-devtools:jar:2.1.5.RELEASE:compile
[INFO] +- org.springframework.boot:spring-boot-starter-test:jar:2.1.5.RELEASE:test
[INFO] | +- org.springframework.boot:spring-boot-test:jar:2.1.5.RELEASE:test
[INFO] | +- org.springframework.boot:spring-boot-test-autoconfigure:jar:2.1.5.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] | +- junit:junit:jar:4.12:test
[INFO] | +- org.assertj:assertj-core:jar:3.11.1:test
[INFO] | +- org.mockito:mockito-core:jar:2.23.4:test
[INFO] | | +- net.bytebuddy:byte-buddy:jar:1.9.12:compile
[INFO] | | +- net.bytebuddy:byte-buddy-agent:jar:1.9.12:test
[INFO] | | \- org.objenesis:objenesis:jar:2.6:test
[INFO] | +- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] | +- org.hamcrest:hamcrest-library:jar:1.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.1.7.RELEASE:test
[INFO] | \- org.xmlunit:xmlunit-core:jar:2.6.2:test
[INFO] +- org.springframework.boot:spring-boot-starter-jdbc:jar:2.1.5.RELEASE:compile
[INFO] | +- com.zaxxer:HikariCP:jar:3.2.0:compile
[INFO] | \- org.springframework:spring-jdbc:jar:5.1.7.RELEASE:compile
[INFO] | \- org.springframework:spring-tx:jar:5.1.7.RELEASE:compile
[INFO] +- org.springframework.boot:spring-boot-starter-mail:jar:2.1.5.RELEASE:compile
[INFO] | +- org.springframework:spring-context-support:jar:5.1.7.RELEASE:compile
[INFO] | \- com.sun.mail:javax.mail:jar:1.6.2:compile
[INFO] | \- javax.activation:activation:jar:1.1:compile
[INFO] +- org.springframework.boot:spring-boot-starter-data-jpa:jar:2.1.5.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-aop:jar:2.1.5.RELEASE:compile
[INFO] | | \- org.aspectj:aspectjweaver:jar:1.9.4:compile
[INFO] | +- javax.transaction:javax.transaction-api:jar:1.3:compile
[INFO] | +- javax.xml.bind:jaxb-api:jar:2.3.1:compile
[INFO] | | \- javax.activation:javax.activation-api:jar:1.2.0:compile
[INFO] | +- org.hibernate:hibernate-core:jar:5.3.10.Final:compile
[INFO] | | +- javax.persistence:javax.persistence-api:jar:2.2:compile
[INFO] | | +- org.javassist:javassist:jar:3.23.2-GA:compile
[INFO] | | +- antlr:antlr:jar:2.7.7:compile
[INFO] | | +- org.jboss:jandex:jar:2.0.5.Final:compile
[INFO] | | +- org.dom4j:dom4j:jar:2.1.1:compile
[INFO] | | \- org.hibernate.common:hibernate-commons-annotations:jar:5.0.4.Final:compile
[INFO] | +- org.springframework.data:spring-data-jpa:jar:2.1.8.RELEASE:compile
[INFO] | | +- org.springframework.data:spring-data-commons:jar:2.1.8.RELEASE:compile
[INFO] | | \- org.springframework:spring-orm:jar:5.1.7.RELEASE:compile
[INFO] | \- org.springframework:spring-aspects:jar:5.1.7.RELEASE:compile
[INFO] +- org.springframework.boot:spring-boot-starter-security:jar:2.1.5.RELEASE:compile
[INFO] | +- org.springframework:spring-aop:jar:5.1.7.RELEASE:compile
[INFO] | +- org.springframework.security:spring-security-config:jar:5.1.5.RELEASE:compile
[INFO] | \- org.springframework.security:spring-security-web:jar:5.1.5.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.slf4j:slf4j-api:jar:1.7.26:compile
[INFO] +- com.h2database:h2:jar:1.4.199:compile
[INFO] +- mysql:mysql-connector-java:jar:8.0.16:runtime
[INFO] +- com.googlecode.libphonenumber:libphonenumber:jar:8.9.0:compile
[INFO] +- com.fasterxml.jackson.core:jackson-annotations:jar:2.9.0:compile
[INFO] +- com.fasterxml.jackson.core:jackson-databind:jar:2.9.8:compile
[INFO] | \- com.fasterxml.jackson.core:jackson-core:jar:2.9.8:compile
[INFO] +- org.springframework.security:spring-security-test:jar:5.1.5.RELEASE:test
[INFO] | \- org.springframework.security:spring-security-core:jar:5.1.5.RELEASE:compile
[INFO] +- org.apache.httpcomponents:httpclient:jar:4.5.8:compile
[INFO] | +- org.apache.httpcomponents:httpcore:jar:4.4.11:compile
[INFO] | \- commons-codec:commons-codec:jar:1.11:compile
[INFO] +- io.jsonwebtoken:jjwt:jar:0.9.1:compile
[INFO] +- javax.ws.rs:javax.ws.rs-api:jar:2.1.1:compile
[INFO] +- com.google.firebase:firebase-admin:jar:5.4.0:compile
[INFO] | +- com.google.api-client:google-api-client:jar:1.22.0:compile
[INFO] | | +- com.google.oauth-client:google-oauth-client:jar:1.22.0:compile
[INFO] | | \- com.google.http-client:google-http-client-jackson2:jar:1.22.0:compile
[INFO] | +- com.google.api-client:google-api-client-gson:jar:1.22.0:compile
[INFO] | | \- com.google.http-client:google-http-client-gson:jar:1.22.0:compile
[INFO] | | \- com.google.code.gson:gson:jar:2.8.5:compile
[INFO] | +- com.google.http-client:google-http-client:jar:1.22.0:compile
[INFO] | +- com.google.api:api-common:jar:1.1.0:compile
[INFO] | +- com.google.auth:google-auth-library-oauth2-http:jar:0.8.0:compile
[INFO] | | \- com.google.auth:google-auth-library-credentials:jar:0.8.0:compile
[INFO] | +- com.google.cloud:google-cloud-storage:jar:1.2.1:compile
[INFO] | | \- com.google.apis:google-api-services-storage:jar:v1-rev100-1.22.0:compile
[INFO] | \- org.json:json:jar:20160810:compile
[INFO] +- com.google.cloud:google-cloud-firestore:jar:0.26.0-beta:compile
[INFO] | +- io.netty:netty-tcnative-boringssl-static:jar:2.0.25.Final:compile
[INFO] | +- com.google.cloud:google-cloud-core:jar:1.8.0:compile
[INFO] | | +- joda-time:joda-time:jar:2.10.2:compile
[INFO] | | +- com.google.api:gax:jar:1.9.0:compile
[INFO] | | +- com.google.protobuf:protobuf-java-util:jar:3.3.1:compile
[INFO] | | +- com.google.api.grpc:proto-google-common-protos:jar:0.1.21:compile
[INFO] | | \- com.google.api.grpc:proto-google-iam-v1:jar:0.1.21:compile
[INFO] | +- com.google.cloud:google-cloud-core-grpc:jar:1.8.0:compile
[INFO] | | +- com.google.protobuf:protobuf-java:jar:3.3.1:compile
[INFO] | | +- io.grpc:grpc-protobuf:jar:1.6.1:compile
[INFO] | | | \- io.grpc:grpc-protobuf-lite:jar:1.6.1:compile
[INFO] | | \- io.grpc:grpc-context:jar:1.6.1:compile
[INFO] | +- com.google.api:gax-grpc:jar:0.26.0:compile
[INFO] | | +- com.google.auto.value:auto-value:jar:1.2:compile
[INFO] | | \- org.threeten:threetenbp:jar:1.3.3:compile
[INFO] | +- com.google.cloud:google-cloud-core-http:jar:1.8.0:compile
[INFO] | | +- com.google.http-client:google-http-client-appengine:jar:1.22.0:compile
[INFO] | | \- com.google.http-client:google-http-client-jackson:jar:1.22.0:compile
[INFO] | | \- org.codehaus.jackson:jackson-core-asl:jar:1.9.11:compile
[INFO] | +- com.google.api.grpc:proto-google-cloud-firestore-v1beta1:jar:0.1.21:compile
[INFO] | +- io.grpc:grpc-netty:jar:1.6.1:compile
[INFO] | | +- io.grpc:grpc-core:jar:1.6.1:compile (version selected from constraint [1.6.1,1.6.1])
[INFO] | | | +- com.google.instrumentation:instrumentation-api:jar:0.4.3:compile
[INFO] | | | \- io.opencensus:opencensus-api:jar:0.5.1:compile
[INFO] | | +- io.netty:netty-codec-http2:jar:4.1.36.Final:compile
[INFO] | | | +- io.netty:netty-common:jar:4.1.36.Final:compile
[INFO] | | | +- io.netty:netty-buffer:jar:4.1.36.Final:compile
[INFO] | | | +- io.netty:netty-transport:jar:4.1.36.Final:compile
[INFO] | | | | \- io.netty:netty-resolver:jar:4.1.36.Final:compile
[INFO] | | | +- io.netty:netty-codec:jar:4.1.36.Final:compile
[INFO] | | | +- io.netty:netty-handler:jar:4.1.36.Final:compile
[INFO] | | | \- io.netty:netty-codec-http:jar:4.1.36.Final:compile
[INFO] | | \- io.netty:netty-handler-proxy:jar:4.1.36.Final:compile
[INFO] | | \- io.netty:netty-codec-socks:jar:4.1.36.Final:compile
[INFO] | +- io.grpc:grpc-stub:jar:1.6.1:compile
[INFO] | \- io.grpc:grpc-auth:jar:1.6.1:compile
[INFO] \- com.google.guava:guava:jar:23.0:compile
[INFO] +- com.google.code.findbugs:jsr305:jar:1.3.9:compile
[INFO] +- com.google.errorprone:error_prone_annotations:jar:2.0.18:compile
[INFO] +- com.google.j2objc:j2objc-annotations:jar:1.1:compile
[INFO] \- org.codehaus.mojo:animal-sniffer-annotations:jar:1.14:compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.650 s
[INFO] Finished at: 2019-06-12T14:16:18+02:00
[INFO] ------------------------------------------------------------------------
This is because of jar conflicts. It happens because of maven transitive dependencies.
Based on the dependency tree that you have posted here, below two jars are conflicting each other over JSONObject.class.
1) android-json.jar (com.vaadin.external.google:android-json:jar:0.0.20131108.vaadin1:test)
2) json.jar (org.json:json:jar:20160810:compile)
You can exclude one of these jars based on your requirement.
example:
<exclusions>
<exclusion>
<groupId>com.vaadin.external.google</groupId>
<artifactId>android-json</artifactId>
</exclusion>
</exclusions>

Solr ClassCastException with custom TokenFilterFactory

I've got the problem with core creation with Solr 6.3.0
I've got class extending lucene's TokenFilterFactory
public class CustomTokenFactory extends TokenFilterFactory
In solr core solrconfig.xml
<lib dir="${solr.install.dir:../../../..}/target/" regex="myjar-1.0.0.jar" />
When I'm trying to start solr - the ClassCastException occurs
Caused by: org.apache.solr.common.SolrException: Plugin init failure for [schema.xml] fieldType "MyAnalyser": Plugin init failure for [schema.xml] analyzer/tokenizer: class com.myjar.CustomTokenFactory
at org.apache.solr.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.java:182)
at org.apache.solr.schema.IndexSchema.readSchema(IndexSchema.java:491)
... 14 more
Caused by: org.apache.solr.common.SolrException: Plugin init failure for [schema.xml] analyzer/tokenizer: class com.myjar.CustomTokenFactory
at org.apache.solr.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.java:182)
at org.apache.solr.schema.FieldTypePluginLoader.readAnalyzer(FieldTypePluginLoader.java:361)
at org.apache.solr.schema.FieldTypePluginLoader.create(FieldTypePluginLoader.java:104)
at org.apache.solr.schema.FieldTypePluginLoader.create(FieldTypePluginLoader.java:53)
at org.apache.solr.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.java:152)
... 15 more
Caused by: java.lang.ClassCastException: class com.myjar.CustomTokenFactory
at java.lang.Class.asSubclass(Class.java:3404)
at org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:540)
at org.apache.solr.core.SolrResourceLoader.newInstance(SolrResourceLoader.java:625)
at org.apache.solr.schema.FieldTypePluginLoader$2.create(FieldTypePluginLoader.java:341)
at org.apache.solr.schema.FieldTypePluginLoader$2.create(FieldTypePluginLoader.java:334)
at org.apache.solr.util.plugin.AbstractPluginLoader.load(AbstractPluginLoader.java:152)
... 19 more
My pom contains following solr\lucene libs
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/net.sf.jwordnet/jwnl -->
<dependency>
<groupId>net.sf.jwordnet</groupId>
<artifactId>jwnl</artifactId>
<version>1.4_rc3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-api -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.21</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.opennlp/opennlp-tools -->
<dependency>
<groupId>org.apache.opennlp</groupId>
<artifactId>opennlp-tools</artifactId>
<version>1.5.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-simple -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.21</version>
</dependency>
<!-- for wikipedia cleanup -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.5</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.opennlp/opennlp-maxent -->
<dependency>
<groupId>org.apache.opennlp</groupId>
<artifactId>opennlp-maxent</artifactId>
<version>3.0.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.opennlp/opennlp-uima -->
<dependency>
<groupId>org.apache.opennlp</groupId>
<artifactId>opennlp-uima</artifactId>
<version>1.6.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.solr/solr-analysis-extras -->
<dependency>
<groupId>org.apache.solr</groupId>
<artifactId>solr-analysis-extras</artifactId>
<version>6.3.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.solr</groupId>
<artifactId>solr-solrj</artifactId>
<version>6.3.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.hadoop/hadoop-hdfs -->
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-hdfs</artifactId>
<version>2.7.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.lucene/lucene-benchmark -->
<!-- for indexing wikipedia -->
<!-- https://mvnrepository.com/artifact/org.apache.lucene/lucene-benchmark -->
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-benchmark</artifactId>
<version>6.3.0</version>
</dependency>
<dependency>
<groupId>org.apache.solr</groupId>
<artifactId>solr-core</artifactId>
<version>6.3.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>edu.stanford.nlp</groupId>
<artifactId>stanford-corenlp</artifactId>
<version>3.9.2</version>
<exclusions>
<exclusion>
<groupId>org.apache.lucene</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
What can be cause of such error in solr? My first idea was lib versions mismatch - but everywhere is *-6.3.0.jar
Dependency tree is like this:
+- junit:junit:jar:3.8.1:test
[INFO] +- net.sf.jwordnet:jwnl:jar:1.4_rc3:compile
[INFO] | \- commons-logging:commons-logging:jar:1.1.1:compile
[INFO] +- org.slf4j:slf4j-api:jar:1.7.21:compile
[INFO] +- org.apache.opennlp:opennlp-tools:jar:1.5.3:compile
[INFO] +- org.slf4j:slf4j-simple:jar:1.7.21:compile
[INFO] +- org.apache.commons:commons-lang3:jar:3.5:compile
[INFO] +- org.apache.opennlp:opennlp-maxent:jar:3.0.3:compile
[INFO] +- org.apache.opennlp:opennlp-uima:jar:1.6.0:compile
[INFO] +- org.apache.solr:solr-analysis-extras:jar:6.3.0:provided
[INFO] | +- org.apache.lucene:lucene-analyzers-common:jar:6.3.0:compile
[INFO] | +- org.apache.lucene:lucene-analyzers-icu:jar:6.3.0:provided
[INFO] | +- org.apache.lucene:lucene-analyzers-kuromoji:jar:6.3.0:provided
[INFO] | +- org.apache.lucene:lucene-analyzers-morfologik:jar:6.3.0:provided
[INFO] | +- org.apache.lucene:lucene-analyzers-phonetic:jar:6.3.0:provided
[INFO] | +- org.apache.lucene:lucene-analyzers-smartcn:jar:6.3.0:provided
[INFO] | +- org.apache.lucene:lucene-analyzers-stempel:jar:6.3.0:provided
[INFO] | +- org.apache.lucene:lucene-backward-codecs:jar:6.3.0:provided
[INFO] | +- org.apache.lucene:lucene-classification:jar:6.3.0:provided
[INFO] | +- org.apache.lucene:lucene-codecs:jar:6.3.0:compile
[INFO] | +- org.apache.lucene:lucene-core:jar:6.3.0:compile
[INFO] | +- org.apache.lucene:lucene-expressions:jar:6.3.0:provided
[INFO] | +- org.apache.lucene:lucene-grouping:jar:6.3.0:provided
[INFO] | +- org.apache.lucene:lucene-highlighter:jar:6.3.0:compile
[INFO] | +- org.apache.lucene:lucene-join:jar:6.3.0:compile
[INFO] | +- org.apache.lucene:lucene-memory:jar:6.3.0:compile
[INFO] | +- org.apache.lucene:lucene-misc:jar:6.3.0:provided
[INFO] | +- org.apache.lucene:lucene-queries:jar:6.3.0:compile
[INFO] | +- org.apache.lucene:lucene-queryparser:jar:6.3.0:compile
[INFO] | +- org.apache.lucene:lucene-sandbox:jar:6.3.0:provided
[INFO] | +- org.apache.lucene:lucene-spatial-extras:jar:6.3.0:compile
[INFO] | +- org.apache.lucene:lucene-suggest:jar:6.3.0:provided
[INFO] | +- com.carrotsearch:hppc:jar:0.7.1:provided
[INFO] | +- com.facebook.presto:presto-parser:jar:0.122:provided
[INFO] | +- com.fasterxml.jackson.core:jackson-core:jar:2.5.4:provided
[INFO] | +- com.fasterxml.jackson.dataformat:jackson-dataformat-smile:jar:2.5.4:provided
[INFO] | +- com.github.ben-manes.caffeine:caffeine:jar:1.0.1:provided
[INFO] | +- com.google.guava:guava:jar:14.0.1:compile
[INFO] | +- com.google.protobuf:protobuf-java:jar:2.5.0:compile
[INFO] | +- com.ibm.icu:icu4j:jar:56.1:compile
[INFO] | +- com.tdunning:t-digest:jar:3.1:provided
[INFO] | +- commons-cli:commons-cli:jar:1.2:compile
[INFO] | +- commons-codec:commons-codec:jar:1.10:compile
[INFO] | +- commons-collections:commons-collections:jar:3.2.2:provided
[INFO] | +- commons-configuration:commons-configuration:jar:1.6:provided
[INFO] | +- commons-fileupload:commons-fileupload:jar:1.3.1:provided
[INFO] | +- commons-io:commons-io:jar:2.5:compile
[INFO] | +- commons-lang:commons-lang:jar:2.6:compile
[INFO] | +- dom4j:dom4j:jar:1.6.1:provided
[INFO] | +- io.airlift:slice:jar:0.10:provided
[INFO] | +- javax.servlet:javax.servlet-api:jar:3.1.0:compile
[INFO] | +- joda-time:joda-time:jar:2.2:compile
[INFO] | +- log4j:log4j:jar:1.2.17:compile
[INFO] | +- org.antlr:antlr4-runtime:jar:4.5.1-1:provided
[INFO] | +- org.apache.commons:commons-exec:jar:1.3:provided
[INFO] | +- org.apache.curator:curator-client:jar:2.8.0:provided
[INFO] | +- org.apache.curator:curator-framework:jar:2.8.0:provided
[INFO] | +- org.apache.curator:curator-recipes:jar:2.8.0:provided
[INFO] | +- org.apache.hadoop:hadoop-annotations:jar:2.7.2:provided
[INFO] | | \- jdk.tools:jdk.tools:jar:1.8:system
[INFO] | +- org.apache.hadoop:hadoop-auth:jar:2.7.2:provided
[INFO] | +- org.apache.hadoop:hadoop-common:jar:2.7.2:provided
[INFO] | +- org.apache.htrace:htrace-core:jar:3.2.0-incubating:compile
[INFO] | +- org.apache.httpcomponents:httpclient:jar:4.4.1:compile
[INFO] | +- org.apache.httpcomponents:httpcore:jar:4.4.1:compile
[INFO] | +- org.apache.httpcomponents:httpmime:jar:4.4.1:compile
[INFO] | +- org.apache.zookeeper:zookeeper:jar:3.4.6:compile
[INFO] | +- org.carrot2:morfologik-fsa:jar:2.1.1:provided
[INFO] | +- org.carrot2:morfologik-polish:jar:2.1.1:provided
[INFO] | +- org.carrot2:morfologik-stemming:jar:2.1.1:provided
[INFO] | +- org.codehaus.jackson:jackson-core-asl:jar:1.9.13:compile
[INFO] | +- org.codehaus.jackson:jackson-mapper-asl:jar:1.9.13:compile
[INFO] | +- org.codehaus.woodstox:stax2-api:jar:3.1.4:compile
[INFO] | +- org.codehaus.woodstox:woodstox-core-asl:jar:4.4.1:compile
[INFO] | +- org.eclipse.jetty:jetty-continuation:jar:9.3.8.v20160314:provided
[INFO] | +- org.eclipse.jetty:jetty-deploy:jar:9.3.8.v20160314:provided
[INFO] | +- org.eclipse.jetty:jetty-http:jar:9.3.8.v20160314:provided
[INFO] | +- org.eclipse.jetty:jetty-io:jar:9.3.8.v20160314:provided
[INFO] | +- org.eclipse.jetty:jetty-jmx:jar:9.3.8.v20160314:provided
[INFO] | +- org.eclipse.jetty:jetty-rewrite:jar:9.3.8.v20160314:provided
[INFO] | +- org.eclipse.jetty:jetty-security:jar:9.3.8.v20160314:provided
[INFO] | +- org.eclipse.jetty:jetty-server:jar:9.3.8.v20160314:provided
[INFO] | +- org.eclipse.jetty:jetty-servlet:jar:9.3.8.v20160314:provided
[INFO] | +- org.eclipse.jetty:jetty-servlets:jar:9.3.8.v20160314:provided
[INFO] | +- org.eclipse.jetty:jetty-util:jar:9.3.8.v20160314:provided
[INFO] | +- org.eclipse.jetty:jetty-webapp:jar:9.3.8.v20160314:provided
[INFO] | +- org.eclipse.jetty:jetty-xml:jar:9.3.8.v20160314:provided
[INFO] | +- org.locationtech.spatial4j:spatial4j:jar:0.6:compile
[INFO] | +- org.noggit:noggit:jar:0.6:compile
[INFO] | +- org.ow2.asm:asm:jar:5.1:provided
[INFO] | +- org.ow2.asm:asm-commons:jar:5.1:provided
[INFO] | +- org.restlet.jee:org.restlet:jar:2.3.0:provided
[INFO] | +- org.restlet.jee:org.restlet.ext.servlet:jar:2.3.0:provided
[INFO] | \- org.slf4j:jcl-over-slf4j:jar:1.7.7:compile
[INFO] +- org.apache.solr:solr-solrj:jar:6.3.0:compile
[INFO] +- org.apache.hadoop:hadoop-hdfs:jar:2.7.1:compile
[INFO] | +- org.mortbay.jetty:jetty:jar:6.1.26:compile
[INFO] | +- org.mortbay.jetty:jetty-util:jar:6.1.26:compile
[INFO] | +- com.sun.jersey:jersey-core:jar:1.9:compile
[INFO] | +- com.sun.jersey:jersey-server:jar:1.9:compile
[INFO] | | \- asm:asm:jar:3.1:compile
[INFO] | +- commons-daemon:commons-daemon:jar:1.0.13:compile
[INFO] | +- javax.servlet:servlet-api:jar:2.5:compile
[INFO] | +- xmlenc:xmlenc:jar:0.52:compile
[INFO] | +- io.netty:netty-all:jar:4.0.23.Final:compile
[INFO] | +- xerces:xercesImpl:jar:2.9.1:compile
[INFO] | | \- xml-apis:xml-apis:jar:1.3.04:compile
[INFO] | \- org.fusesource.leveldbjni:leveldbjni-all:jar:1.8:compile
[INFO] +- org.apache.lucene:lucene-benchmark:jar:6.3.0:compile
[INFO] | +- org.apache.lucene:lucene-facet:jar:6.3.0:compile
[INFO] | +- net.sourceforge.nekohtml:nekohtml:jar:1.9.17:compile
[INFO] | \- org.apache.commons:commons-compress:jar:1.11:compile
[INFO] +- org.apache.solr:solr-core:jar:6.3.0:provided
[INFO] \- edu.stanford.nlp:stanford-corenlp:jar:3.9.2:compile
[INFO] +- com.apple:AppleJavaExtensions:jar:1.4:compile
[INFO] +- de.jollyday:jollyday:jar:0.4.9:compile
[INFO] +- com.io7m.xom:xom:jar:1.2.10:compile
[INFO] | \- xalan:xalan:jar:2.7.0:compile
[INFO] +- com.googlecode.efficient-java-matrix-library:ejml:jar:0.23:compile
[INFO] +- org.glassfish:javax.json:jar:1.0.4:compile
[INFO] +- javax.activation:javax.activation-api:jar:1.2.0:compile
[INFO] +- javax.xml.bind:jaxb-api:jar:2.4.0-b180830.0359:compile
[INFO] +- com.sun.xml.bind:jaxb-core:jar:2.3.0.1:compile
[INFO] \- com.sun.xml.bind:jaxb-impl:jar:2.4.0-b180830.0438:compile
Any suggestions?
Thanks!
I found the problem.
It's not related to class loading, but to schema.xml.
I defined my CustomTokenFactory in <tokenizer> tag instead of <filter> tag. And solr was trying to do asSubclass to TokenizerFactory.
The remote debugging helps a lot in this case.

spring-boot fails on multi-module app

I tried to create spring-boot application with multiple modules with structure as follows:
omnibus/
/domain
/persistence
/service
/web
In main pom I set spring-boot-starter-parent:
<?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>
<groupId>omnibus</groupId>
<artifactId>omnibus</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.2.5.RELEASE</version>
</parent>
<modules>
<module>persistence</module>
<module>domain</module>
<module>service</module>
<module>web</module>
</modules>
<properties>
<java.version>1.8</java.version>
<start-class>pl.omnibus.Application</start-class>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<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>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
In web module I included class:
package pl.omnibus;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
#SpringBootApplication
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
pom.xml of web module is as follows:
<?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>omnibus</artifactId>
<groupId>omnibus</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>web</artifactId>
<dependencies>
<dependency>
<groupId>omnibus</groupId>
<artifactId>service</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>
Now when I try to execute:
mvn package
on the project if fails on tests of persistence module because it doesn't see dependency for domain although it is declared in persistence pom.xml:
<dependencies>
<dependency>
<groupId>omnibus</groupId>
<artifactId>domain</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
(...)
</dependencies>
What's strange those commands pass with success:
mvn test
mvn package -DskipTests
But even in case of the latter I cannot run web.jar because
java -jar web-1.0-SNAPSHOT.jar
fails on java.lang.NoClassDefFoundError for class from domain module.
I would appreciate any help as I'm new to spring-boot and cannot find solution for creating spring-boot app with multiple modules.
EDIT:
I'm adding output of
mvn dependency:tree
for #chrylis
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] omnibus
[INFO] domain
[INFO] persistence
[INFO] service
[INFO] web
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building omnibus 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.9:tree (default-cli) # omnibus ---
[INFO] omnibus:omnibus:pom:1.0-SNAPSHOT
[INFO] +- org.springframework.boot:spring-boot-starter-tomcat:jar:1.2.5.RELEASE:compile
[INFO] | +- org.apache.tomcat.embed:tomcat-embed-core:jar:8.0.23:compile
[INFO] | +- org.apache.tomcat.embed:tomcat-embed-el:jar:8.0.23:compile
[INFO] | +- org.apache.tomcat.embed:tomcat-embed-logging-juli:jar:8.0.23:compile
[INFO] | \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:8.0.23:compile
[INFO] \- org.springframework.boot:spring-boot-starter-test:jar:1.2.5.RELEASE:test
[INFO] +- junit:junit:jar:4.12:test
[INFO] +- org.mockito:mockito-core:jar:1.10.19:test
[INFO] | \- org.objenesis:objenesis:jar:2.1:test
[INFO] +- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] +- org.hamcrest:hamcrest-library:jar:1.3:test
[INFO] +- org.springframework:spring-core:jar:4.1.7.RELEASE:test
[INFO] \- org.springframework:spring-test:jar:4.1.7.RELEASE:test
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building domain 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.9:tree (default-cli) # domain ---
[INFO] omnibus:domain:jar:1.0-SNAPSHOT
[INFO] +- javax.persistence:persistence-api:jar:1.0.2:compile
[INFO] +- org.springframework.boot:spring-boot-starter-tomcat:jar:1.2.5.RELEASE:compile
[INFO] | +- org.apache.tomcat.embed:tomcat-embed-core:jar:8.0.23:compile
[INFO] | +- org.apache.tomcat.embed:tomcat-embed-el:jar:8.0.23:compile
[INFO] | +- org.apache.tomcat.embed:tomcat-embed-logging-juli:jar:8.0.23:compile
[INFO] | \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:8.0.23:compile
[INFO] \- org.springframework.boot:spring-boot-starter-test:jar:1.2.5.RELEASE:test
[INFO] +- junit:junit:jar:4.12:test
[INFO] +- org.mockito:mockito-core:jar:1.10.19:test
[INFO] | \- org.objenesis:objenesis:jar:2.1:test
[INFO] +- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] +- org.hamcrest:hamcrest-library:jar:1.3:test
[INFO] +- org.springframework:spring-core:jar:4.1.7.RELEASE:test
[INFO] \- org.springframework:spring-test:jar:4.1.7.RELEASE:test
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building persistence 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.9:tree (default-cli) # persistence ---
[INFO] omnibus:persistence:jar:1.0-SNAPSHOT
[INFO] +- omnibus:domain:jar:1.0-SNAPSHOT:compile
[INFO] | \- javax.persistence:persistence-api:jar:1.0.2:compile
[INFO] +- org.jooq:jooq:jar:3.6.1:compile
[INFO] +- org.jooq:jooq-meta:jar:3.6.1:compile
[INFO] +- org.jooq:jooq-codegen:jar:3.6.1:compile
[INFO] +- org.springframework.boot:spring-boot-starter-jdbc:jar:1.2.5.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter:jar:1.2.5.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot:jar:1.2.5.RELEASE:compile
[INFO] | | | \- org.springframework:spring-context:jar:4.1.7.RELEASE:compile
[INFO] | | | +- org.springframework:spring-aop:jar:4.1.7.RELEASE:compile
[INFO] | | | | \- aopalliance:aopalliance:jar:1.0:compile
[INFO] | | | \- org.springframework:spring-expression:jar:4.1.7.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot-autoconfigure:jar:1.2.5.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot-starter-logging:jar:1.2.5.RELEASE:compile
[INFO] | | | +- org.slf4j:jcl-over-slf4j:jar:1.7.12:compile
[INFO] | | | +- org.slf4j:jul-to-slf4j:jar:1.7.12:compile
[INFO] | | | +- org.slf4j:log4j-over-slf4j:jar:1.7.12:compile
[INFO] | | | \- ch.qos.logback:logback-classic:jar:1.1.3:compile
[INFO] | | | \- ch.qos.logback:logback-core:jar:1.1.3:compile
[INFO] | | \- org.yaml:snakeyaml:jar:1.14:compile
[INFO] | +- org.springframework:spring-core:jar:4.1.7.RELEASE:compile
[INFO] | +- org.springframework:spring-jdbc:jar:4.1.7.RELEASE:compile
[INFO] | | \- org.springframework:spring-beans:jar:4.1.7.RELEASE:compile
[INFO] | +- org.apache.tomcat:tomcat-jdbc:jar:8.0.23:compile
[INFO] | | \- org.apache.tomcat:tomcat-juli:jar:8.0.23:compile
[INFO] | \- org.springframework:spring-tx:jar:4.1.7.RELEASE:compile
[INFO] +- org.postgresql:postgresql:jar:9.4-1201-jdbc41:compile
[INFO] +- org.dbunit:dbunit:jar:2.5.1:test
[INFO] | +- org.slf4j:slf4j-api:jar:1.7.12:compile
[INFO] | +- junit:junit:jar:4.12:test
[INFO] | +- commons-collections:commons-collections:jar:3.2.1:test
[INFO] | \- org.apache.poi:poi-ooxml:jar:3.11:test
[INFO] | +- org.apache.poi:poi:jar:3.11:test
[INFO] | | \- commons-codec:commons-codec:jar:1.9:test
[INFO] | \- org.apache.poi:poi-ooxml-schemas:jar:3.11:test
[INFO] | \- org.apache.xmlbeans:xmlbeans:jar:2.6.0:test
[INFO] | \- stax:stax-api:jar:1.0.1:test
[INFO] +- org.springframework.boot:spring-boot-starter-tomcat:jar:1.2.5.RELEASE:compile
[INFO] | +- org.apache.tomcat.embed:tomcat-embed-core:jar:8.0.23:compile
[INFO] | +- org.apache.tomcat.embed:tomcat-embed-el:jar:8.0.23:compile
[INFO] | +- org.apache.tomcat.embed:tomcat-embed-logging-juli:jar:8.0.23:compile
[INFO] | \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:8.0.23:compile
[INFO] \- org.springframework.boot:spring-boot-starter-test:jar:1.2.5.RELEASE:test
[INFO] +- org.mockito:mockito-core:jar:1.10.19:test
[INFO] | \- org.objenesis:objenesis:jar:2.1:test
[INFO] +- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] +- org.hamcrest:hamcrest-library:jar:1.3:test
[INFO] \- org.springframework:spring-test:jar:4.1.7.RELEASE:test
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building service 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.9:tree (default-cli) # service ---
[INFO] omnibus:service:jar:1.0-SNAPSHOT
[INFO] +- omnibus:persistence:jar:1.0-SNAPSHOT:compile
[INFO] | +- omnibus:domain:jar:1.0-SNAPSHOT:compile
[INFO] | | \- javax.persistence:persistence-api:jar:1.0.2:compile
[INFO] | +- org.jooq:jooq:jar:3.6.1:compile
[INFO] | +- org.jooq:jooq-meta:jar:3.6.1:compile
[INFO] | +- org.jooq:jooq-codegen:jar:3.6.1:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-jdbc:jar:1.2.5.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot-starter:jar:1.2.5.RELEASE:compile
[INFO] | | | +- org.springframework.boot:spring-boot:jar:1.2.5.RELEASE:compile
[INFO] | | | | \- org.springframework:spring-context:jar:4.1.7.RELEASE:compile
[INFO] | | | | +- org.springframework:spring-aop:jar:4.1.7.RELEASE:compile
[INFO] | | | | | \- aopalliance:aopalliance:jar:1.0:compile
[INFO] | | | | \- org.springframework:spring-expression:jar:4.1.7.RELEASE:compile
[INFO] | | | +- org.springframework.boot:spring-boot-autoconfigure:jar:1.2.5.RELEASE:compile
[INFO] | | | +- org.springframework.boot:spring-boot-starter-logging:jar:1.2.5.RELEASE:compile
[INFO] | | | | +- org.slf4j:jcl-over-slf4j:jar:1.7.12:compile
[INFO] | | | | | \- org.slf4j:slf4j-api:jar:1.7.12:compile
[INFO] | | | | +- org.slf4j:jul-to-slf4j:jar:1.7.12:compile
[INFO] | | | | +- org.slf4j:log4j-over-slf4j:jar:1.7.12:compile
[INFO] | | | | \- ch.qos.logback:logback-classic:jar:1.1.3:compile
[INFO] | | | | \- ch.qos.logback:logback-core:jar:1.1.3:compile
[INFO] | | | \- org.yaml:snakeyaml:jar:1.14:compile
[INFO] | | +- org.springframework:spring-jdbc:jar:4.1.7.RELEASE:compile
[INFO] | | | \- org.springframework:spring-beans:jar:4.1.7.RELEASE:compile
[INFO] | | +- org.apache.tomcat:tomcat-jdbc:jar:8.0.23:compile
[INFO] | | | \- org.apache.tomcat:tomcat-juli:jar:8.0.23:compile
[INFO] | | \- org.springframework:spring-tx:jar:4.1.7.RELEASE:compile
[INFO] | \- org.postgresql:postgresql:jar:9.4-1201-jdbc41:compile
[INFO] +- commons-validator:commons-validator:jar:1.4.1:compile
[INFO] | +- commons-beanutils:commons-beanutils:jar:1.9.2:compile
[INFO] | +- commons-digester:commons-digester:jar:2.1:compile
[INFO] | +- commons-logging:commons-logging:jar:1.2:compile
[INFO] | \- commons-collections:commons-collections:jar:3.2.1:compile
[INFO] +- org.springframework.boot:spring-boot-starter-tomcat:jar:1.2.5.RELEASE:compile
[INFO] | +- org.apache.tomcat.embed:tomcat-embed-core:jar:8.0.23:compile
[INFO] | +- org.apache.tomcat.embed:tomcat-embed-el:jar:8.0.23:compile
[INFO] | +- org.apache.tomcat.embed:tomcat-embed-logging-juli:jar:8.0.23:compile
[INFO] | \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:8.0.23:compile
[INFO] \- org.springframework.boot:spring-boot-starter-test:jar:1.2.5.RELEASE:test
[INFO] +- junit:junit:jar:4.12:test
[INFO] +- org.mockito:mockito-core:jar:1.10.19:test
[INFO] | \- org.objenesis:objenesis:jar:2.1:test
[INFO] +- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] +- org.hamcrest:hamcrest-library:jar:1.3:test
[INFO] +- org.springframework:spring-core:jar:4.1.7.RELEASE:compile
[INFO] \- org.springframework:spring-test:jar:4.1.7.RELEASE:test
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building web 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.9:tree (default-cli) # web ---
[INFO] omnibus:web:jar:1.0-SNAPSHOT
[INFO] +- omnibus:service:jar:1.0-SNAPSHOT:compile
[INFO] | +- omnibus:persistence:jar:1.0-SNAPSHOT:compile
[INFO] | | +- omnibus:domain:jar:1.0-SNAPSHOT:compile
[INFO] | | | \- javax.persistence:persistence-api:jar:1.0.2:compile
[INFO] | | +- org.jooq:jooq:jar:3.6.1:compile
[INFO] | | +- org.jooq:jooq-meta:jar:3.6.1:compile
[INFO] | | +- org.jooq:jooq-codegen:jar:3.6.1:compile
[INFO] | | +- org.springframework.boot:spring-boot-starter-jdbc:jar:1.2.5.RELEASE:compile
[INFO] | | | +- org.springframework:spring-jdbc:jar:4.1.7.RELEASE:compile
[INFO] | | | +- org.apache.tomcat:tomcat-jdbc:jar:8.0.23:compile
[INFO] | | | | \- org.apache.tomcat:tomcat-juli:jar:8.0.23:compile
[INFO] | | | \- org.springframework:spring-tx:jar:4.1.7.RELEASE:compile
[INFO] | | \- org.postgresql:postgresql:jar:9.4-1201-jdbc41:compile
[INFO] | \- commons-validator:commons-validator:jar:1.4.1:compile
[INFO] | +- commons-beanutils:commons-beanutils:jar:1.9.2:compile
[INFO] | +- commons-digester:commons-digester:jar:2.1:compile
[INFO] | +- commons-logging:commons-logging:jar:1.2:compile
[INFO] | \- commons-collections:commons-collections:jar:3.2.1:compile
[INFO] +- org.springframework.boot:spring-boot-starter-web:jar:1.2.5.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter:jar:1.2.5.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot:jar:1.2.5.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot-autoconfigure:jar:1.2.5.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot-starter-logging:jar:1.2.5.RELEASE:compile
[INFO] | | | +- org.slf4j:jcl-over-slf4j:jar:1.7.12:compile
[INFO] | | | | \- org.slf4j:slf4j-api:jar:1.7.12:compile
[INFO] | | | +- org.slf4j:jul-to-slf4j:jar:1.7.12:compile
[INFO] | | | +- org.slf4j:log4j-over-slf4j:jar:1.7.12:compile
[INFO] | | | \- ch.qos.logback:logback-classic:jar:1.1.3:compile
[INFO] | | | \- ch.qos.logback:logback-core:jar:1.1.3:compile
[INFO] | | \- org.yaml:snakeyaml:jar:1.14:compile
[INFO] | +- com.fasterxml.jackson.core:jackson-databind:jar:2.4.6:compile
[INFO] | | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.4.6:compile
[INFO] | | \- com.fasterxml.jackson.core:jackson-core:jar:2.4.6:compile
[INFO] | +- org.hibernate:hibernate-validator:jar:5.1.3.Final:compile
[INFO] | | +- javax.validation:validation-api:jar:1.1.0.Final:compile
[INFO] | | +- org.jboss.logging:jboss-logging:jar:3.1.3.GA:compile
[INFO] | | \- com.fasterxml:classmate:jar:1.0.0:compile
[INFO] | +- org.springframework:spring-core:jar:4.1.7.RELEASE:compile
[INFO] | +- org.springframework:spring-web:jar:4.1.7.RELEASE:compile
[INFO] | | +- org.springframework:spring-aop:jar:4.1.7.RELEASE:compile
[INFO] | | | \- aopalliance:aopalliance:jar:1.0:compile
[INFO] | | +- org.springframework:spring-beans:jar:4.1.7.RELEASE:compile
[INFO] | | \- org.springframework:spring-context:jar:4.1.7.RELEASE:compile
[INFO] | \- org.springframework:spring-webmvc:jar:4.1.7.RELEASE:compile
[INFO] | \- org.springframework:spring-expression:jar:4.1.7.RELEASE:compile
[INFO] +- org.springframework.boot:spring-boot-starter-tomcat:jar:1.2.5.RELEASE:compile
[INFO] | +- org.apache.tomcat.embed:tomcat-embed-core:jar:8.0.23:compile
[INFO] | +- org.apache.tomcat.embed:tomcat-embed-el:jar:8.0.23:compile
[INFO] | +- org.apache.tomcat.embed:tomcat-embed-logging-juli:jar:8.0.23:compile
[INFO] | \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:8.0.23:compile
[INFO] \- org.springframework.boot:spring-boot-starter-test:jar:1.2.5.RELEASE:test
[INFO] +- junit:junit:jar:4.12:test
[INFO] +- org.mockito:mockito-core:jar:1.10.19:test
[INFO] | \- org.objenesis:objenesis:jar:2.1:test
[INFO] +- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] +- org.hamcrest:hamcrest-library:jar:1.3:test
[INFO] \- org.springframework:spring-test:jar:4.1.7.RELEASE:test
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] omnibus ............................................ SUCCESS [ 21.195 s]
[INFO] domain ............................................. SUCCESS [ 0.121 s]
[INFO] persistence ........................................ SUCCESS [ 0.840 s]
[INFO] service ............................................ SUCCESS [ 0.193 s]
[INFO] web ................................................ SUCCESS [ 0.304 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 23.970 s
[INFO] Finished at: 2015-08-16T17:25:06+02:00
[INFO] Final Memory: 18M/245M
[INFO] ------------------------------------------------------------------------
Your command output seems weird as you mentioned the groupId is "app" in the question, however the command output shows the groupId is "omnibus" and not app.
Try changing the dependency to:
<dependencies>
<dependency>
<groupId>omnibus</groupId>
<artifactId>domain</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
(...)
The same goes for all other module dependencies.

Mule uses old Joda Time version

Jira ticket: https://www.mulesoft.org/jira/browse/MULE-7707
How do I override the version in my connector? This is what I did in my pom.xml
<dependency>
<groupId>org.mule.transports</groupId>
<artifactId>mule-transport-http</artifactId>
<version>3.5.0</version>
<exclusions>
<exclusion>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
</exclusion>
</exclusions>
</dependency>
and dependency tree:
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) # dynamodb-connector ---
[INFO] org.mule.modules:dynamodb-connector:mule-module:1.0.0-SNAPSHOT
[INFO] +- joda-time:joda-time:jar:2.2:compile
[INFO] +- com.amazonaws:aws-java-sdk-dynamodb:jar:1.9.11:compile
[INFO] | \- com.amazonaws:aws-java-sdk-s3:jar:1.9.11:compile
[INFO] | \- com.amazonaws:aws-java-sdk-kms:jar:1.9.11:compile
[INFO] | \- com.amazonaws:aws-java-sdk-core:jar:1.9.11:compile
[INFO] | \- (joda-time:joda-time:jar:2.2:compile - omitted for duplicate)
[INFO] +- org.mule.modules:mule-module-json:jar:3.5.0:compile
[INFO] | +- org.mule.modules:mule-module-xml:jar:3.5.0:compile
[INFO] | | \- (joda-time:joda-time:jar:2.2:compile - omitted for duplicate)
[INFO] | \- org.kitchen-eel:json-schema-validator:jar:1.2.2:compile
[INFO] | \- (joda-time:joda-time:jar:2.2:compile - omitted for duplicate)
[INFO] \- org.mule.modules:mule-module-cxf:jar:3.5.0:provided (scope not updated to compile)
[INFO] +- org.apache.cxf:cxf-rt-databinding-jibx:jar:2.5.9:provided
[INFO] | \- org.jibx:jibx-run:jar:1.2.4.5:provided
[INFO] | \- (joda-time:joda-time:jar:2.2:provided - omitted for duplicate)
[INFO] \- org.apache.cxf:cxf-rt-ws-security:jar:2.5.9:provided
[INFO] \- org.apache.ws.security:wss4j:jar:1.6.9:provided
[INFO] \- org.opensaml:opensaml:jar:2.5.1-1:provided
[INFO] \- org.opensaml:openws:jar:1.4.2-1:provided
[INFO] \- org.opensaml:xmltooling:jar:1.3.2-1:provided
[INFO] \- (joda-time:joda-time:jar:2.2:provided - omitted for duplicate)
I'm not sure why it keeps complaining java.lang.NoSuchMethodError: org.joda.time.format.DateTimeFormatter.withZoneUTC()
Mule 3.6 is being released very soon including MULE-7936, and therefor an fully tested Mule with an update joda-time. I would recommend to wait for it or to manually backport and keep developing with that version until 3.6 gets released.

Categories

Resources