Force oparent users to use release dependencies 23/8923/2
authorAnaël Closson <ac2550@intl.att.com>
Mon, 28 Aug 2017 13:43:22 +0000 (15:43 +0200)
committerAnaël Closson <ac2550@intl.att.com>
Mon, 28 Aug 2017 14:36:41 +0000 (14:36 +0000)
This patch adds an enforcer to force users of oparent as parent to use release
versions of artifacts.

Current rules are quite loose to avoid breaking too much project.

Following options might be removed when needed :
 <failWhenParentIsSnapshot> : when at least oparent changes its version
 <onlyWhenRelease> : when most project have removed their snapshot dependencies

Change-Id: I1f9824557c5bbaae9f4a1378c3bc223edd4b5da4
Issue-id: INT-122
Signed-off-by: Anaël Closson <ac2550@intl.att.com>
pom.xml

diff --git a/pom.xml b/pom.xml
index ab67a2f..cc9da52 100644 (file)
--- a/pom.xml
+++ b/pom.xml
             </dependency>
           </dependencies>
         </plugin>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-enforcer-plugin</artifactId>
+          <version>3.0.0-M1</version>
+          <executions>
+            <execution>
+              <id>enforce-no-snapshots</id>
+              <goals>
+                <goal>enforce</goal>
+              </goals>
+              <configuration>
+                <rules>
+                  <requireReleaseDeps>
+                    <failWhenParentIsSnapshot>false</failWhenParentIsSnapshot>
+                    <onlyWhenRelease>true</onlyWhenRelease>
+                  </requireReleaseDeps>
+                </rules>
+              </configuration>
+            </execution>
+          </executions>
+        </plugin>
         <plugin>
           <groupId>org.codehaus.mojo</groupId>
           <artifactId>versions-maven-plugin</artifactId>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-site-plugin</artifactId>
       </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-enforcer-plugin</artifactId>
+      </plugin>
       <plugin>
         <groupId>org.codehaus.mojo</groupId>
         <artifactId>versions-maven-plugin</artifactId>