gpt4 book ai didi

Maven 插件描述符未生成

转载 作者:行者123 更新时间:2023-12-02 11:23:09 25 4
gpt4 key购买 nike

我正在创建一个 Maven 插件,MVN 干净安装构建成功,但没有生成 plugin.xml。

@Mojo( name = "cover",  defaultPhase = LifecyclePhase.POST_INTEGRATION_TEST)
public class RunCoverage extends AbstractMojo
{

@Parameter( property = "cover.wadl", defaultValue = "test")
private String wadl;

@Parameter( property = "cover.endpoints",defaultValue = "test")
private String endpoints;

@Override
public void execute() throws MojoExecutionException
{
<somecode>
}
}

而 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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<artifactId>end-point-test-coverage</artifactId>
<version>1</version>
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
<version>3.2</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
<version>3.2</version>
<executions>
<execution>
<id>default-descriptor</id>
<goals>
<goal>descriptor</goal>
</goals>
<phase>process-classes</phase>
</execution>
<execution>
<id>help-descriptor</id>
<goals>
<goal>helpmojo</goal>
</goals>
<phase>process-classes</phase>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>
</project>

Maven 全新安装不会生成 plugin.xml

在依赖项目中使用时,出现以下错误

无法为 it.gruppopam.common:end-point-test-coverage:1 (/home/d/.m2/repository/it/common/end-point-test-coverage/1/end-point- test-coverage-1.jar):在 META-INF/maven/plugin.xml -> [Help 1] 中找不到插件描述符
[错误]

最佳答案

首先,我会尝试将包装类型设置为 maven-plugin而不是默认值 jar .此外,我建议使用更新版本的插件(maven-compiler-plugin:3.1)并使用更新版本的 maven-plugin-api(3.0?但不是 2.0)。

关于Maven 插件描述符未生成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20951893/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com