|
54 | 54 | </scm> |
55 | 55 |
|
56 | 56 | <properties> |
| 57 | + <javaVersion>1.7</javaVersion> |
57 | 58 | <projectOwner>John Casey</projectOwner> |
58 | 59 | <projectEmail>jdcasey@commonjava.org</projectEmail> |
59 | 60 | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
|
74 | 75 | <version.plugin.install>2.4</version.plugin.install> |
75 | 76 | <version.plugin.resources>2.6</version.plugin.resources> |
76 | 77 | <version.plugin.site>3.3</version.plugin.site> |
| 78 | + |
| 79 | + <skipIllegalTransitiveEnforcement>false</skipIllegalTransitiveEnforcement> |
| 80 | + <enforceManagedDeps>true</enforceManagedDeps> |
| 81 | + |
| 82 | + <unEnforcedPlugins>org.eclipse.m2e:lifecycle-mapping</unEnforcedPlugins> |
| 83 | + <enforcedMavenVersion>(,2.1.0),(2.1.0,2.2.0),(2.2.0,)</enforcedMavenVersion> |
| 84 | + <enforcedJavaVersion>${javaVersion}</enforcedJavaVersion> |
| 85 | + |
| 86 | + <enforceBestPractices>true</enforceBestPractices> |
| 87 | + <enforceStandards>true</enforceStandards> |
| 88 | + <enforceVersions>true</enforceVersions> |
| 89 | + <enforceTripHazards>true</enforceTripHazards> |
77 | 90 | </properties> |
78 | 91 |
|
79 | 92 | <build> |
|
83 | 96 | <artifactId>maven-compiler-plugin</artifactId> |
84 | 97 | <version>${version.plugin.compiler}</version> |
85 | 98 | <configuration> |
86 | | - <source>1.7</source> |
87 | | - <target>1.7</target> |
| 99 | + <source>${javaVersion}</source> |
| 100 | + <target>${javaVersion}</target> |
88 | 101 | </configuration> |
89 | 102 | </plugin> |
90 | 103 | <plugin> |
|
178 | 191 | <artifactId>illegal-transitive-dependency-check</artifactId> |
179 | 192 | <version>1.7.4</version> |
180 | 193 | </dependency> |
181 | | - <dependency> |
182 | | - <groupId>com.redhat.victims</groupId> |
183 | | - <artifactId>enforce-victims-rule</artifactId> |
184 | | - <version>1.3.4</version> |
185 | | - </dependency> |
186 | 194 | </dependencies> |
187 | 195 | <executions> |
| 196 | + <execution> |
| 197 | + <id>avoid-trip-hazards</id> |
| 198 | + <goals> |
| 199 | + <goal>enforce</goal> |
| 200 | + </goals> |
| 201 | + <phase>initialize</phase> |
| 202 | + <rules> |
| 203 | + <fail>${enforceTripHazards}</fail> |
| 204 | + <requireSameVersions> |
| 205 | + <dependencies> |
| 206 | + <dependency>${project.groupId}*</dependency> |
| 207 | + </dependencies> |
| 208 | + </requireSameVersions> |
| 209 | + </rules> |
| 210 | + </execution> |
| 211 | + <execution> |
| 212 | + <id>enforce-commonjava-standards</id> |
| 213 | + <goals> |
| 214 | + <goal>enforce</goal> |
| 215 | + </goals> |
| 216 | + <phase>initialize</phase> |
| 217 | + <configuration> |
| 218 | + <fail>${enforceStandards}</fail> |
| 219 | + <rules> |
| 220 | + <requireManagedDeps implementation="org.commonjava.maven.enforcer.rule.EnforceManagedDepsRule"> |
| 221 | + <!-- <message>Capture dependencies in top-level dependencyManagement section for easy reference.</message> --> |
| 222 | + <checkProfiles>false</checkProfiles> |
| 223 | + <failOnViolation>${managedDepEnforcement-fail}</failOnViolation> |
| 224 | + </requireManagedDeps> |
| 225 | + <illegalTransitiveDependencyCheck implementation="de.is24.maven.enforcer.rules.IllegalTransitiveDependencyCheck"> |
| 226 | + <reportOnly>${illegalTransitivesEnforcement-reportOnly}</reportOnly> |
| 227 | + <regexIgnoredClasses> |
| 228 | + <regexIgnoredClass>com\.sun\.net\.httpserver\..+</regexIgnoredClass> |
| 229 | + <regexIgnoredClass>javax\..+</regexIgnoredClass> |
| 230 | + <regexIgnoredClass>org\.w3c\.dom\..+</regexIgnoredClass> |
| 231 | + <regexIgnoredClass>org\.xml\.sax\..+</regexIgnoredClass> |
| 232 | + </regexIgnoredClasses> |
| 233 | + <useClassesFromLastBuild>true</useClassesFromLastBuild> |
| 234 | + </illegalTransitiveDependencyCheck> |
| 235 | + </rules> |
| 236 | + </configuration> |
| 237 | + </execution> |
188 | 238 | <execution> |
189 | 239 | <id>enforce-best-practices</id> |
190 | 240 | <goals> |
191 | 241 | <goal>enforce</goal> |
192 | 242 | </goals> |
193 | 243 | <phase>initialize</phase> |
194 | 244 | <configuration> |
| 245 | + <fail>${enforceBestPractices}</fail> |
195 | 246 | <rules> |
196 | 247 | <requireManagedDeps implementation="org.commonjava.maven.enforcer.rule.EnforceManagedDepsRule"> |
197 | 248 | <!-- <message>Capture dependencies in top-level dependencyManagement section for easy reference.</message> --> |
198 | 249 | <checkProfiles>false</checkProfiles> |
199 | | - <failOnViolation>true</failOnViolation> |
| 250 | + <failOnViolation>${managedDepEnforcement-fail}</failOnViolation> |
200 | 251 | </requireManagedDeps> |
201 | 252 | <!-- |
202 | 253 | <dependencyConvergence /> |
203 | 254 | --> |
204 | 255 | <reactorModuleConvergence /> |
| 256 | + <requireNoRepositories /> |
205 | 257 | <requirePluginVersions> |
206 | 258 | <banLatest /> |
207 | 259 | <banRelease /> |
208 | 260 | <banSnapshots /> |
209 | | - <unCheckedPluginList>org.eclipse.m2e:lifecycle-mapping</unCheckedPluginList> |
| 261 | + <unCheckedPluginList>${unEnforcedPlugins}</unCheckedPluginList> |
210 | 262 | </requirePluginVersions> |
211 | 263 | <illegalTransitiveDependencyCheck implementation="de.is24.maven.enforcer.rules.IllegalTransitiveDependencyCheck"> |
212 | | - <reportOnly>false</reportOnly> |
| 264 | + <reportOnly>${illegalTransitivesEnforcement-reportOnly}</reportOnly> |
213 | 265 | <regexIgnoredClasses> |
214 | 266 | <regexIgnoredClass>com\.sun\.net\.httpserver\..+</regexIgnoredClass> |
215 | 267 | <regexIgnoredClass>javax\..+</regexIgnoredClass> |
|
218 | 270 | </regexIgnoredClasses> |
219 | 271 | <useClassesFromLastBuild>true</useClassesFromLastBuild> |
220 | 272 | </illegalTransitiveDependencyCheck> |
221 | | - <victimsCheck implementation="com.redhat.victims.VictimsRule"> |
222 | | - <!-- |
223 | | - Check the project's dependencies against the database using |
224 | | - name and version. The default mode for this is 'warning'. |
225 | | -
|
226 | | - Valid options are: |
227 | | -
|
228 | | - disabled: Rule is still run but only INFO level messages aand no errors. |
229 | | - warning : Rule will spit out a warning message but doesn't result in a failure. |
230 | | - fatal : Rule will spit out an error message and fail the build. |
231 | | - --> |
232 | | - <metadata>warning</metadata> |
233 | | - <!-- |
234 | | - Check the project's dependencies against the database using |
235 | | - the SHA-512 checksum of the artifact. The default is fatal. |
236 | | -
|
237 | | - Valid options are: |
238 | | -
|
239 | | - disabled: Rule is still run but only INFO level messages aand no errors. |
240 | | - warning : Rule will spit out a warning message but doesn't result in a failure. |
241 | | - fatal : Rule will spit out an error message and fail the build. |
242 | | - --> |
243 | | - <fingerprint>fatal</fingerprint> |
244 | | - <!-- |
245 | | - Disables the synchronization mechansim. By default the rule will |
246 | | - attempt to update the database for each build. |
247 | | -
|
248 | | - Valid options are: |
249 | | -
|
250 | | - auto : Automatically update the database entries on each build. |
251 | | - daily : Update the database entries once per day. |
252 | | - weekly: Update the database entries once per week. |
253 | | - offline : Disable the synchronization mechanism. |
254 | | - --> |
255 | | - <updates>auto</updates> |
256 | | - </victimsCheck> |
257 | 273 | </rules> |
258 | 274 | </configuration> |
259 | 275 | </execution> |
260 | 276 | <execution> |
261 | | - <id>enforce-maven</id> |
| 277 | + <id>enforce-versions</id> |
262 | 278 | <goals> |
263 | 279 | <goal>enforce</goal> |
264 | 280 | </goals> |
265 | 281 | <configuration> |
| 282 | + <fail>${enforceVersions}</fail> |
266 | 283 | <rules> |
267 | 284 | <requireMavenVersion> |
268 | | - <version>(,2.1.0),(2.1.0,2.2.0),(2.2.0,)</version> |
269 | | - <message>Maven 2.1.0 and 2.2.0 produce incorrect GPG signatures and checksums respectively.</message> |
| 285 | + <version>${enforcedMavenVersion}</version> |
270 | 286 | </requireMavenVersion> |
| 287 | + <requireJavaVersion> |
| 288 | + <version>${enforcedJavaVersion}</version> |
| 289 | + </requireJavaVersion> |
271 | 290 | </rules> |
272 | 291 | </configuration> |
273 | 292 | </execution> |
|
0 commit comments