Jenkins:在maven项目中添加自定义jar [英] Jenkins : Add custom jar in maven project

查看:1329
本文介绍了Jenkins:在maven项目中添加自定义jar的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试添加Maven存储库中不可用的自定义jar。当我在本地执行时,我指向Jar路径,所以没有问题。但是当我使用Jenkins执行时,我面临的问题是无法解决项目的依赖关系。它还列出了我添加自定义的两个Jar文件丢失。

I am trying to add custom jar which is not available in Maven repository. When I am executing in local I am pointing to the Jar path, So no issues. But when I execute with Jenkins I am facing issue as Could not resolve dependencies for project. Also it list down the two Jar file missing which I added custom.

请帮助我如何添加使用Jenkins执行的自定义Jar wile。我也在使用Nexus进行二进制存储。 Jenkins成功执行后,图像文件将通过版本控制发布到nexus目录。

So help me how to add the custom Jar wile executing using Jenkins. Also I am using Nexus for binary storage. After Jenkins executes successfully the image file will be posted to the nexus directory with versioning.

推荐答案

您有2个选项

1)如果您可以访问Jenkins使用的本地Nexus / Artifactory仓库可以将jar添加到该存储库,它将正常下载。

1) If your have access to the local Nexus/Artifactory repo that your Jenkins uses you can add the jar to that repository and it will be downloaded as normal.

2)您可以拥有一个本地存储库,在其中将jar检查到项目下的SCM中。然后你可以在你的pom中像这样访问它。请参见 http://doduck.com/adding-local-jar- in-maven-local-repository /

2) You can have a local repository where you check the jar into SCM under your project. You would then access it like this in your pom. See http://doduck.com/adding-local-jar-in-maven-local-repository/

   <repositories>
      <repository>
         <id>localrepository</id>
         <url>file://${basedir}/repo</url>
      </repository>
   </repositories>

这篇关于Jenkins:在maven项目中添加自定义jar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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