当使用Jenkins Freestyle项目时,我能够使用“Maven3-Artifactory集成”成功地运行Maven构建
当试图在pipeline中使用这个特性时,我遇到了从中央maven存储库中解析工件的问题。我的印象是,当Jenkins在artifactory中找不到工件时,它应该回到中央maven存储库https://repo . maven . Apache . org/maven 2来寻找工件。事实不是这样的吗?
def server = Artifactory.server SERVER_ID
def rtMaven = Artifactory.newMavenBuild()
rtMaven.resolver server: server, releaseRepo: 'my-release-local', snapshotRepo: 'my-snapshot-local'
rtMaven.deployer server: server, releaseRepo: 'my-release-local', snapshotRepo: 'my-snapshot-local'
rtMaven.deployer.artifactDeploymentPatterns.addInclude("").addExclude("")
rtMaven.deployer.deployArtifacts = false
rtMaven.tool = MAVEN_TOOL
def buildInfo = rtMaven.run pom: POM_FILE, goals: GOALS
server.publishBuildInfo buildInfo
从控制台输出看,似乎Jenkins迫使构建只解析来自artiFactory而不是其他地方的工件,即使它看到了中央存储库。
[main] DEBUG org.jfrog.build.extractor.maven.resolver.ArtifactoryEclipseRepositoryListener - [buildinfo] Resolved artifact: org.apache.maven.plugins:maven-clean-plugin:pom:2.5:build from: central (https://repo.maven.apache.org/maven2, releases) Context is: plugin
[main] DEBUG org.jfrog.build.extractor.maven.resolver.ResolutionHelper - [buildinfo] Properties file '/tmp/buildInfo6034012728922541318.properties' retrieved from 'System.getProperty(buildInfoConfig.propertiesFile)'
[main] DEBUG org.jfrog.build.extractor.maven.resolver.ArtifactoryEclipseResolversHelper - [buildinfo] Enforcing snapshot repository for resolution: mysnapshotartifactoryURL
[main] DEBUG org.jfrog.build.extractor.maven.resolver.ArtifactoryEclipseResolversHelper - [buildinfo] Enforcing repository authentication: username=myusername, password=*** for snapshot resolution repository
[main] DEBUG org.jfrog.build.extractor.maven.resolver.ArtifactoryEclipseResolversHelper - [buildinfo] Enforcing release repository for resolution: myreleaseartifactoryURL
[main] DEBUG org.jfrog.build.extractor.maven.resolver.ArtifactoryEclipseResolversHelper - [buildinfo] Enforcing repository authentication: username=myusername, password=*** for release resolution repository
[main] DEBUG org.jfrog.build.extractor.maven.resolver.ArtifactoryEclipseArtifactResolver - Verifying availability of /home/myusername/.m2/repository/org/apache/maven/plugins/maven-plugins/22/maven-plugins-22.pom from [artifactory-release (myreleaseartifactoryURL, releases), artifactory-snapshot (mysnapshotartifactoryURL, snapshots)]
[main] DEBUG org.jfrog.build.extractor.maven.resolver.ArtifactoryEclipseRepositoryListener - [buildinfo] Could not resolve artifact: org.apache.maven.plugins:maven-plugins:pom:22:build
[main] ERROR org.apache.maven.cli.MavenCli - Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.5: Could not find artifact org.apache.maven.plugins:maven-plugins:pom:22 in artifactory-release (myreleaseartifactoryURL)-> [Help 1]
org.apache.maven.plugin.PluginResolutionException: Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.5
前段时间我遇到了同样的问题。我不知道它是否适用于你。这个流程是我从神器中记得的:
libs-frease-local
,我们将其用于本地构建。这具有与libs-发布下面是我们如何在Jenkins文件中使用它:
// Obtain an Artifactory server instance, defined in Jenkins --> Manage:
def server = Artifactory.server 'localArtifactory'
def rtMaven
def buildInfo
// Artifactory Maven Build instance
rtMaven = Artifactory.newMavenBuild()
rtMaven.tool = 'localMaven'
//where the Maven build should download its dependencies from
rtMaven.resolver server: server, releaseRepo: 'libs-release' , snapshotRepo: 'libs-snapshot'
//define where our build artifacts should be deployed to. we define the Artifactory server and repositories on the 'rtMaven' instance
rtMaven.deployer server: server, releaseRepo: 'libs-release-local', snapshotRepo: 'libs-snapshot-local'
//disable pushing to artifactory, true if requered
rtMaven.deployer.deployArtifacts = false
//By default, all the build artifacts are deployed to Artifactory. So, let's make filter and deployArtifacts=true
rtMaven.deployer.artifactDeploymentPatterns.addInclude("*-common-*")
rtMaven.run pom: 'pom.xml', goals: 'clean package'
rtMaven.deployer.deployArtifacts buildInfo
我有两个私人JFrog存储库设置。一个存储库处理发布,另一个处理快照。下面是我如何在我的设置中定义它的。xml文件。 我的多模块maven项目中的多个内部依赖项都收到了这个错误: 从外观上看,Maven似乎并没有试图联系官方的Maven Central repo以获取这些依赖项,而是在我的私有存储库上失败了。我的印象是,如果私有存储库不包含特定工件,它将尝试联系Maven Central。 从Ma
我是Java EE和Maven的新手,所以我不确定需要哪些信息才能看到我犯了错误。 当我右键单击我的项目并进入Maven-->Reload project时,build选项卡打开,出现以下错误 当我悬停maven assembly插件时,IDE还告诉我 如果我需要任何进一步的信息,请告诉我。
本文向大家介绍在Centos上搭建Maven中央仓库的方法,包括了在Centos上搭建Maven中央仓库的方法的使用技巧和注意事项,需要的朋友参考一下 环境 安装JAVA 在这里使用yum来安装java的jdk,可以使用指令yum search java | grep jdk来查看yum下提供了哪些jdk版本。这里选择1.8版本,安装指令为:sudo yum install java-1.8.0-
我在尝试构建项目时遇到以下错误。唯一的区别是gradle脚本是在Kotlin DSL中。 下面是我的整个build.gradle.kts文件 https://gist.github.com/nksaroj/483f3f07df8e04c72040ea4c055459d6 或者 https://github.com/nksaroj/xDemo 是完整的项目。
在我的pom.xml中升级依赖项后,我在尝试下载新工件时收到了以下错误(在本例中使用maven命令行)。 无法解析以下工件:io。github。bonigarcia:webdrivermanager:jar:3.8.1,org。zaproxy:zap clientapi:jar:1.7.0:找不到工件io。github。bonigarcia:webdrivermanager:jar:3.8.1Sp
我正在尝试将我们的 Jenkins 服务器连接到我们的 Artifactory 存储库以进行构建。我已经成功地在我的办公地点使用 Jenkins 服务器,但是我在公司网络的另一部分上使用 Jenkins 服务器时遇到了问题。 我已经禁用了该作业,进入工作区,并尝试直接使用: 然后在它吐出来之前冻结: 但是,如果我试图通过< code>curl获取该URL,它可以毫无问题地下载。与< code>wg