Warn project for outdated dependencies 21/8921/2
authorAnaël Closson <ac2550@intl.att.com>
Mon, 28 Aug 2017 13:35:58 +0000 (15:35 +0200)
committerAnaël Closson <ac2550@intl.att.com>
Mon, 28 Aug 2017 14:04:36 +0000 (16:04 +0200)
Projects using oparent as parent should have information about outdated
dependencies. This is done at validation phase.

A (template of a) list of rules is provided to ignore certain versions,
a more importantly to ignore all versions of an artifact but one.
This might be use to warn projects not using the needed dependency
of an artifact when preparing for an specific release of ONAP.

Current rule file is commented as it breaks it's not available on the
git repository.

Change-Id: I30bbbe5d14d8f297f046700963cc5a238e41901f
Issue-id:INT-121
Signed-off-by: Anaël Closson <ac2550@intl.att.com>
pom.xml
versions/pom.xml [new file with mode: 0644]
versions/src/main/resources/onap-versions/ruleset.xml [new file with mode: 0644]

diff --git a/pom.xml b/pom.xml
index ebab15a..ab67a2f 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
    Copyright (c) 2016-2017 Huawei Technologies Co., Ltd.
+   Modifications copyright (C) 2017 AT&T Intellectual Property
 
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
             </dependency>
           </dependencies>
         </plugin>
+        <plugin>
+          <groupId>org.codehaus.mojo</groupId>
+          <artifactId>versions-maven-plugin</artifactId>
+          <version>2.4</version>
+          <executions>
+            <execution>
+              <id>check-dependencies-version</id>
+              <phase>validate</phase>
+              <goals>
+                <goal>display-dependency-updates</goal>
+              </goals>
+              <configuration>
+                <!--<rulesUri>https://git.onap.org/oparent/plain/oparent/versions/src/main/resources/onap-versions/ruleset.xml</rulesUri>-->
+              </configuration>
+            </execution>
+          </executions>
+        </plugin>
       </plugins>
     </pluginManagement>
     <plugins>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-site-plugin</artifactId>
       </plugin>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>versions-maven-plugin</artifactId>
+      </plugin>
     </plugins>
   </build>
 </project>
diff --git a/versions/pom.xml b/versions/pom.xml
new file mode 100644 (file)
index 0000000..fb568f4
--- /dev/null
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+   Copyright (C) 2017 AT&T Intellectual Property
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.onap.oparent</groupId>
+    <artifactId>version</artifactId>
+    <version>1.0.0-SNAPSHOT</version>
+    <relativePath>..</relativePath>
+  </parent>
+  <artifactId>versions</artifactId>
+  <name>oparent/versions</name>
+</project>
diff --git a/versions/src/main/resources/onap-versions/ruleset.xml b/versions/src/main/resources/onap-versions/ruleset.xml
new file mode 100644 (file)
index 0000000..a846008
--- /dev/null
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+   Copyright (C) 2017 AT&T Intellectual Property
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+<ruleset comparisonMethod="maven"
+         xmlns="http://mojo.codehaus.org/versions-maven-plugin/rule/2.0.0" 
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://mojo.codehaus.org/versions-maven-plugin/rule/2.0.0 http://www.mojohaus.org/versions-maven-plugin/xsd/rule-2.0.0.xsd">
+  <rules>
+    <!-- The following rule is given as example of how to specify the only valid version of a
+         component when display-dependency-updates is invoked.
+    -->
+    <!--
+    <rule groupId="org.onap" artifactId="oparent" comparisonMethod="maven">
+      <ignoreVersions>
+        <ignoreVersion type="regex">^((?!1.0.0).)*$</ignoreVersion>
+      </ignoreVersions>
+    </rule>
+    -->
+  </rules>
+</ruleset>