views:

4331

answers:

2

I'm using Hudson and Maven 2 for my automated build/CI. I can build fine with maven from the command line, but when I run the same goal with Hudson, the build fails complaining of missing artifacts. I'm running Hudson as a windows XP service.

+2  A: 

Make sure you're running Hudson as the same user that you are using to run Maven from the command line. Maven creates a separate repository for each user. If you are running Hudson as a Windows service, this won't be the same user as you have logged on as and will be running "mvn" commands with. This means the artifacts in the repositories may be different.

To fix, either start Hudson manually as the user which works, or update the repository for the user which Hudson is running as.

Andrew Harmel-Law
+2  A: 

Obvious question, but have you got Hudson set up to point to the same Maven repository as your command line build? You can check this from the Hudson admin gui - look in the Maven section of the Manage Hudson page. This should have a MAVEN_HOME environment variable listed. Look in the settings.xml file under:

MAVEN_HOME\conf\settings.xml

The localRepository configuration item is the location of the Maven repository that the Hudson build is using.

serg10
even though we set Maven repository in MAVEN_HOME\conf\settings.xmlstill Hudson goes to default directory C:\Documents and Settings\user.
Khangharoth