This is in a way a follow-up of a previously unanswered question of mine (link) which excalated over the past weeks, and now it has come to a point where I cant really develop anymore...
So here's the deal; I have more of a mathematics/engineering background than pure CS, so I dont have a lot of experience with proper/large-scale software development, but rather scripting and algorithms. Now that I am working on a large project, on my own, I am confused with some of the aspects of development. One of them being handling libraries/dependencies
I have initially created a folder called lib
under my project folder (in Eclipse workspace) and copied my external libraries in there and then added them to the build path. However later on I needed some other stuff like JCommons
, JFreeChart
, Apache Commons Math
etc.. According to instructions these libraries can/should be included as user libraries, allowing the developer to see the documentation and source code from within IDE (such as Eclipse). I have gotten it right so far, I hope...
So where is the problem? Well first off it appeared as the user libraries mentioned above are not included on the SVN copy of the project, meaning that my colleagues who wanted to test-drive my project couldn't do so, by just simply acquiring the project from SVN. Now the second phase of the problem unsurfaced when I changed my workstation at work, I wanted to import my project into Eclipse from my backup, but then everything except those user libraries are there. To make things more complicated, when this software is done, it will be implemented on a server so it would be absolutely best if everything could be packed into one single library or a even better a runnable jar
file.
I have been previously advised to take a look at Maven, or Ivy, but my initial understanding after checking them both is that they are used from the beginning and mostly for more complicated projects. Honestly I am completely puzzled as to how I am supposed to manage my dependencies. Any ideas?
(Sorry for keeping it long, but I figured better complete and long then inadequate information)
EDIT: I have managed to sort out the problem; the problem has apparently originated from the simple fact that eclipse doesn't copy all resources to one place, and the installation instructions for some libraries doesn't really warn you about how to manage the libraries in the best way.
Thanks to everyone, who took their time to try and help me. I will in time look more into projects like Maven and Ivy, it's definitely interesting stuff. However for now I just need to get back to the software into running state, been wrestling with new stuff for too long.. :)
To get started, open the "Preferences" window in Eclipse. Navigate to "Java » Build Path » User Libraries" on the left-hand side and click the "New" button. Enter the library name and click the "OK" button (leave the "System library" checkbox alone).
External Libraries are pieces of pre-written code that is easy to implement. You don't really have to know exactly anything about what is inside that code, you just need to know how to use it. Library makers the people who make these libraries are going to tell you exactly how to implement it.
At the risk of committing an act of heresy, I'd say Maven and wot-not are overkill here. You need your dependencies in your SVN project, simple as that. You've added your lib folder to your build path in Eclipse, and that's fine. But unless you specifically add the contents of the lib folder to your project (as Fred describes), those items won't be eligible for committing to SVN -- they will simply be referenced in your set-up's classpath. That's good for you, no good for anyone looking to check out your project (as you have found).
I appreciate that we could have endless discussions about best practice, the validity of committing third party libraries to version control, and so on and so forth... but I think most people have work to do ;-)
Invest some time to learn how to create a project using Maven. It just does so many things for you that it's amazing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With