Hudson无法构建我的Maven 2项目,因为它说存储库中缺少工件? (他们不是)

时间:2022-11-08 23:58:11

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.

我正在使用Hudson和Maven 2进行自动构建/ CI。我可以从命令行使用maven构建好,但是当我与Hudson运行相同的目标时,构建失败抱怨丢失的工件。我正在运行Hudson作为Windows XP服务。

2 个解决方案

#1


3  

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:

明显的问题,但你有没有Hudson设置指向与命令行构建相同的Maven存储库?您可以从Hudson管理员gui查看 - 查看Manage Hudson页面的Maven部分。这应该列出MAVEN_HOME环境变量。查看settings.xml文件:

MAVEN_HOME\conf\settings.xml

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

localRepository配置项是Hudson构建正在使用的Maven存储库的位置。

#2


3  

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.

确保您以与用于从命令行运行Maven的用户相同的方式运行Hudson。 Maven为每个用户创建一个单独的存储库。如果您将Hudson作为Windows服务运行,则该用户与您登录的用户不同,并且将运行“mvn”命令。这意味着存储库中的工件可能不同。

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

要修复,要么以工作的用户手动启动Hudson,要么为Hudson正在运行的用户更新存储库。

#1


3  

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:

明显的问题,但你有没有Hudson设置指向与命令行构建相同的Maven存储库?您可以从Hudson管理员gui查看 - 查看Manage Hudson页面的Maven部分。这应该列出MAVEN_HOME环境变量。查看settings.xml文件:

MAVEN_HOME\conf\settings.xml

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

localRepository配置项是Hudson构建正在使用的Maven存储库的位置。

#2


3  

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.

确保您以与用于从命令行运行Maven的用户相同的方式运行Hudson。 Maven为每个用户创建一个单独的存储库。如果您将Hudson作为Windows服务运行,则该用户与您登录的用户不同,并且将运行“mvn”命令。这意味着存储库中的工件可能不同。

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

要修复,要么以工作的用户手动启动Hudson,要么为Hudson正在运行的用户更新存储库。