• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

Need advice in setting up a Java open-source project with external dependencies

 
Ranch Hand
Posts: 125
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I hope this question isn't off-topic for this forum and apologize in advance if it is.

I have written Java code that I would like to distribute as an open-source project. I am trying to set up the build, something that I haven't a lot of experience doing. I am leaning to setting up a simple ant build.xml, but there's a complication. For the most part, the project is just plain Java, but it does depend on a single external Jar file, the Apache Commons Math library. I was wondering what's the best way to handle that. Do I bundle the Apache jar with my distribution? Would it be better to automate the build to download the Jar from an outside source a build time? And, if so, is there an easy way to do that?

The code I've written is basically a class library that performs math operations and would be incorporated into bigger applications. In fact, it doesn't even have a user interface.

My overriding criteria here is that I want to make this easy for somebody who wants to build and use my code. Ideally, the build would be accomplished with tools that the average developer would already have installed and configured on his computer. So I want to avoid throwing anything new and unfamiliar at developers. I have a small project and it would be inappropriate to require a big effort on the part of somebody who wants to use it.

Thanks in advance for your help.

Gary


 
Sheriff
Posts: 22683
128
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you switch from Ant to Maven you can use Maven's dependency mechanism to do all the hard work for you.
 
Gary W. Lucas
Ranch Hand
Posts: 125
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Thanks for the suggestion. I've noticed that a couple of the ant-based open source projects I've downloaded (i.e the PostgreSQL JDBC Driver) include maven jars in their library folder. So it seems like even the folks who use ant sometimes resort to maven.

Following up... What's the general view on bundling a third party jar with a software distribution? I can see pro's and con's.
 
author & internet detective
Posts: 41250
849
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First you have to make sure the third party jars allow being bundled legally. Otherwise it is a moot point.

If you do bundle, I recommend having two versions - one with all the dependencies (for people not using Maven) and one without (so a smaller download size).
 
Gary W. Lucas
Ranch Hand
Posts: 125
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks again.

Gary
 
Ranch Hand
Posts: 433
Netbeans IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you want to stick to Ant have a look at Ivy. In a nutshell: Ivy uses the maven 2 repository to resolve the dependencies you declare in an Ivy file.
 
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic