Skip to content

Commit

Permalink
infra: clean up build goals
Browse files Browse the repository at this point in the history
* disable a tycho goal which we don't need
* give the patch creation goal a name, and restrict it to be executed
only once, not for each maven module
  • Loading branch information
Bananeweizen committed Jan 21, 2024
1 parent 2c221ea commit aab8233
Showing 1 changed file with 47 additions and 21 deletions.
68 changes: 47 additions & 21 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -137,27 +137,6 @@
</environments>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<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>
</plugin>
<plugin>
<artifactId>maven-checkstyle-plugin</artifactId>
<executions>
Expand Down Expand Up @@ -294,6 +273,13 @@
<generate>true</generate>
</sourceReferences>
</configuration>
<executions>
<!-- disable default goal for consumer POMs, we don't need that -->
<execution>
<id>default-update-consumer-pom</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
Expand Down Expand Up @@ -513,4 +499,44 @@
</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 aab8233

Please sign in to comment.