File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Ant, Maven and Other Build Tools and the fly likes Maven packging issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Maven packging issue" Watch "Maven packging issue" New topic

Maven packging issue

Benson Fung
Ranch Hand

Joined: Apr 10, 2003
Posts: 214

I am new to Maven and would like to ask for help from expert right here. Actually, I have couple of jar files living at src/main/resources. Right now, I would like to include them into the final project big jar file but in the extracted .class file. Can anyone teach me what I need to do on pom.xml or there is no need to do?

Peter Johnson

Joined: May 14, 2008
Posts: 5852

I'm not sure what you mean by "in the extracted .class file".

If you are interested in packaging your application to distribute to users, look at the Assembly plugin:

Actually, I have couple of jar files living at src/main/resources

You should never do that. JAR files belong in the Maven repository, not within the source of your application. If the JARs are open source, then they are probably already available in the Maven Central repository. If they are not open source, you should use the deploy:deploy-file goal to load them into your local repository. Then add them as dependencies in your pom.xml. (Alternately, you should install a Mavne repository manager such as Nexus or Artifactory, and place the JARs there.)

JBoss In Action
subject: Maven packging issue
It's not a secret anymore!