Support building without zip archives
[odlparent.git] / features-test / pom.xml
index 0d6653835b984c82e78274f894455b7bd6429464..bdbb411943e596d6cfd9debed19fabc5b3af3c4e 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!-- vi: set et smarttab sw=4 tabstop=4: -->
 <!--
- Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ Copyright © 2014, 2017 Cisco Systems, 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,
@@ -13,7 +13,7 @@
     <parent>
         <groupId>org.opendaylight.odlparent</groupId>
         <artifactId>bundle-parent</artifactId>
-        <version>1.8.0-SNAPSHOT</version>
+        <version>4.0.3-SNAPSHOT</version>
         <relativePath>../bundle-parent</relativePath>
     </parent>
 
             <scope>compile</scope>
         </dependency>
         <dependency>
-            <groupId>org.apache.maven.wagon</groupId>
-            <artifactId>wagon-http</artifactId>
-            <version>2.10</version>
-            <scope>compile</scope>
+            <groupId>org.osgi</groupId>
+            <!-- required due to https://jira.opendaylight.org/browse/ODLPARENT-136 -->
+            <artifactId>org.osgi.compendium</artifactId>
         </dependency>
         <dependency>
             <groupId>org.apache.karaf.features</groupId>
-            <artifactId>org.apache.karaf.features.core</artifactId>
+            <artifactId>standard</artifactId>
             <version>${karaf.version}</version>
-            <scope>compile</scope>
+            <classifier>features</classifier>
+            <type>xml</type>
         </dependency>
         <dependency>
             <groupId>junit</groupId>
             <version>${karaf.version}</version>
             <scope>compile</scope>
         </dependency>
-        <dependency>
-            <groupId>org.apache.karaf.deployer</groupId>
-            <artifactId>org.apache.karaf.deployer.spring</artifactId>
-            <version>${karaf.version}</version>
-            <scope>compile</scope>
-        </dependency>
         <dependency>
             <groupId>org.ops4j.pax.url</groupId>
             <artifactId>pax-url-wrap</artifactId>
             <artifactId>slf4j-api</artifactId>
             <scope>compile</scope>
         </dependency>
-        <dependency>
-            <groupId>com.google.guava</groupId>
-            <artifactId>guava</artifactId>
-            <scope>compile</scope>
-        </dependency>
         <dependency>
             <groupId>javax.inject</groupId>
             <artifactId>javax.inject</artifactId>
             <artifactId>org.osgi.core</artifactId>
             <scope>compile</scope>
         </dependency>
+        <!-- BEWARE of adding additional dependencies here...
+             It will cause weird issues e.g. in integration/distribution/features/repos/distribution -->
+        <dependency>
+          <groupId>org.opendaylight.odlparent</groupId>
+          <artifactId>karaf-util</artifactId>
+          <version>${project.version}</version>
+        </dependency>
         <dependency>
             <groupId>${project.groupId}</groupId>
-            <artifactId>bundles-test</artifactId>
+            <artifactId>bundles4-test</artifactId>
             <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.karaf.bundle</groupId>
+            <artifactId>org.apache.karaf.bundle.core</artifactId>
+            <version>${karaf.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+          <groupId>com.google.guava</groupId>
+          <artifactId>guava</artifactId>
+          <scope>compile</scope>
+        </dependency>
+        <!-- The following, which are just transitive dependencies of bundles4-test,
+             have to be repeated here so that the Embed-Dependency below for maven-bundle-plugin works: -->
+        <dependency>
+          <groupId>org.hamcrest</groupId>
+          <artifactId>hamcrest-core</artifactId>
+          <scope>provided</scope>
+        </dependency>
+        <dependency>
+          <groupId>org.awaitility</groupId>
+          <artifactId>awaitility</artifactId>
+          <scope>provided</scope>
+          <exclusions>
+            <exclusion>
+              <groupId>cglib</groupId>
+              <artifactId>cglib-nodep</artifactId>
+            </exclusion>
+            <exclusion>
+              <groupId>org.objenesis</groupId>
+              <artifactId>objenesis</artifactId>
+            </exclusion>
+          </exclusions>
+        </dependency>
+        <!-- Real <scope>test dependencies, just for SingleFeatureTestUnitTest -->
+        <dependency>
+          <groupId>com.google.truth</groupId>
+          <artifactId>truth</artifactId>
+          <scope>test</scope>
         </dependency>
     </dependencies>
 
             <plugin>
                 <groupId>org.apache.felix</groupId>
                 <artifactId>maven-bundle-plugin</artifactId>
+                <configuration>
+                  <instructions>
+                    <Embed-Dependency>bundles4-test;inline=true,awaitility;inline=true,hamcrest-core;inline=true</Embed-Dependency>
+                    <!-- same as in bundles4-test/pom.xml: -->
+                    <Import-Package>!net.sf.cglib.proxy,!org.objenesis,*</Import-Package>
+                  </instructions>
+                </configuration>
             </plugin>
             <plugin>
                 <artifactId>maven-checkstyle-plugin</artifactId>
         </plugins>
     </build>
 
-  <!--
-    Maven Site Configuration
-
-    The following configuration is necessary for maven-site-plugin to
-    correctly identify the correct deployment path for OpenDaylight Maven
-    sites.
-  -->
-  <url>${odl.site.url}/${project.groupId}/${stream}/${project.artifactId}/</url>
-
-  <distributionManagement>
-    <site>
-      <id>opendaylight-site</id>
-      <url>${nexus.site.url}/${project.artifactId}/</url>
-    </site>
-  </distributionManagement>
+    <!-- We use profiles to handle the different archives which are user-configurable.
+         We need at least one archive to be built. -->
+    <profiles>
+        <profile>
+            <id>zip</id>
+            <activation>
+                <property>
+                    <name>karaf.archiveZip</name>
+                    <value>true</value>
+                </property>
+            </activation>
+            <dependencies>
+                <dependency>
+                    <groupId>org.opendaylight.odlparent</groupId>
+                    <artifactId>opendaylight-karaf-empty</artifactId>
+                    <type>zip</type>
+                    <exclusions>
+                        <exclusion>
+                            <groupId>*</groupId>
+                            <artifactId>*</artifactId>
+                        </exclusion>
+                    </exclusions>
+                </dependency>
+            </dependencies>
+            <properties>
+                <archive.extension>zip</archive.extension>
+            </properties>
+        </profile>
+        <profile>
+            <id>tarGz</id>
+            <activation>
+                <property>
+                    <name>karaf.archiveTarGz</name>
+                    <value>true</value>
+                </property>
+            </activation>
+            <properties>
+                <archive.extension>tar.gz</archive.extension>
+            </properties>
+        </profile>
+    </profiles>
 </project>