0

My project requires some external libraries to build in in Eclipse. They live in /trunk/lib whereas my project is in /trunk/projectA. To get Eclipse to find the libraries on all machines we set a variable PROJECT_A_HOME.

Now I'm trying to get some builds going with maven and I can not figure out how to add that path (be it environmental variable or relative to $(basedir)) to the build. I really do not want to set up a repository for these dependencies, as I keep them in source control and want builds to continue to work in Eclipse.

I've seen talk about but that hasn't worked for me.

Ideas ?

Bozho
  • 554,002
  • 136
  • 1,025
  • 1,121
Bill
  • 1,533
  • 1
  • 15
  • 28
  • 1
    http://stackoverflow.com/questions/2229757/maven-add-a-dependency-to-a-jar-by-relative-path look here – Bozho Mar 02 '10 at 22:55
  • Is there no way to just add a classpath variable to the build? – Bill Mar 03 '10 at 00:12
  • it would not be portable – Bozho Mar 03 '10 at 13:09
  • I'm not worried about it being portable. I just want a CI server and thought Maven could do the job. I'm not a fan of having two totally different build environments when Eclipse does a great job for debug & production builds. – Bill Mar 03 '10 at 13:52

2 Answers2

0

You should put your static configuration files in resources/ dir. If you have your own or proprietary jars you should set a your own repository so you can download them from the repository or better yet just install them manually , here is how

http://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html

ant
  • 21,609
  • 35
  • 125
  • 176
0

Setting up a file-based repository as suggested in this previous question would allow to keep the libs in your version control system and work seamlessly at the Eclipse level (the libs would be treated like any other dependency). The only problem I can think of could be at the continuous integration level: a build of projectA would require a checkout of trunk/lib. Many CI tools would allow to implement this though. And if not, moving the libs under projectA (or another mavenized project project if you need to share them between modules) would do the trick.

Community
  • 1
  • 1
Pascal Thivent
  • 535,937
  • 127
  • 1,027
  • 1,106