将 GMaven 迁移到 GMavenPlus 时替代 scriptPath

Alternative to scriptPath when migrating GMaven to GMavenPlus

我正在将使用 GMaven plugin to GMavenPlus 和 运行 的遗留 Maven 构建迁移到我不知道如何调用外部 Groovy 类 的问题我的 Groovy 脚本中的本地源文件夹。

这是我之前的设置:

<execution>
    <id>process-static-content</id>
    <goals>
        <goal>execute</goal>
    </goals>
    <phase>process-resources</phase>
    <configuration>

        <scriptpath>
            <element>${pom.basedir}/src/main/some-local-path</element>
        </scriptpath>
        <source>
            // call class from scriptpath that needs access
            // to Maven internals
            new SomeClassFromTheAboveFolder(project, log).run();
        </source>
    </configuration>
</execution>

<source> 更改为 <scripts><script> 是显而易见的,但据我所知,<script> 块只能包含本地 groovy 代码或文件脚本的路径,但都不能帮助我实现上述使用模式。

任何人都可以提供见解吗?

因此,您想要向 GMavenPlus 的类路径添加额外的 Groovy 源,因为这些访问 类 在调用 GMavenPlus 的生命周期中不属于 Maven 项目(例如可能是您需要在 generate-test-sources 阶段访问的集成测试 类。

你是对的,目前没有机制来完成这个(因为我根本没有考虑过这种情况)。但我很乐意添加它。我已经打开 #66 以添加此功能。