在 Jenkins 中配置 Maven 设置 [英] Config maven setting in Jenkins

查看:47
本文介绍了在 Jenkins 中配置 Maven 设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的项目有 3 个 maven 模块,它们是由 nodejs 脚本构建的.

My project has 3 maven module and they are built by nodejs script.

现在我想与 Jenkins 和 Nexus 集成.我的 Jenkins 构建配置如下所示:

Now I want to integrate with Jenkin and Nexus. My Jenkin build config look like this:

我还在构建部分的提供配置文件构建步骤中添加了我的maven settings.xml但它没有用.Maven 仍然失败,无法解决我的 Nexus 存储库中的依赖项.

I also add my maven settings.xml in Provide configuration files build step in Build section but it didn't work. Maven still fail and could not resolve dependencies in my Nexus repo.

在我的本地 maven settings.xml 中,我为 Nexus 存储库和另一个存储库添加了一些配置.

In my local maven settings.xml I have added some config for Nexus repository and another repository.

你能告诉我这个案例吗?我是詹金的新手.

Can you enlight me this case. I'm new to Jenkin.

提前致谢.

推荐答案

我只是找到了一种解决方法,通过将 mvn-settings.xml 直接添加到我的文件夹并编辑运行命令,例如:

I just find a way to work around by adding mvn-settings.xml directly to my folder and edit the run command like:

mvn clean install -s mvn-settings.xml

这篇关于在 Jenkins 中配置 Maven 设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆