RunedUniverse / r4m-maven-extension

Runes4Maven (r4m) Maven Extension provides an alternative way for defining maven executions
Apache License 2.0
4 stars 1 forks source link

Bug: Plugin <configuration> missing on active Profile #5

Closed VenaNocta closed 1 year ago

VenaNocta commented 1 year ago

Plugin configuration doesn't get implemented when injecting with active profiles.

VenaNocta commented 1 year ago

Why does it happen / difference to maven default

This Bug is an unintended side effect of cutting out and moving goal activations from pom executions to pem. As such all default executions don't get generated either. The Example below shows the maven default - so if you left out the execution definition in the first place it would also ignore the basic configuration. But only when the goal is launched via lifecycle, on the other hand should you run it explicitly the basic configuration will be used!

Fix

This behavior will be reimplemented with a flag to disable it - should one wish to use strict maven behavior

Edit: added flags

<r4m.generate-plugin-executions />
<r4m.generate-plugin-executions-on-fork />

Example

<profile>
    <id>dev-install</id>
    <build>
        <defaultGoal>clean dev/+install</defaultGoal>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-toolchains-plugin</artifactId>
                <configuration>
                    <toolchains>
                        <jdk>
                            <version>openjdk-1.8.0</version>
                        </jdk>
                    </toolchains>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>toolchain</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>pipeline</id>
                        <goals>
                            <goal>toolchain</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</profile>

GENERATES / EQUALS

<profile>
    <id>dev-install</id>
    <build>
        <defaultGoal>clean dev/+install</defaultGoal>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-toolchains-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>toolchain</goal>
                        </goals>
                        <configuration>
                            <toolchains>
                                <jdk>
                                    <version>openjdk-1.8.0</version>
                                </jdk>
                            </toolchains>
                        </configuration>
                    </execution>
                    <execution>
                        <id>pipeline</id>
                        <goals>
                            <goal>toolchain</goal>
                        </goals>
                        <configuration>
                            <toolchains>
                                <jdk>
                                    <version>openjdk-1.8.0</version>
                                </jdk>
                            </toolchains>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</profile>