Skip to content

Commit

Permalink
Simplify patch creation
Browse files Browse the repository at this point in the history
Revert most of aab8233. Instead of
using a profile, just add <inherited>false</inherited> to the plugin
execution we don't want in the child modules.
  • Loading branch information
Bananeweizen committed Dec 23, 2024
1 parent fab3688 commit 7010da7
Showing 1 changed file with 23 additions and 40 deletions.
63 changes: 23 additions & 40 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,29 @@
</environments>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<id>create-git-patch-file</id>
<phase>verify</phase>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
<configuration>
<executable>git</executable>
<arguments>
<argument>diff</argument>
<argument>HEAD~1</argument>
<argument>HEAD</argument>
</arguments>
<outputFile>${maven.multiModuleProjectDirectory}/show.patch</outputFile>
</configuration>
<inherited>false</inherited>
</plugin>
<plugin>
<artifactId>maven-checkstyle-plugin</artifactId>
<executions>
Expand Down Expand Up @@ -517,44 +540,4 @@
</plugins>
</pluginManagement>
</build>
<profiles>
<profile>
<id>git-patch</id>
<!-- This POM is both parent and reactor, therefore all plugins in the build section will be executed for all modules.
By checking for the existence of the README, we limit the execution of this profile to the parent only, thereby creating the patch only once.
TODO: In the long run, we should probably split parent and reactor into 2 POM files instead. -->
<activation>
<file>
<exists>README.md</exists>
</file>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<id>create-git-patch-file</id>
<!-- must be earlier than the phase we bind the checkstyle goal to -->
<phase>package</phase>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
<configuration>
<executable>git</executable>
<arguments>
<argument>diff</argument>
<argument>HEAD~1</argument>
<argument>HEAD</argument>
</arguments>
<outputFile>${maven.multiModuleProjectDirectory}/show.patch</outputFile>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

0 comments on commit 7010da7

Please sign in to comment.