Reputation: 1047
I have created a package that is to be used by other programmers by importing in their code. my programs use other jar files for XML parsing and I don't want others to worry about the dependencies what is the best way to make sure that my jar files always gets its dependencies?
Upvotes: 0
Views: 102
Reputation: 119
If you want to release your source as a zip archive, I would keep the dependencies outside the project jar. For example in a folder name lib.
I would use a build tool like Maven (http://maven.apache.org) to manage my dependencies. It's pretty easy to set up a repository like Nexus (http://www.sonatype.org/nexus) where your team members can get your jar and all the required dependencies.
Upvotes: 1
Reputation: 21778
Use jarjar, seems doing exactly that you want, does not force your potential users to use exactly Maven (some may use old Ant scripts or IDE features to add .jar file directly).
Upvotes: 0
Reputation: 10876
I would say cleanest solution is to use bulid scripts like using Ant or Maven. In Maven you could create a local repository with the name of mayank. Now, all your team members just need to include dependency mayank; all other dependencies will automatically be downloaded. They dont have to worry about anything else.
Upvotes: 2