Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Maven packging issue

 
Benson Fung
Ranch Hand
Posts: 219
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

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?


Thanks
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic