Nexus + 的发布问题梅文 +哈德逊
在 Hudson(1.368) 上使用 Maven 的发布插件时,我收到一条错误,指出在 Nexus Maven 存储库管理器的部署阶段缺少我的 distributionManagement 部分。如果我在不使用版本的情况下进行部署,它会很好地工作,因此不应是服务器、部分或设置的错误配置。
值得注意的是,我的公司为 Hudson 使用了不同的 pom 文件,并且对它们进行了不同的命名。各个项目目录中的settings.xml 也是如此。这从来都不是问题,因为 Hudson 允许指定 pom 的名称以及设置文件的位置和名称。
我注意到上述内容的原因是,当 distributionManagement 移动到常规 pom.xml 中时,它确实找到了它(但仍然不起作用,因为它在设置文件中缺少用户名和密码)。这让我很困惑,因为对于发布过程的前面部分,它使用了正确的 pom 和设置。似乎只是后来忘记了它们。这是怎么回事?
先感谢您。
更新
看起来maven发布插件启动了一个新的maven实例,它似乎使用默认的pom.xml而不是我们不同命名的pom。需要更多测试。
When using the release plug-in for Maven on Hudson(1.368), I am getting an error that my distributionManagement section is missing during the deployment phase to our Nexus Maven Repository Manager. If I deploy without using release It woks just fine so should not be a misconfiguration with the server, the section or the settings.
It is worth noting that my company uses different pom files for Hudson and have named them differently. Also the settings.xml in in the individual project directories. This has never been a problem as Hudson allows for the name of the pom and the location and name of the settings file to be specified.
The reason I note the above is that when distributionManagement is moved into the regular pom.xml it does find it (but still doesn't work because its missing the username and password in the settings file). This confuses the heck out of me since for the prior parts of the release process, it uses the correct pom and settings. It just seems to forget them later on. What is going on here?
Thank you in advance.
UPDATE
It seems that the maven release plug-in spins up a new instance of maven which, it seems, is using the default pom.xml rather than our differently named pom. More testing is needed.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
答案(对于任何偶然发现这个问题的迷失者)是 Maven 确实创建了一个没有使用正确的 pom 文件和设置的新进程。解决方案是向 pom 文件添加一个部分,如下所示:
这将这两个文件指定给新的 Maven 进程。
The answer (for any lost souls who stumble upon this question) is that maven was indeed forking out a new process which was not using the correct pom file and settings. The solution was to add a section to the pom file as thus:
This specified those two files to the new maven process.
嗯,显然某个地方存在配置错误,无论是在 Hudson 级别。但是如果没有看到 pom、设置、活动配置文件、发布期间使用的配置文件、Hudson 设置等,就很难发现它。
第一步:尝试使用完全相同的配置在命令行上重现问题作为哈德森.
第二步:使用 Maven 帮助插件来了解和调试问题。更具体地说,目标如下:
帮助:活动配置文件
帮助:有效设置
如果在项目的
pom.xml
之外,则不清楚在何处指定distributionManagement
(在企业环境中,它通常位于企业pom.xml
中) ,这里也是这样吗?)。还不清楚您是否确实为与该服务器的存储库
id
匹配的服务器id
提供了用户名
和密码
分布管理
。但不知何故,这里使用了错误的组合。仔细检查发布/部署期间哪些配置文件/设置处于活动状态,以按照建议发现问题。
另请参阅
Well, there is clearly a misconfiguration somewhere, be it at the Hudson level. But it will be hard to spot it without seeing the pom, the settings, the active profiles, the profiles used during the release, the Hudson setup, etc.
First step: try to reproduce the problem on the command line using the exact same configuration as Hudson.
Second step: use the Maven Help Plugin to understand and debug the issue. More specifically, the following goals:
help:active-profiles
help:effective-pom
help:effective-settings
It's unclear where the
distributionManagement
is specified if outside the project'spom.xml
(in a corporate environment, it goes typically in a corporatepom.xml
, is it the case here?).It's also unclear if you are actually providing the
username
andpassword
for a serverid
matching the repositoryid
of thedistributionManagement
.But somehow, a wrong combination is used here. Double check what profiles/settings are active during release/deploy to spot the problem as suggested.
See also