Closed GoogleCodeExporter closed 9 years ago
I had the same problem when packaging with the Maven m2 plugin for Eclipse.
However,
when performing a 'mvn package' from command line, there was no problem and the
jars
are included as expected.
Original comment by tom.w.p....@gmail.com
on 4 Jun 2009 at 6:30
Hi Elisha, thanks for your issue report. And thank you Tom for your input on
the matter.
I made a small test project which I beleive does the same thing you are looking
for,
Elisha.
It's three library projects, and one application project. All
<packaging>jar</packaging> and the app uses onejar-maven-plugin. They are built
from
a root-pom which has all of them as <module>.
You can download it from here:
http://github.com/hugojosefson/onejar-maven-plugin-issue15/tree/master
Unpack, enter the unpacked directory and run these commands and you should get
the
correct output:
$ mvn install
$ java -jar myapp/target/myapp-1.0-SNAPSHOT.one-jar.jar
Hello World from App!
Hello World from Lib A!
Hello World from Lib B!
Hello World from Lib C!
I use Maven 2.0.10.
Elisha, please verify if it works for you with a recent version of Maven.
Switching issue status to Incomplete, while waiting for your response. Thank
you.
/Hugo
Original comment by hugo.josefson.old@gmail.com
on 12 Jun 2009 at 7:33
Hi, Hugo.
Thanks for the working example.
The strange thing is that it only works from command line. (as my project did)
When I package from within Eclipse with the Maven m2 Eclipse plugin there is no
lib
folder included in myapp-1.0-SNAPSHOT.one-jar.jar, resulting in a
NoClassDefFoundError.
Thanks,
Tom.
Original comment by tom.w.p....@gmail.com
on 13 Jun 2009 at 11:00
Thank you Elisha for verifying that.
Yes, many people have problems with Eclipe's instability. That's why I always
recommend clients to rely on a stable build tool (like Maven) for building and
releasing, and only use an IDE as far as it makes certain things easier (like
CTRL-space completion and stuff). I even use a different IDE
altogether...combined
with Maven of course!
/Hugo
----
Closing this now as WontFix, because it works with Maven as it should.
Original comment by hugo.josefson.old@gmail.com
on 13 Jun 2009 at 11:16
Sorry Tom and Elisha! Mixed up your names there a little.. :)
Original comment by hugo.josefson.old@gmail.com
on 13 Jun 2009 at 11:17
Original issue reported on code.google.com by
Elisha.N...@gmail.com
on 2 Jun 2009 at 9:34Attachments: