maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Scholte" <>
Subject Re: maven-compiler-plugin cannot find class files in WEB-INF/classes
Date Sat, 12 Dec 2015 12:07:24 GMT
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.



Op Sat, 12 Dec 2015 01:19:11 +0100 schreef Chris Barlock  

> 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:
For additional commands, e-mail:

View raw message