java - maven-plugin-plugin:3.3:descriptor failed.: 更新 maven-core 时出现 RuntimeException
问题描述
我正在升级 maven 和一些过去可以工作的 maven 依赖项,但升级后我得到了 RuntimeException。
我已经从我的 maven 插件中删除了逻辑,所以它是纯 apache maven 代码而不是我自己的:
import org.apache.maven.lifecycle.mapping.LifecyclePhase;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugins.annotations.Mojo;
@Mojo(name = "hello", requiresProject = true, defaultPhase = LifecyclePhase.PROCESS_RESOURCES)
public class HelloMojo extends AbstractMojo {
public void execute() throws MojoExecutionException {
System.out.println("Hello There!");
}
}
我目前有以下工作正常的 pom 文件:
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>hello-maven-plugin</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>maven-plugin</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<!-- Changing this to 3.5.4 works -->
<version>3.6.3</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
<version>3.3</version>
<configuration>
<skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
</configuration>
</plugin>
</plugins>
</build>
</project>
但是在执行 a 之后,mvn versions:use-latest-versions
它会更新 maven-core,并且 3.6.0+ 版本的所有内容在执行 a 时都会导致以下错误mvn install
:
[INFO] --- maven-plugin-plugin:3.3:descriptor (default-descriptor) @ hello-maven-plugin ---
[WARNING] Using platform encoding (Cp1252 actually) to read mojo metadata, i.e. build is platform dependent!
[INFO] Applying mojo extractor for language: java
[INFO] Mojo extractor for language: java found 0 mojo descriptors.
[INFO] Applying mojo extractor for language: bsh
[INFO] Mojo extractor for language: bsh found 0 mojo descriptors.
[INFO] Applying mojo extractor for language: java-annotations
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.110 s
[INFO] Finished at: 2020-03-16T16:30:04-04:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-plugin-plugin:3.3:descriptor (default-descriptor) on project hello-maven-plugin: Execution default-descriptor of goal org.apache.maven.plugins:maven-plugin-plugin:3.3:descriptor failed.: RuntimeException -> [Help 1]
升级到 maven core 3.6.3 时,我还需要更改什么吗?
解决方案
推荐阅读
- laravel - Laravel 验证不适用于许多字段
- typescript - 在 create-react-app 弹出后编辑 webpack 输入字段
- git - 运行本地 git 服务器,并使用 Visual Studio 连接到它
- c# - 使用 C# Pidgin 的 MIPS 解析器,无法解析一系列事物
- python - 将一个数据框中的行排序到另一个数据框的列中
- python - 为什么我不能用 openpyxl 编辑我的 .xlsx 文件?
- android - EditText.getText().toString() 没有返回当前值
- php - Laravel 过滤结果基于 post 的查询
- javascript - 模数和余数在 Scheme 中应该如何工作?
- python - 如何修复递归倒计时 python 函数的代码,使其仅打印“LIFT OFF!” 一次?