I am developing a system that consists of two Maven projects:

  *   dedupster-core
  *   dedupster-apps

See the two attached poms.

The core project is packaged as JAR, using the maven-assembly-plugin with a 
jar-with-dependencies descriptor ref. When I do mvn install on that project, I 
get two JARS:


  *   dedupster-core-0.0.1-SNAPSHOT.jar
  *   dedupster-core-0.0.1-SNAPSHOT-with-dependencies.jar

The second of those is a self-contained jar that can be run at the command line.

The apps project is packaged as a WAR file, and it has a dependency on 
dedupster-core. When I run mvn install on that project, I get a single WAR file 
and a jar-with-depencies:



  *   dedupster-apps-0.0.1-SNAPSHOT-jar-with-dependencies.jar
  *   dedupster-apps-0.0.1-SNAPSHOT.war

Then, when I go to Eclipse and dur Run as > Run on Server on the dedupster-apps 
project, I get:

   NoClassDefFoundError: ca/nrc/dtrc/dedupster/BugReport

My understanding is that NoClassDefFoundError is different from 
ClassNotFoundException, and that It means that the class was present, but one 
of the classes that it depends on was absent.

Indeed, when I do a ‘tar tvf on dedupster-apps-0.0.1-SNAPSHOT.war’, I see that 
WEB-INF/lib contains dedupster-core-0.0.1-SNAPSHOT.jar as opposed to 
dedupster-core-0.0.1-SNAPSHOT-with-dependencies.jar. In other words, it doesn’t 
contain any of the dependencies that deduspter-core depends on.

So the next thing I tried was to manually copy the 
dedupster-core-0.0.1-SNAPSHOT-with-dependencies.jar over 
dedupster-core-0.0.1-SNAPSHOT.jar, then redo ‘mvn install’ on the apps project, 
and restart it in the server. But I still got the same error.

I am at my wits’ end with this and would really appreciate any help that can be 
provided.

Thx.

Alain Désilets

Attachment: pom-apps.xml
Description: pom-apps.xml

Attachment: pom-core.xml
Description: pom-core.xml

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to