我有一个带有根目录的多模块项目
pom.xml
,用定义
<packaging>pom</packaging>
,和几个
<modules>
.
在詹金斯身上,我让马文带球
jar:jar install:install -Dmaven.test.skip=true
(编译和测试已经由构建管道中的先前作业完成)。
作为一个构建后操作,我将工件部署到Artifactory。我选中了“Deploy Maven artifacts”,并将include/exclude留空,因此它将采用默认值。
子模块正确地将pom和jar部署到Artifactory。我在控制台输出中看到了这一点:
Deploying artifacts of module: com.example:foo
Deploying artifact: https://repo.example.com/snapshot/com/example/foo/7.0.0-SNAPSHOT/foo-7.0.0-SNAPSHOT.jar
Deploying artifact: https://repo.example.com/snapshot/com/example/foo/7.0.0-SNAPSHOT/foo-7.0.0-SNAPSHOT.pom
这个
root
pom未正确上载到Artifactory。
当“抑制POM一致性检查”为
关
,生成失败,并在
根
pom(首字母缩写):
Deploying artifacts of module: com.example:root
Deploying artifact: https://repo.example.com/snapshot/com/example/root/7.0.0-SNAPSHOT/root-7.0.0-SNAPSHOT.pom
ERROR: Failed to deploy file: HTTP response code: 409. HTTP response message: Conflict
java.io.IOException: Failed to deploy file: HTTP response code: 409. HTTP response message: Conflict
at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.throwHttpIOException(ArtifactoryBuildInfoClient.java:743)
at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.uploadFile(ArtifactoryBuildInfoClient.java:623)
at org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient.deployArtifact(ArtifactoryBuildInfoClient.java:329)
at org.jfrog.hudson.maven2.ArtifactsDeployer.deployArtifact(ArtifactsDeployer.java:190)
at org.jfrog.hudson.maven2.ArtifactsDeployer.deploy(ArtifactsDeployer.java:130)
at org.jfrog.hudson.ArtifactoryRedeployPublisher.perform(ArtifactoryRedeployPublisher.java:420)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:782)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:723)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1047)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:668)
at hudson.model.Run.execute(Run.java:1763)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:531)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:410)
Build step 'Deploy artifacts to Artifactory' changed build result to FAILURE
当“抑制POM一致性检查”为
在…上
,我查一下
根
在Artifactory上,我转到“POM视图”,然后我看到以“PK”开头的二进制乱码,这表示一个ZIP文件,在本例中可能是一个JAR文件。下载该文件并将其解压缩为zip,确认它包含一个
META-INF
目录,其中包含一些与Maven相关的子目录。
我所期待的是一篇纯文本
pom.xml文件
对于
根
.
我还在控制台日志中注意到这一点:
[JENKINS] Archiving /var/lib/jenkins/jobs/example-develop-maven-artifactory/workspace/target/example-root-7.0.0-SNAPSHOT.jar to com.example/root/7.0.0-SNAPSHOT/root-7.0.0-SNAPSHOT.pom
然后
Deploying artifacts of module: com.example:root
Deploying artifact: https://repo.example.com/snapshot/com/example/root/7.0.0-SNAPSHOT/root-7.0.0-SNAPSHOT.pom
Deploying artifact: https://repo.example.com/snapshot/com/example/root/7.0.0-SNAPSHOT/root-7.0.0-SNAPSHOT.pom
据我所知,Artifactory会截获构建工具在本地存储库中部署的内容(
~/.m2
).
我怎么得到pom,只有pom,而不是神奇生成的罐子,我的
根
,在Artifactory上?这可能归结为,我如何告诉Maven和/或Jenkins不要覆盖我的
根
pom与
根
罐子
版本:
-
Artifactory 3.4.2(版本30140)
-
詹金斯1.643
-
Artifactory插件2.4.7