user1528734
user1528734

Reputation: 31

maven create jar with dependencies (Eclipse plugin)

I wanted to export a project from Eclipse with the Maven plugin with

clean package

The project has several dependencies, one from my workspace, and several fom e.g. Apache. The export took place, the .jar file was created. I added the main file entry to manifest.mf manually. When i tried to run the jar, i got an error message:

no calssDeffoundError: com.apache.org.common.ApplicationCOntxt. ...   
Could not find main class hu.bz.test.Main.

How can i export a jar file with the dependencies using Maven?

Upvotes: 2

Views: 8757

Answers (1)

Jaffar Ramay
Jaffar Ramay

Reputation: 1165

Create jar by using maven assembly plugin and its jar-with-dependencies configuration -> http://maven.apache.org/plugins/maven-assembly-plugin/descriptor-refs.html#jar-with-dependencies

Upvotes: 1

Related Questions