Maven-Tiles-Plugin:是否可以部分合并图块的配置?

问题描述

我找到了项目maven-tile-plugin,该项目提供了Maven Poms内部继承的组成。

背景:

由于现有项目的数量及其方面都在增长,因此我们需要简化项目。我们考虑使用父poms,这带来了一些缺点,因此我尝试了maven-tile-plugin。我可以描述一些完美的瓷砖。例如,使用jacoco插件执行代码覆盖等。

所有项目均具有以下一项或多项技术。 Kotlin,Spring,JPA,Postgres,MongoDB等。

将Spring与Kotlin结合需要使用all-open编译器插件,该插件可以在kotlin-maven-plugin中进行配置。此插件也可以具有few more <compilePlugin>,具体取决于需要在编译器级别进行哪些更改以使spring和kotlin兼容。

每个项目都有不同的需求。例如。 MongoDB不需要jpa编译器插件,该插件会更改类以使其与jpa兼容,因此我想使用此“面向特定方面”的插件一个mongodb安装程序只需要no-arg编译器插件

由于此配置位于插件中,因此我使用以下设置将一些切片切成薄片。

设置:

我目前的方法定义了多个图块,每个图块都使用不同的编译器插件。下面显示一个示例。

<plugins>
            <plugin>
                <!-- enables kotlin to be used with spring
                @see: https://kotlinlang.org/docs/reference/compiler-plugins.html -->
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-maven-plugin</artifactId>
                <configuration>
                    <args>
                        <arg>-Xjsr305=strict</arg>
                    </args>
                    <compilerPlugins>
                        <plugin>no-arg</plugin> <!-- ALL TILES ARE THE SAME EXCEPT THIS LINE e.g all-open/no-arg/jpa -->
                    </compilerPlugins>
                </configuration>
                <!-- specify sources for compile -->
                <executions>
                    <execution>
                        <id>compile</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>test-compile</id>
                        <phase>test-compile</phase>
                        <goals>
                            <goal>test-compile</goal>
                        </goals>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>org.jetbrains.kotlin</groupId>
                        <artifactId>kotlin-maven-noarg</artifactId>
                        <version>${kotlin.version}</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>

目标:

我的目标是启用磁贴,说

            <plugin>
                <groupId>io.repaint.maven</groupId>
                <artifactId>tiles-maven-plugin</artifactId>
                <version>2.17</version>
                <extensions>true</extensions>
                <configuration>
                    <filtering>false</filtering>
                    <tiles>
<!-- Starting relevant configurations  -->
                        <tile>com.company.tiles:kotlin-maven-compile-no-arg:0.0.1-SNAPSHOT</tile>
                        <tile>com.company.tiles:kotlin-maven-compile-all-open:0.0.1-SNAPSHOT</tile>
<!-- Ending relevant configuration  -->
                        ... imagine other tiles here
</tiles>
                </configuration>
            </plugin>

行为:

使用我当前的方法,每次迭代总是使用“最后找到的图块”。

问题:

是否可以按我的意愿将那些插件配置分开?

我错过了某种合并功能吗? 还有其他想法吗?

谢谢

丹尼斯

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)