Hi Chris,

this isn't really a maven-compiler-plugin issue. This is how the java compiler (JAVA_HOME/bin/javac) works, or to be more precise: how the classpath works. It expects that the packages are in the root of the archive, not in a subdirectory like WEB-INF/classes.

Best practice in this case: have a separate Maven module for the classes and include it as jar dependency to your war or generate an extra jar with your war containing the classes [1]. You'll get an extra webapp-1.0-SNAPSHOT-classes.jar. If you want to use this, add <classifier>classes</classifier> to your dependency.

thanks,
Robert

[1] http://maven.apache.org/plugins/maven-war-plugin/war-mojo.html#archiveClasses


Op Sat, 12 Dec 2015 01:19:11 +0100 schreef Chris Barlock <[email protected]>:

I used the maven-bundle-plugin to create a Web Application Bundle in which
the class files are in WEB-INF/classes and the MANIFEST.MF confirms this:

Bundle-ClassPath: WEB-INF/classes

If I try to use this WAB (packaged as a JAR) as a dependency for the
maven-compiler-plugin, it can't find any of the class files in the JAR. If
I change the JAR such that the class files are in the root of the JAR
rather than in WEB-INF classes, then maven-compiler-plugin is happy.  Is
it possible to use WABs with the maven-compiler-plugin?

Chris

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

Reply via email to