0

groovy を使用して Maven プラグインを作成しようとしています。groovy バージョン 1.8 以降を使用したいと考えています。

私はこれらの指示に従いましたが、使用するとうまくいきました:

<groupId>org.codehaus.groovy.maven</groupId>
<artifactId>gmaven-plugin</artifactId>
<version>1.0-rc-4</version>

これでプラグインがビルドされ、他のプロジェクトで使用できるようになりました。

ただし、これにより古いバージョンの groovy (1.5.7) が提供されます。新しいバージョンに切り替えるために、新しいバージョンと providerSelection を使用してみました:

<plugin>
    <groupId>org.codehaus.gmaven</groupId>
    <artifactId>gmaven-plugin</artifactId>
    <version>1.5</version>
    <executions>
        <execution>
            <goals>
                <goal>generateStubs</goal>
                <goal>compile</goal>
                <goal>generateTestStubs</goal>
                <goal>testCompile</goal>
            </goals>
            <configuration>
                <providerSelection>1.8</providerSelection>
            </configuration>
        </execution>
    </executions>
    <dependencies>
        <dependency>
            <groupId>org.codehaus.gmaven.runtime</groupId>
            <artifactId>gmaven-runtime-1.8</artifactId>
            <version>1.5</version>
            <exclusions>
                <exclusion>
                    <groupId>org.codehaus.groovy</groupId>
                    <artifactId>groovy-all</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.codehaus.groovy</groupId>
            <artifactId>groovy-all</artifactId>
            <version>1.8.0</version>
            <scope>compile</scope> 
        </dependency>
    </dependencies>
</plugin>

しかし、プラグインをビルドすると、次の警告が表示されます。

[WARNING] Deprecation Alert:
[WARNING] No mojo descriptors were found in this project which has a packaging type of maven-plugin.
[WARNING] In future versions of the plugin tools, this will fail the build.
[WARNING] If this project is an archetype, change the packaging type from maven-plugin to maven-archetype.

また、プラグインを使用しようとすると、maven はプラグインをまったく呼び出しません。これは、プラグイン記述子が不足しているためだと思います。

バージョン 1.8 以降の groovy を使用して Maven プラグインを正常に構築できた人はいますか?

PS: gmaven の代わりにgroovy-eclipse-compilerプラグインも調べましたが、常に上記の警告が表示されるようです。

4

1 に答える 1