-
Nov 7th, 2006, 06:15 AM
#1
package to jar
Hello,
I used the simple app as a starting point for my application. Now it's complete and I want to export it to jar.
When I run the "mvn package" command, I get a jar file but it wont start.
>java -jar myapp-0.3.0-SNAPSHOT.jar
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory at myapp.app.SimpleApp.<clinit>(SimpleApp.java:52)
The application can't find the commons-logging-1.1.jar (and any other libraries)
It runs perfectly in eclipse. I added all my libraries to Build Path there.
Also, is it wrong to use external libraries not from the maven repository? I created a "lib" folder in my project root, and copied some libraries there.
-
Nov 7th, 2006, 09:25 AM
#2
This is a maven question, see maven user list on news.gmane.org.
Just make sure the dependency jars are also copied to the target directory[1] and added in the Class-Path[2].
[1] see maven assembly plugin
[2] see maven jar plugin configuration
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules