They must use a different compiler. Verify their pom (or other buildtool file) to see how they do it.
e.g. googling for OSGi compiler plugin gave me enough hits.

Robert

Op Mon, 14 Dec 2015 01:07:23 +0100 schreef Chris Barlock <[email protected]>:

Thanks Robert.  I opened some of the Apache jars that have been
OSGi-enabled and they just put the classes and/or JARs in the root of the
JAR and specify the appropriate packages on Import-Packages and
Export-Package in the MANIFEST.  Your best practice is a little more
"pure" in terms of generating a "proper" OSGi bundle -- at the expense of
more more project to build the JAR for the bundle.

Chris

IBM Middleware
Research Triangle Park, NC
(919) 224-2240
Internet:  [email protected]



From:   "Robert Scholte" <[email protected]>
To:     "Maven Users List" <[email protected]>
Date:   12/12/2015 07:07 AM
Subject:        Re: maven-compiler-plugin cannot find class files in
WEB-INF/classes



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]




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

Reply via email to