Release odlparent
[odlparent.git] / abstract-feature-parent / pom.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3  Copyright © 2016, 2017 Red Hat, Inc. and others.  All rights reserved.
4
5  This program and the accompanying materials are made available under the
6  terms of the Eclipse Public License v1.0 which accompanies this distribution,
7  and is available at http://www.eclipse.org/legal/epl-v10.html
8  -->
9 <project xmlns="http://maven.apache.org/POM/4.0.0"
10          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
11          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
12     <modelVersion>4.0.0</modelVersion>
13
14     <!--
15         Internal parent for testing single Karaf features. This parent should not be used by downstreams,
16         who should use single-feature-parent.
17     -->
18
19     <parent>
20         <groupId>org.opendaylight.odlparent</groupId>
21         <artifactId>odlparent</artifactId>
22         <version>13.0.9</version>
23         <relativePath>../odlparent</relativePath>
24     </parent>
25
26     <artifactId>abstract-feature-parent</artifactId>
27     <packaging>pom</packaging>
28     <name>ODL :: odlparent :: ${project.artifactId}</name>
29
30     <properties>
31         <checkDependencyChange>false</checkDependencyChange>
32         <failOnDependencyChange>false</failOnDependencyChange>
33
34         <jacoco.skip>true</jacoco.skip>
35         <skip.karaf.featureTest>false</skip.karaf.featureTest>
36
37         <!-- We typically do not have code in feature artifacts, which throws off maven-dependency-plugin -->
38         <odlparent.dependency.skip>true</odlparent.dependency.skip>
39     </properties>
40
41     <dependencies>
42         <!-- Test the generated features.xml -->
43         <dependency>
44             <groupId>org.opendaylight.odlparent</groupId>
45             <artifactId>features-test</artifactId>
46             <version>13.0.9</version>
47             <scope>test</scope>
48         </dependency>
49         <dependency>
50             <groupId>org.opendaylight.odlparent</groupId>
51             <artifactId>bundles-test-lib</artifactId>
52             <scope>test</scope>
53         </dependency>
54         <dependency>
55             <groupId>org.apache.karaf.bundle</groupId>
56             <artifactId>org.apache.karaf.bundle.core</artifactId>
57             <version>${karaf.version}</version>
58             <scope>test</scope>
59         </dependency>
60         <!-- Force SLF4J to test scope -->
61         <dependency>
62             <groupId>org.slf4j</groupId>
63             <artifactId>slf4j-api</artifactId>
64             <scope>test</scope>
65         </dependency>
66     </dependencies>
67
68     <build>
69         <plugins>
70             <plugin>
71                 <!-- This generates the META-INF/maven/dependencies.properties file
72                      which is required by the versionAsInProject() used in SingleFeatureTest -->
73                 <groupId>org.apache.servicemix.tooling</groupId>
74                 <artifactId>depends-maven-plugin</artifactId>
75             </plugin>
76             <plugin>
77                 <!-- Lists feature dependencies defined in test scope to be pre-installed in karaf when SFT is executed.
78                      Resolved dependencies also include absolute path to artifacts within local repository so
79                      feature names (required for feature:install) can be retrieved. -->
80                 <groupId>org.apache.maven.plugins</groupId>
81                 <artifactId>maven-dependency-plugin</artifactId>
82                 <executions>
83                     <execution>
84                         <!-- execute before test phase -->
85                         <phase>test-compile</phase>
86                         <goals>
87                             <goal>list</goal>
88                         </goals>
89                     </execution>
90                 </executions>
91                 <configuration>
92                     <skip>${skip.karaf.featureTest}</skip>
93                     <includeClassifiers>features</includeClassifiers>
94                     <includeTypes>xml</includeTypes>
95                     <excludeScope>compile</excludeScope>
96                     <!-- exclude SFT's own dependency features -->
97                     <excludeGroupIds>org.apache.karaf.features</excludeGroupIds>
98                     <outputAbsoluteArtifactFilename>true</outputAbsoluteArtifactFilename>
99                     <outputFile>${project.build.directory}/test-features</outputFile>
100                 </configuration>
101             </plugin>
102             <plugin>
103                 <artifactId>maven-surefire-plugin</artifactId>
104                 <configuration>
105                     <!-- Overridden to fix corruption with SFT, where the process would hang after test -->
106                     <forkNode implementation="org.apache.maven.plugin.surefire.extensions.SurefireForkNodeFactory"/>
107                     <dependenciesToScan>
108                         <dependency>org.opendaylight.odlparent:features-test</dependency>
109                     </dependenciesToScan>
110                     <additionalClasspathElements>
111                         <additionalClasspathElement>${project.build.directory}/feature</additionalClasspathElement>
112                     </additionalClasspathElements>
113                     <skip>${skip.karaf.featureTest}</skip>
114                     <systemPropertyVariables>
115                         <!-- Use the same repository for Pax Exam as is used for Maven -->
116                         <org.ops4j.pax.url.mvn.localRepository>${settings.localRepository}</org.ops4j.pax.url.mvn.localRepository>
117                         <!-- Test scope features resolved by maven-dependency-plugin (above) -->
118                         <featureTest.dependencies.list>${project.build.directory}/test-features</featureTest.dependencies.list>
119                     </systemPropertyVariables>
120
121                     <!-- Disable argLine if present, but pass it to SFT -->
122                     <argLine>-DsftArgLine='@{argLine}'</argLine>
123                 </configuration>
124                 <executions>
125                     <execution>
126                         <phase>test</phase>
127                         <goals>
128                             <goal>test</goal>
129                         </goals>
130                     </execution>
131                 </executions>
132             </plugin>
133         </plugins>
134     </build>
135
136     <profiles>
137         <profile>
138             <id>disable-sft</id>
139             <activation>
140                 <!-- Karaf does not have jre.properties for JDK19+ just yet -->
141                 <jdk>[19,)</jdk>
142             </activation>
143
144             <properties>
145                 <skip.karaf.featureTest>true</skip.karaf.featureTest>
146             </properties>
147
148             <build>
149                 <plugins>
150                     <plugin>
151                         <groupId>com.github.ekryd.echo-maven-plugin</groupId>
152                         <artifactId>echo-maven-plugin</artifactId>
153                         <executions>
154                             <execution>
155                                 <id>UNTESTED-JDK</id>
156                                 <goals>
157                                     <goal>echo</goal>
158                                 </goals>
159                                 <phase>test</phase>
160                                 <configuration>
161                                     <message>Running on JDK newer than 18, which is not supported. Skipping feature tests.</message>
162                                 </configuration>
163                             </execution>
164                         </executions>
165                     </plugin>
166                 </plugins>
167             </build>
168         </profile>
169     </profiles>
170 </project>