wood burning stoves*
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 Android Security Essentials Live Lessons this week in the Android 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: 207

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: 5812

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: http://maven.apache.org/plugins/maven-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
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: Maven packging issue
Similar Threads
Jar file creation using Maven
How to put configuration files of Spring, JPA and log4j outside jar in standalone app?
Maven - dependencies of external .jar package
Maven: include files from other modules into current module
Download Maven plugin