Julien FOROT schrieb: > Hi ! > > I want to make 2different jars from the same source folder. So I made > this structure : > > - jar > -- pom.xml > -- src > -- heavyJar > --- pom.xml > -- lightJar > --- pom.xml > > I want that the heavy and light Jar used the folder src as > sourceFolder. The light Jar has to exclude some classes. I tried to > put on the heavy's pom something;ike that : > > <groupId>org.apache.maven.plugins</groupId> > <artifactId>maven-jar-plugin</artifactId> > <configuration> > <sourceDirectory>../src/</sourceDirectory> > </configuration> > > But my jars are always empty (no .class on it) : [WARNING] JAR will be > empty - no content was marked for inclusion! > > How can I do that ? I hope I'm enough clear.. Thanks for your help !
I don't think you can reference a source directory outside of a module itself. Even if it is possible, it's not very elegant. I think the easiest solution would be to have a single project. One of your jars (eg the "heavy") is the primary artifact; set things up so that is generated, just like a normal project. Then add an extra execution of the maven-jar-plugin which simply has a few extra <exclude> tags, and sets <classifier>light</classifier>. If you really do want two separate projects, then I suggest having the project with the source generate a normal jar, and have the other two projects use the maven-dependency-plugin to download the jar, unpack it, then repack it with just the desired classes. The project with source would be a "sibling" rather than a "parent" project. As always with Maven, it is best to think as if each mvn module was hosted by a different company; don't try to peek into the internals of other modules but instead just depend upon the artifacts that each produces. Regards, Simon --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
