从中央仓库下载后,maven自定义插件无法正常工作

时间:2014-05-24 17:38:40

标签: java maven

我已经创建了自定义插件(http://search.maven.org/remotecontent?filepath=sk/lukasvasek/project-version-dategenerator-mvn/0.0.001/project-version-dategenerator-mvn-0.0.001.pom)。当我在本地安装它(mvn install)时,我可以使用目标dateversionoverrider来解决问题。 Hovewer当我从maven central repo下载这个插件时,我收到了错误:

[错误]无法在插件sk.lukasvasek中找到目标'dateversionoverrider':project-version-dategenerator-mvn:0.0.001可用目标

我错过了什么?

提前致谢

1 个答案:

答案 0 :(得分:0)

确定问题出现在描述符中,所以我将其更改为下面的代码并且可以正常工作。

<plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-plugin-plugin</artifactId>
            <version>3.2</version>
            <configuration>
                <goalPrefix>project-version-dategenerator</goalPrefix>
            </configuration>
            <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>