Skip to content

Commit aab8233

Browse files
committed
infra: clean up build goals
* 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
1 parent 2c221ea commit aab8233

File tree

1 file changed

+47
-21
lines changed

1 file changed

+47
-21
lines changed

pom.xml

Lines changed: 47 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -137,27 +137,6 @@
137137
</environments>
138138
</configuration>
139139
</plugin>
140-
<plugin>
141-
<groupId>org.codehaus.mojo</groupId>
142-
<artifactId>exec-maven-plugin</artifactId>
143-
<executions>
144-
<execution>
145-
<phase>verify</phase>
146-
<goals>
147-
<goal>exec</goal>
148-
</goals>
149-
</execution>
150-
</executions>
151-
<configuration>
152-
<executable>git</executable>
153-
<arguments>
154-
<argument>diff</argument>
155-
<argument>HEAD~1</argument>
156-
<argument>HEAD</argument>
157-
</arguments>
158-
<outputFile>${maven.multiModuleProjectDirectory}/show.patch</outputFile>
159-
</configuration>
160-
</plugin>
161140
<plugin>
162141
<artifactId>maven-checkstyle-plugin</artifactId>
163142
<executions>
@@ -294,6 +273,13 @@
294273
<generate>true</generate>
295274
</sourceReferences>
296275
</configuration>
276+
<executions>
277+
<!-- disable default goal for consumer POMs, we don't need that -->
278+
<execution>
279+
<id>default-update-consumer-pom</id>
280+
<phase>none</phase>
281+
</execution>
282+
</executions>
297283
</plugin>
298284
<plugin>
299285
<groupId>org.eclipse.tycho</groupId>
@@ -513,4 +499,44 @@
513499
</plugins>
514500
</pluginManagement>
515501
</build>
502+
<profiles>
503+
<profile>
504+
<id>git-patch</id>
505+
<!-- This POM is both parent and reactor, therefore all plugins in the build section will be executed for all modules.
506+
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.
507+
TODO: In the long run, we should probably split parent and reactor into 2 POM files instead. -->
508+
<activation>
509+
<file>
510+
<exists>README.md</exists>
511+
</file>
512+
</activation>
513+
<build>
514+
<plugins>
515+
<plugin>
516+
<groupId>org.codehaus.mojo</groupId>
517+
<artifactId>exec-maven-plugin</artifactId>
518+
<executions>
519+
<execution>
520+
<id>create-git-patch-file</id>
521+
<!-- must be earlier than the phase we bind the checkstyle goal to -->
522+
<phase>package</phase>
523+
<goals>
524+
<goal>exec</goal>
525+
</goals>
526+
</execution>
527+
</executions>
528+
<configuration>
529+
<executable>git</executable>
530+
<arguments>
531+
<argument>diff</argument>
532+
<argument>HEAD~1</argument>
533+
<argument>HEAD</argument>
534+
</arguments>
535+
<outputFile>${maven.multiModuleProjectDirectory}/show.patch</outputFile>
536+
</configuration>
537+
</plugin>
538+
</plugins>
539+
</build>
540+
</profile>
541+
</profiles>
516542
</project>

0 commit comments

Comments
 (0)