Buildr create a jar that includes libraries and another project

I have 2 Java projects (e.g. p1 and p2) and I want to create a jar (using buildr) that contains both the projects and their libraries.

p2 depends on p1.

compile.with(projects('p1'), removeDups(project('p1').compile.dependencies), removeDups(P2_LIBS))

package(:jar).with( :manifest => {'Main-Class' => 'com.p2.Main'} )

compile.dependencies.each do |x|
         if x 
            package(:jar).merge(x).exclude('META-INF/MANIFEST.MF')
         end
end

I tried this, but it gave me an error, I think, because p2 depends on p1, because if I have only p1 and libs, it works.

So how do I create a jar file with p1, p2 a libs?

+5
source share
2 answers

You define a packaging project in which both are packaged.

See examples here and here .

+2
source

JAR p1, IDE (, netbeans)? dist, p2, p2 Jar.

0

All Articles