6

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

[ERROR] Failed to execute goal 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 -> [Help 1]

我想可能是因为我的依赖项和插件过时了,所以我跑去mvn versions:use-latest-versions更新我的 pom.xml 版本。那仍然没有解决这个问题。有任何想法吗?


更新

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

<?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>
4

2 回答 2

4

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

<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>
于 2020-06-10T00:37:38.487 回答
2

我遇到了完全相同的问题,并尝试了可能重复的Basic maven 插件项目中提供的所有提示不起作用,Mojo 插件描述符未生成,但没有任何效果。最终结果是由其他一些第 3 方模块使用的旧版本2.6.1的库com.ibm.icu:icu4j负责。我完全摆脱了icu4j依赖,之后 maven-plugin-plugin 运行没有问题。

于 2016-04-13T15:21:22.833 回答