views:

271

answers:

2

Hi all,

I have created a Maven2 project. Everything works fine. Now, I have set up a Hudson project in order to make nightly builds possible. Hudson should check out the current project state from a Subversion repository, run the tests, build the project and deploy everyting to a repository. My Subversion repositroy contains my Maven2 project but no jars located in my local Maven repository (.m2). That's probably why hudson finishes with a failure, saying that some 3rd party jars are't available. Here, I have to say that there are some jars in my local Maven repository (.m2), which aren't available in any Maven repositories. Hence, there is no possibility to download these jars. Has Hudson the ability to connect to the local .m2 repository? Or is there another way to make these jar files available to Hudson?

Thanks a million in advance for your help.

A: 

is there another way to make these jar files available to Hudson?

That's very dirty but you could replace the "Hudson's local repository" (i.e. the local repository of the user under which Hudson runs) with "your local repository". And I really mean replace here i.e. delete $HUDSON_HOME/.m2/repository and copy $YOUR_USER_HOME/.m2/repository (don't merge).

But as I said, this is very dirty, you should use a corporate repository and install artifacts non available in public repositories in this corporate repository.

Pascal Thivent
A: 

Yes, there's a relatively easy/fast way to do it. Let's suppose that you use Microsoft JDBC driver class: sqljdbc4-3.0.jar This JAR doesn't exist in any repository due to license restrictions.

You can use the scope system in the dependency to tell maven to get the file from a relative folder of your project:

<dependency>
  <groupId>com.microsoft</groupId>
  <artifactId>sqljdbc4</artifactId>
  <version>3.0</version>
  <scope>system</scope>
  <systemPath>${basedir}/libs/sqljdbc4-3.0.jar</systemPath>
</dependency>

Please, notice that groupId and artifactId are just made up by me, they are not relevant, but mandatory.

I hope this helps.

monzonj