Refactor untested-single-feature-parent 02/99702/1
authorRobert Varga <robert.varga@pantheon.tech>
Sat, 12 Feb 2022 12:16:28 +0000 (13:16 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Sat, 12 Feb 2022 13:44:18 +0000 (14:44 +0100)
We do not use this parent directly and actually want to reverse the
inheritence structure: we want to keep the testing harness common
and use single-feature-parent to generate and test features.

JIRA: ODLPARENT-235
Change-Id: Ib18710583d08c2762921637a800fdfb7bbd70496
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
abstract-feature-parent/pom.xml [new file with mode: 0644]
pom.xml
single-feature-parent/pom.xml
untested-single-feature-parent/pom.xml [deleted file]

diff --git a/abstract-feature-parent/pom.xml b/abstract-feature-parent/pom.xml
new file mode 100644 (file)
index 0000000..b370d22
--- /dev/null
@@ -0,0 +1,150 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright © 2016, 2017 Red Hat, Inc. and others.  All rights reserved.
+
+ This program and the accompanying materials are made available under the
+ terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ and is available at http://www.eclipse.org/legal/epl-v10.html
+ -->
+<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/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <!--
+        Internal parent for testing single Karaf features. This parent should not be used by downstreams,
+        who should use single-feature-parent.
+    -->
+
+    <parent>
+        <groupId>org.opendaylight.odlparent</groupId>
+        <artifactId>odlparent</artifactId>
+        <version>10.0.0-SNAPSHOT</version>
+        <relativePath>../odlparent</relativePath>
+    </parent>
+
+    <artifactId>abstract-feature-parent</artifactId>
+    <packaging>pom</packaging>
+    <name>ODL :: odlparent :: ${project.artifactId}</name>
+
+    <properties>
+        <checkDependencyChange>false</checkDependencyChange>
+        <failOnDependencyChange>false</failOnDependencyChange>
+
+        <jacoco.skip>true</jacoco.skip>
+        <skip.karaf.featureTest>false</skip.karaf.featureTest>
+
+        <!-- We typically do not have code in feature artifacts, which throws off maven-dependency-plugin -->
+        <odlparent.dependency.skip>true</odlparent.dependency.skip>
+    </properties>
+
+    <dependencies>
+        <!-- Test the generated features.xml -->
+        <dependency>
+            <groupId>org.opendaylight.odlparent</groupId>
+            <artifactId>features-test</artifactId>
+            <version>10.0.0-SNAPSHOT</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.odlparent</groupId>
+            <artifactId>bundles-test-lib</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.karaf.bundle</groupId>
+            <artifactId>org.apache.karaf.bundle.core</artifactId>
+            <version>${karaf.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <!-- Force SLF4J to test scope -->
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <!-- required due to https://jira.opendaylight.org/browse/ODLPARENT-136 -->
+            <artifactId>osgi.cmpn</artifactId>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <!-- This generates the META-INF/maven/dependencies.properties file
+                     which is required by the versionAsInProject() used in SingleFeatureTest -->
+                <groupId>org.apache.servicemix.tooling</groupId>
+                <artifactId>depends-maven-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <!-- Overridden to have TCP channel support -->
+                <version>3.0.0-M5</version>
+                <configuration>
+                    <!-- Overridden to fix corruption with SFT, where the process would hang after test -->
+                    <forkNode implementation="org.apache.maven.plugin.surefire.extensions.SurefireForkNodeFactory"/>
+                    <dependenciesToScan>
+                        <dependency>org.opendaylight.odlparent:features-test</dependency>
+                    </dependenciesToScan>
+                    <additionalClasspathElements>
+                        <additionalClasspathElement>${project.build.directory}/feature</additionalClasspathElement>
+                    </additionalClasspathElements>
+                    <skip>${skip.karaf.featureTest}</skip>
+                    <systemPropertyVariables>
+                        <!-- Use the same repository for Pax Exam as is used for Maven -->
+                        <org.ops4j.pax.url.mvn.localRepository>${settings.localRepository}</org.ops4j.pax.url.mvn.localRepository>
+                    </systemPropertyVariables>
+
+                    <!-- Disable argLine if present, but pass it to SFT -->
+                    <argLine>-DsftArgLine='@{argLine}'</argLine>
+                </configuration>
+                <executions>
+                    <execution>
+                        <phase>test</phase>
+                        <goals>
+                            <goal>test</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
+    <profiles>
+        <profile>
+            <id>disable-sft</id>
+            <activation>
+                <!-- Karaf does not have jre.properties for JDK17+ just yet -->
+                <jdk>[17,)</jdk>
+            </activation>
+
+            <properties>
+                <skip.karaf.featureTest>true</skip.karaf.featureTest>
+            </properties>
+
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>com.github.ekryd.echo-maven-plugin</groupId>
+                        <artifactId>echo-maven-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <id>UNTESTED-JDK</id>
+                                <goals>
+                                    <goal>echo</goal>
+                                </goals>
+                                <phase>test</phase>
+                                <configuration>
+                                    <message>Running on JDK newer than 11, which is not supported. Skipping feature tests.</message>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+</project>
diff --git a/pom.xml b/pom.xml
index 9e0672515c75a71dbbf1eb413e1c8c2e40a0af17..4cee3028f2a02980e6e7cef226185d631bda7020 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -50,7 +50,7 @@
         <!-- Parent POMs -->
         <module>bnd-parent</module>
         <module>bundle-parent</module>
-        <module>untested-single-feature-parent</module>
+        <module>abstract-feature-parent</module>
         <module>single-feature-parent</module>
         <module>feature-repo-parent</module>
         <module>odlparent</module>
index f89b5d04b51cd2ac159cf2aaa754fbaad66de941..8dac3b2bc0511e0f45e9038f167f3d3b6dcafeb1 100644 (file)
 
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
-        <artifactId>untested-single-feature-parent</artifactId>
+        <artifactId>abstract-feature-parent</artifactId>
         <version>10.0.0-SNAPSHOT</version>
-        <relativePath>../untested-single-feature-parent</relativePath>
+        <relativePath>../abstract-feature-parent</relativePath>
     </parent>
 
     <artifactId>single-feature-parent</artifactId>
     <packaging>pom</packaging>
     <name>ODL :: odlparent :: ${project.artifactId}</name>
 
-    <properties>
-        <jacoco.skip>true</jacoco.skip>
-        <skip.karaf.featureTest>false</skip.karaf.featureTest>
-
-        <!-- We typically do not have code in feature artifacts, which throws off maven-dependency-plugin -->
-        <odlparent.dependency.skip>true</odlparent.dependency.skip>
-    </properties>
-
-    <dependencies>
-        <!-- Test the generated features.xml -->
-        <dependency>
-            <groupId>org.opendaylight.odlparent</groupId>
-            <artifactId>features-test</artifactId>
-            <version>10.0.0-SNAPSHOT</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.odlparent</groupId>
-            <artifactId>bundles-test-lib</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.karaf.bundle</groupId>
-            <artifactId>org.apache.karaf.bundle.core</artifactId>
-            <version>${karaf.version}</version>
-            <scope>test</scope>
-        </dependency>
-        <!-- Force SLF4J to test scope -->
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-api</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.osgi</groupId>
-            <!-- required due to https://jira.opendaylight.org/browse/ODLPARENT-136 -->
-            <artifactId>osgi.cmpn</artifactId>
-            <scope>test</scope>
-        </dependency>
-    </dependencies>
-
     <build>
+        <pluginManagement>
+            <plugins>
+                <!--
+                    This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.
+                -->
+                <plugin>
+                    <groupId>org.eclipse.m2e</groupId>
+                    <artifactId>lifecycle-mapping</artifactId>
+                    <version>1.0.0</version>
+                    <configuration>
+                        <lifecycleMappingMetadata>
+                            <pluginExecutions>
+                                <pluginExecution>
+                                    <pluginExecutionFilter>
+                                        <groupId>org.apache.karaf.tooling</groupId>
+                                        <artifactId>karaf-maven-plugin</artifactId>
+                                        <versionRange>[4.1.5,)</versionRange>
+                                        <goals>
+                                            <goal>verify</goal>
+                                        </goals>
+                                    </pluginExecutionFilter>
+                                    <action>
+                                        <ignore/>>
+                                    </action>
+                                </pluginExecution>
+                            </pluginExecutions>
+                        </lifecycleMappingMetadata>
+                    </configuration>
+                </plugin>
+            </plugins>
+        </pluginManagement>
+
         <plugins>
             <plugin>
-                <artifactId>maven-surefire-plugin</artifactId>
-                <!-- Overridden to have TCP channel support -->
-                <version>3.0.0-M5</version>
-                <configuration>
-                    <!-- Overridden to fix corruption with SFT, where the process would hang after test -->
-                    <forkNode implementation="org.apache.maven.plugin.surefire.extensions.SurefireForkNodeFactory"/>
-                    <dependenciesToScan>
-                        <dependency>org.opendaylight.odlparent:features-test</dependency>
-                    </dependenciesToScan>
-                    <additionalClasspathElements>
-                        <additionalClasspathElement>${project.build.directory}/feature</additionalClasspathElement>
-                    </additionalClasspathElements>
-                    <skip>${skip.karaf.featureTest}</skip>
-                    <systemPropertyVariables>
-                        <!-- Use the same repository for Pax Exam as is used for Maven -->
-                        <org.ops4j.pax.url.mvn.localRepository>${settings.localRepository}</org.ops4j.pax.url.mvn.localRepository>
-                    </systemPropertyVariables>
-
-                    <!-- Disable argLine if present, but pass it to SFT -->
-                    <argLine>-DsftArgLine='@{argLine}'</argLine>
+                <groupId>org.apache.karaf.tooling</groupId>
+                <artifactId>karaf-maven-plugin</artifactId>
+                <version>${karaf.version}</version>
+                <extensions>true</extensions>
+                <configuration combine.children="append">
+                    <enableGeneration>true</enableGeneration>
+                    <simplifyBundleDependencies>true</simplifyBundleDependencies>
+                    <checkDependencyChange>${checkDependencyChange}</checkDependencyChange>
+                    <logDependencyChanges>true</logDependencyChanges>
+                    <failOnDependencyChange>${failOnDependencyChange}</failOnDependencyChange>
+                    <excludedArtifactIds>
+                        <!-- These artifacts are provided by our Karaf distribution. -->
+                        <!-- Keep in synch with karaf parent minimal bootFeatures. -->
+                        <!-- Aries Blueprint -->
+                        <excludedArtifactId>org.apache.aries.blueprint.api</excludedArtifactId>
+                        <excludedArtifactId>org.apache.aries.blueprint.core</excludedArtifactId>
+                        <!-- Aries Quiesce -->
+                        <excludedArtifactId>org.apache.aries.quiesce.api</excludedArtifactId>
+                        <!-- jline -->
+                        <excludedArtifactId>jline</excludedArtifactId>
+                        <!-- SLF4J -->
+                        <excludedArtifactId>slf4j-api</excludedArtifactId>
+                        <excludedArtifactId>jcl-over-slf4j</excludedArtifactId>
+                        <!-- Karaf artifacts -->
+                        <!-- TODO Rework this once Karaf supports wildcards here -->
+                        <excludedArtifactId>org.apache.karaf.jaas.config</excludedArtifactId>
+                        <excludedArtifactId>org.apache.karaf.jaas.modules</excludedArtifactId>
+                        <excludedArtifactId>org.apache.karaf.shell.console</excludedArtifactId>
+                        <excludedArtifactId>org.apache.karaf.shell.core</excludedArtifactId>
+                        <!-- OSGi -->
+                        <excludedArtifactId>org.osgi.compendium</excludedArtifactId>
+                        <excludedArtifactId>org.osgi.core</excludedArtifactId>
+                        <excludedArtifactId>org.osgi.enterprise</excludedArtifactId>
+                        <!-- Bouncy Castle -->
+                        <excludedArtifactId>bcprov-jdk15on</excludedArtifactId>
+                        <excludedArtifactId>bcprov-ext-jdk15on</excludedArtifactId>
+                        <excludedArtifactId>bcpkix-jdk15on</excludedArtifactId>
+                        <excludedArtifactId>bcutil-jdk15on</excludedArtifactId>
+                        <!-- JAXB -->
+                        <excludedArtifactId>jaxb-api</excludedArtifactId>
+                        <excludedArtifactId>jaxb-runtime</excludedArtifactId>
+                        <excludedArtifactId>jakarta.xml.bind-api</excludedArtifactId>
+
+                        <!-- Guava's annotations -->
+                        <excludedArtifactId>error_prone_annotations</excludedArtifactId>
+                        <excludedArtifactId>j2objc-annotations</excludedArtifactId>
+                        <excludedArtifactId>listenablefuture</excludedArtifactId>
+
+                        <!-- Our slf4j logging markers -->
+                        <excludedArtifactId>logging-markers</excludedArtifactId>
+                    </excludedArtifactIds>
                 </configuration>
-                <executions>
-                    <execution>
-                        <phase>test</phase>
-                        <goals>
-                            <goal>test</goal>
-                        </goals>
-                    </execution>
-                </executions>
             </plugin>
         </plugins>
     </build>
-
-    <profiles>
-        <profile>
-            <id>disable-sft</id>
-            <activation>
-                <!-- Karaf does not have jre.properties for JDK17+ just yet -->
-                <jdk>[17,)</jdk>
-            </activation>
-
-            <properties>
-                <skip.karaf.featureTest>true</skip.karaf.featureTest>
-            </properties>
-
-            <build>
-                <plugins>
-                    <plugin>
-                        <groupId>com.github.ekryd.echo-maven-plugin</groupId>
-                        <artifactId>echo-maven-plugin</artifactId>
-                        <executions>
-                            <execution>
-                                <id>UNTESTED-JDK</id>
-                                <goals>
-                                    <goal>echo</goal>
-                                </goals>
-                                <phase>test</phase>
-                                <configuration>
-                                    <message>Running on JDK newer than 11, which is not supported. Skipping feature tests.</message>
-                                </configuration>
-                            </execution>
-                        </executions>
-                    </plugin>
-                </plugins>
-            </build>
-        </profile>
-    </profiles>
 </project>
diff --git a/untested-single-feature-parent/pom.xml b/untested-single-feature-parent/pom.xml
deleted file mode 100644 (file)
index 7556663..0000000
+++ /dev/null
@@ -1,132 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Copyright © 2016, 2017 Red Hat, Inc. and others.  All rights reserved.
-
- This program and the accompanying materials are made available under the
- terms of the Eclipse Public License v1.0 which accompanies this distribution,
- and is available at http://www.eclipse.org/legal/epl-v10.html
- -->
-<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/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-
-    <!--
-         Internal parent for building and packaging single Karaf features *without tests*.
-
-         We need this in odlparent to build features which are used in other parents with tests.
-         Projects outside odlparent shouldn't use this, nor should modules in odlparent which can
-         build with single-feature-parent.
-    -->
-
-    <parent>
-        <groupId>org.opendaylight.odlparent</groupId>
-        <artifactId>odlparent</artifactId>
-        <version>10.0.0-SNAPSHOT</version>
-        <relativePath>../odlparent</relativePath>
-    </parent>
-
-    <artifactId>untested-single-feature-parent</artifactId>
-    <packaging>pom</packaging>
-    <name>ODL :: odlparent :: ${project.artifactId}</name>
-
-    <properties>
-        <checkDependencyChange>false</checkDependencyChange>
-        <failOnDependencyChange>false</failOnDependencyChange>
-    </properties>
-
-    <build>
-        <plugins>
-            <plugin>
-                <!-- This generates the META-INF/maven/dependencies.properties file
-                     which is required by the versionAsInProject() used in SingleFeatureTest -->
-                <groupId>org.apache.servicemix.tooling</groupId>
-                <artifactId>depends-maven-plugin</artifactId>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.karaf.tooling</groupId>
-                <artifactId>karaf-maven-plugin</artifactId>
-                <version>${karaf.version}</version>
-                <extensions>true</extensions>
-                <configuration combine.children="append">
-                    <enableGeneration>true</enableGeneration>
-                    <simplifyBundleDependencies>true</simplifyBundleDependencies>
-                    <checkDependencyChange>${checkDependencyChange}</checkDependencyChange>
-                    <logDependencyChanges>true</logDependencyChanges>
-                    <failOnDependencyChange>${failOnDependencyChange}</failOnDependencyChange>
-                    <excludedArtifactIds>
-                        <!-- These artifacts are provided by our Karaf distribution. -->
-                        <!-- Keep in synch with karaf parent minimal bootFeatures. -->
-                        <!-- Aries Blueprint -->
-                        <excludedArtifactId>org.apache.aries.blueprint.api</excludedArtifactId>
-                        <excludedArtifactId>org.apache.aries.blueprint.core</excludedArtifactId>
-                        <!-- Aries Quiesce -->
-                        <excludedArtifactId>org.apache.aries.quiesce.api</excludedArtifactId>
-                        <!-- jline -->
-                        <excludedArtifactId>jline</excludedArtifactId>
-                        <!-- SLF4J -->
-                        <excludedArtifactId>slf4j-api</excludedArtifactId>
-                        <excludedArtifactId>jcl-over-slf4j</excludedArtifactId>
-                        <!-- Karaf artifacts -->
-                        <!-- TODO Rework this once Karaf supports wildcards here -->
-                        <excludedArtifactId>org.apache.karaf.jaas.config</excludedArtifactId>
-                        <excludedArtifactId>org.apache.karaf.jaas.modules</excludedArtifactId>
-                        <excludedArtifactId>org.apache.karaf.shell.console</excludedArtifactId>
-                        <excludedArtifactId>org.apache.karaf.shell.core</excludedArtifactId>
-                        <!-- OSGi -->
-                        <excludedArtifactId>org.osgi.compendium</excludedArtifactId>
-                        <excludedArtifactId>org.osgi.core</excludedArtifactId>
-                        <excludedArtifactId>org.osgi.enterprise</excludedArtifactId>
-                        <!-- Bouncy Castle -->
-                        <excludedArtifactId>bcprov-jdk15on</excludedArtifactId>
-                        <excludedArtifactId>bcprov-ext-jdk15on</excludedArtifactId>
-                        <excludedArtifactId>bcpkix-jdk15on</excludedArtifactId>
-                        <excludedArtifactId>bcutil-jdk15on</excludedArtifactId>
-                        <!-- JAXB -->
-                        <excludedArtifactId>jaxb-api</excludedArtifactId>
-                        <excludedArtifactId>jaxb-runtime</excludedArtifactId>
-                        <excludedArtifactId>jakarta.xml.bind-api</excludedArtifactId>
-
-                        <!-- Guava's annotations -->
-                        <excludedArtifactId>error_prone_annotations</excludedArtifactId>
-                        <excludedArtifactId>j2objc-annotations</excludedArtifactId>
-                        <excludedArtifactId>listenablefuture</excludedArtifactId>
-
-                        <!-- Our slf4j logging markers -->
-                        <excludedArtifactId>logging-markers</excludedArtifactId>
-                    </excludedArtifactIds>
-                </configuration>
-            </plugin>
-        </plugins>
-        <pluginManagement>
-          <plugins>
-            <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
-            <plugin>
-              <groupId>org.eclipse.m2e</groupId>
-              <artifactId>lifecycle-mapping</artifactId>
-              <version>1.0.0</version>
-              <configuration>
-                <lifecycleMappingMetadata>
-                  <pluginExecutions>
-                    <pluginExecution>
-                      <pluginExecutionFilter>
-                        <groupId>org.apache.karaf.tooling</groupId>
-                        <artifactId>karaf-maven-plugin</artifactId>
-                        <versionRange>[4.1.5,)</versionRange>
-                        <goals>
-                          <goal>verify</goal>
-                        </goals>
-                      </pluginExecutionFilter>
-                      <action>
-                        <ignore></ignore>
-                      </action>
-                    </pluginExecution>
-                  </pluginExecutions>
-                </lifecycleMappingMetadata>
-              </configuration>
-            </plugin>
-          </plugins>
-        </pluginManagement>
-    </build>
-
-</project>