java - Jenkins Maven 插件错误“maven-release-plugin:jar:3.8.2 is missing”
问题描述
我是新人,但我浏览了许多帖子和网站,最后发布了,因为我不知道还能做什么。如果格式或我发布的方式不正确,请原谅。正如我所说,第一次来这里。如果我直接运行mvn clean package deploy
构建成功。但是当我从詹金斯运行构建时失败。
尝试运行构建时,我在 Jenkins 中收到以下错误
Downloaded from central: http://localhost:8081/artifactory/first-libs-release/org/apache/maven/plugins/maven-release-plugin/2.5.3/maven-release-plugin-2.5.3.jar (53 kB at 3.5 MB/s)
[WARNING] The POM for org.apache.maven.plugins:maven-release-plugin:jar:3.8.2 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.785 s
[INFO] Finished at: 2021-09-20T21:12:36+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-release-plugin:3.8.2 or one of its dependencies could not be resolved: org.apache.maven.plugins:maven-release-plugin:jar:3.8.2 was not found in http://localhost:8081/artifactory/first-libs-release during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
Build step 'Conditional steps (multiple)' marked build as failure
Finished: FAILURE
我的 pom.xml 下面:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.5.4</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
<artifactId>devops</artifactId>
<version>0.1.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>devops</name>
<description>DevOps demo project</description>
<properties>
<java.version>11</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
</dependencies>
<distributionManagement>
<repository>
<id>central</id>
<name>first-libs-release</name>
<url>http://localhost:8081/artifactory/first-libs-release</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<name>first-libs-snapshot</name>
<url>http://localhost:8081/artifactory/first-libs-snapshot</url>
</snapshotRepository>
</distributionManagement>
<scm>
<connection>scm:git:git@github.com:rahul-9911/devops.git</connection>
<developerConnection>scm:git:git@github.com:rahul-9911/devops.git</developerConnection>
<url>git@github.com:rahul-9911/devops.git</url>
<tag>HEAD</tag>
</scm>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>3.8.2</version>
<configuration>
<tagNameFormat>v@{project.version}</tagNameFormat>
<autoVersionSubmodules>true</autoVersionSubmodules>
</configuration>
</plugin>
</plugins>
</build>
</project>
解决方案
好的,终于找到问题了。maven-release-version 不正确。已经知道@khmarbaise 指出的那样,但是哪个?
经过一天的挣扎,我意识到被拉取的是 GIT 上的 pom.xml。这个有错误的版本3.8.2
所以我更正了 GIT 上的 POM.XML 并更正了发布版本。
终于成功了!!
推荐阅读
- android - Android数据绑定在打开其他应用后停止工作
- networking - 域控制器名称中可以使用句点(。)吗?
- c++ - 未使用 STL 向量分配被释放的指针(仅限 OS X)
- swift4 - 搜索过滤器未在集合视图中更新。当我键入一个值 A 时,它的资产在搜索中键入另一个值后显示
- c++ - 使用 Qt 的 RESTful API 请求
- elasticsearch - ElasticSearch 错误请求
- excel - 将 Excel 模板的 VBA 代码插入新工作簿后无法正常工作
- corda - custom logging does not works when set in systemProperties
- jsf - p:datatable 列的标题
- ansible - 进行模板复制时出现“目标目录不存在”错误