java - 升级到 3.1.1 后的 Maven-plugin-plugin default-descriptor 错误信息

标签 java maven plugins dependencies

我正在将系统的 Maven 运行时从 3.0.5 升级到 3.1.1,并尝试像往常一样使用 mvn clean install 构建我的项目。使用较旧的 Maven 运行时,构建总是会成功。但是,我现在在构建过程中总是收到此错误消息:

[ERROR] 无法执行目标 org.apache.maven.plugins:maven-plugin-plugin:3.2:descriptor (default-descriptor) on project XYZ: Execution default-descriptor of goal org.apache.maven .plugins:maven-plugin-plugin:3.2:descriptor failed: 48188 -> [帮助 1]

我认为可能是因为我的依赖项和插件已过时,所以我运行 mvn versions:use-latest-versions 来更新我的 pom.xml 版本。那仍然没有解决这个问题。有什么想法吗?


更新

应大众需求,这是我的 pom.xml 文件的样子。请注意,除了 Sitebricks 和 qdox 之外,所有依赖项和插件版本都由 mvn versions:use-latest-versions 更新,因为我不想将重大更改集成到我的项目中。

<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.my.company</groupId>
    <artifactId>my-own-project</artifactId>
    <version>1.0.1-SNAPSHOT</version>
    <name>My Cool Maven Plugin</name>
    <packaging>maven-plugin</packaging>
    <distributionManagement>
    <repository>
            <id>someID</id>
            <url>http://some.url.com</url>
    </repository>
    </distributionManagement>   
    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    </properties>
    <dependencies>
        <dependency>
        <groupId>org.freemarker</groupId>
        <artifactId>freemarker</artifactId>
        <version>2.3.20</version>
    </dependency>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-plugin-api</artifactId>
            <version>3.1.1</version>
        </dependency>
        <dependency>
            <groupId>org.codehaus.jackson</groupId>
            <artifactId>jackson-core-asl</artifactId>
            <version>1.9.11</version>
        </dependency>
        <dependency>
            <groupId>com.google.sitebricks</groupId>
            <artifactId>sitebricks</artifactId>
            <version>0.8.5</version>
        </dependency>
        <dependency>
            <groupId>com.thoughtworks.qdox</groupId>
            <artifactId>qdox</artifactId>
            <version>1.12</version>
        </dependency>
        <dependency>
        <groupId>org.testng</groupId>
        <artifactId>testng</artifactId>
        <version>6.8.7</version>
        <scope>test</scope>
    </dependency>
    </dependencies>
    <reporting>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>findbugs-maven-plugin</artifactId>
                <version>2.3.1</version>
                <configuration>
                    <effort>Max</effort>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>cobertura-maven-plugin</artifactId>
                <version>2.4</version>
            </plugin>
        </plugins>
    </reporting>
</project>

最佳答案

通过配置升级和使用以下依赖项解决了我的问题:

<plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-plugin-plugin</artifactId>
        <version>3.6.0</version>
        <configuration>
               <!-- see http://jira.codehaus.org/browse/MNG-5346 -->
               <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
        </configuration>
        <executions>
            <execution>
                <id>mojo-descriptor</id>
                <goals>
                    <goal>descriptor</goal>
                </goals>
            </execution>
        </executions>
      </plugin>

关于java - 升级到 3.1.1 后的 Maven-plugin-plugin default-descriptor 错误信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19662658/

相关文章:

java - jax-rs 客户端发布如何同时接收 JSON 和 Cookie?

java - 如何调试已安装的 eclipse 插件

maven - Spring Boot 应用程序未在 Tomcat 7 上启动

java - 如何基于 Google Cloud Endpoints 为 API 编写测试?

maven - 在 exec-maven-plugin 中将工作目录传递给 npm

javascript - iframe chrome 扩展加载速度慢

c# - 构建具有插件支持的应用程序

Java返回数组并删除最后一项?

java - 如何在intellij中使用java repl插件?

Java Swing 和 Postgres 用户身份验证 : Close old connection when new connection opened