Skip to content

Commit a9340bc

Browse files
BananeweizenCalixte
authored andcommitted
Infra: more strict/reproducible Maven builds
* add more Maven enforcer rules * pin versions of all required default Maven plugins instead of relying on Maven super POM * add maven-versions-plugin to plugin management, because that is used to verify and upgrade all these versions * exclude more maven plugins from m2e execution, they are not needed for the eclipse build * have all m2e lifecycle mappings in the parent pom, not in child modules
1 parent 580835b commit a9340bc

File tree

3 files changed

+79
-42
lines changed

3 files changed

+79
-42
lines changed

net.sf.eclipsecs-updatesite/pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@
132132
<plugin>
133133
<groupId>org.eclipse.tycho.extras</groupId>
134134
<artifactId>tycho-eclipserun-plugin</artifactId>
135-
<version>${tycho-version}</version>
136135
<configuration>
137136
<repositories>
138137
<repository>

net.sf.eclipsecs.doc/pom.xml

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -120,36 +120,5 @@
120120
</executions>
121121
</plugin>
122122
</plugins>
123-
124-
<pluginManagement>
125-
<plugins>
126-
<!-- Exclude the "copy-resources" goal from m2e execution, as it interferes with resource filtering
127-
(i.e. ${buildQualifier} in update site resources is not properly expanded).-->
128-
<plugin>
129-
<groupId>org.eclipse.m2e</groupId>
130-
<artifactId>lifecycle-mapping</artifactId>
131-
<version>1.0.0</version>
132-
<configuration>
133-
<lifecycleMappingMetadata>
134-
<pluginExecutions>
135-
<pluginExecution>
136-
<pluginExecutionFilter>
137-
<groupId>org.apache.maven.plugins</groupId>
138-
<artifactId>maven-resources-plugin</artifactId>
139-
<versionRange>[1.0.0,)</versionRange>
140-
<goals>
141-
<goal>copy-resources</goal>
142-
</goals>
143-
</pluginExecutionFilter>
144-
<action>
145-
<ignore />
146-
</action>
147-
</pluginExecution>
148-
</pluginExecutions>
149-
</lifecycleMappingMetadata>
150-
</configuration>
151-
</plugin>
152-
</plugins>
153-
</pluginManagement>
154123
</build>
155124
</project>

pom.xml

Lines changed: 79 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -206,11 +206,55 @@
206206
<artifactId>maven-antrun-plugin</artifactId>
207207
<version>3.1.0</version>
208208
</plugin>
209+
<plugin>
210+
<artifactId>maven-failsafe-plugin</artifactId>
211+
<version>2.22.2</version>
212+
</plugin>
213+
<plugin>
214+
<artifactId>maven-install-plugin</artifactId>
215+
<version>3.1.0</version>
216+
</plugin>
217+
<plugin>
218+
<artifactId>maven-site-plugin</artifactId>
219+
<version>3.12.0</version>
220+
</plugin>
209221
<plugin>
210222
<groupId>com.googlecode.maven-download-plugin</groupId>
211223
<artifactId>download-maven-plugin</artifactId>
212224
<version>1.6.8</version>
213225
</plugin>
226+
<plugin>
227+
<groupId>org.eclipse.tycho</groupId>
228+
<artifactId>tycho-compiler-plugin</artifactId>
229+
<version>${tycho-version}</version>
230+
</plugin>
231+
<plugin>
232+
<groupId>org.eclipse.tycho</groupId>
233+
<artifactId>tycho-ds-plugin</artifactId>
234+
<version>${tycho-version}</version>
235+
<executions>
236+
<execution>
237+
<id>default-declarative-services</id>
238+
<!-- disable goal execution which is bound to default lifecycle -->
239+
<phase>none</phase>
240+
</execution>
241+
</executions>
242+
</plugin>
243+
<plugin>
244+
<groupId>org.eclipse.tycho.extras</groupId>
245+
<artifactId>tycho-eclipserun-plugin</artifactId>
246+
<version>${tycho-version}</version>
247+
</plugin>
248+
<plugin>
249+
<groupId>org.eclipse.tycho</groupId>
250+
<artifactId>tycho-p2-publisher-plugin</artifactId>
251+
<version>${tycho-version}</version>
252+
</plugin>
253+
<plugin>
254+
<groupId>org.eclipse.tycho</groupId>
255+
<artifactId>tycho-surefire-plugin</artifactId>
256+
<version>${tycho-version}</version>
257+
</plugin>
214258
<plugin>
215259
<groupId>org.eclipse.tycho</groupId>
216260
<artifactId>tycho-packaging-plugin</artifactId>
@@ -349,9 +393,12 @@
349393
</goals>
350394
<configuration>
351395
<rules>
396+
<banDuplicatePomDependencyVersions/>
397+
<requireExplicitDependencyScope/>
352398
<requireMavenVersion>
353399
<version>3.6.3</version>
354400
</requireMavenVersion>
401+
<requirePluginVersions/>
355402
<requireReleaseDeps>
356403
<excludes>
357404
<exclude>net.sf.eclipsecs:*</exclude>
@@ -380,7 +427,9 @@
380427
<artifactId>build-helper-maven-plugin</artifactId>
381428
<version>3.3.0</version>
382429
</plugin>
383-
<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
430+
<!-- This plugin's configuration is used to silence Eclipse M2E warnings for
431+
Maven goals that cannot be mapped to the Eclipse build lifecycle.
432+
It has no influence on the Maven build itself. -->
384433
<plugin>
385434
<groupId>org.eclipse.m2e</groupId>
386435
<artifactId>lifecycle-mapping</artifactId>
@@ -391,28 +440,42 @@
391440
<pluginExecution>
392441
<pluginExecutionFilter>
393442
<groupId>org.apache.maven.plugins</groupId>
394-
<artifactId>maven-resources-plugin</artifactId>
395-
<versionRange>[2.4.3,)</versionRange>
443+
<artifactId>maven-clean-plugin</artifactId>
444+
<versionRange>[1.0.0,)</versionRange>
396445
<goals>
397-
<goal>resources</goal>
398-
<goal>testResources</goal>
446+
<goal>clean</goal>
399447
</goals>
400448
</pluginExecutionFilter>
401449
<action>
402-
<ignore></ignore>
450+
<ignore/>
403451
</action>
404452
</pluginExecution>
405453
<pluginExecution>
406454
<pluginExecutionFilter>
407455
<groupId>org.apache.maven.plugins</groupId>
408-
<artifactId>maven-clean-plugin</artifactId>
409-
<versionRange>[2.5,)</versionRange>
456+
<artifactId>maven-enforcer-plugin</artifactId>
457+
<versionRange>[1.0.0,)</versionRange>
410458
<goals>
411-
<goal>clean</goal>
459+
<goal>enforce</goal>
412460
</goals>
413461
</pluginExecutionFilter>
414462
<action>
415-
<ignore></ignore>
463+
<ignore/>
464+
</action>
465+
</pluginExecution>
466+
<pluginExecution>
467+
<pluginExecutionFilter>
468+
<groupId>org.apache.maven.plugins</groupId>
469+
<artifactId>maven-resources-plugin</artifactId>
470+
<versionRange>[1.0.0,)</versionRange>
471+
<goals>
472+
<goal>copy-resources</goal>
473+
<goal>resources</goal>
474+
<goal>testResources</goal>
475+
</goals>
476+
</pluginExecutionFilter>
477+
<action>
478+
<ignore/>
416479
</action>
417480
</pluginExecution>
418481
<pluginExecution>
@@ -432,6 +495,12 @@
432495
</lifecycleMappingMetadata>
433496
</configuration>
434497
</plugin>
498+
<!-- used to automatically find updates of maven plugins and dependencies -->
499+
<plugin>
500+
<groupId>org.codehaus.mojo</groupId>
501+
<artifactId>versions-maven-plugin</artifactId>
502+
<version>2.15.0</version>
503+
</plugin>
435504
</plugins>
436505
</pluginManagement>
437506
</build>

0 commit comments

Comments
 (0)