Rework license packaging 70/83870/5
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 21 Aug 2019 13:56:41 +0000 (15:56 +0200)
committerRobert Varga <nite@hq.sk>
Thu, 22 Aug 2019 14:42:39 +0000 (14:42 +0000)
Rather than mucking with unpacking jars, let's just attach
the license file and have the execution copy it to classes.

Change-Id: I3b6105ba7055ebdd9de14664ce7c870daff4e976
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
license/pom.xml
odlparent/pom.xml

index 312bbdfbbd124ef852e7445ab6a70f5764329ac0..c096101b85ff6acf2f8ea629e10a1ba09f12fbfd 100644 (file)
 
   <artifactId>odl-license</artifactId>
   <name>ODL :: odlparent :: ${project.artifactId}</name>
+  <packaging>pom</packaging>
 
   <build>
-    <pluginManagement>
-      <plugins>
-        <plugin>
-          <artifactId>maven-jar-plugin</artifactId>
-          <version>3.1.1</version>
-        </plugin>
-        <plugin>
-          <artifactId>maven-resources-plugin</artifactId>
-          <version>3.1.0</version>
-        </plugin>
-      </plugins>
-    </pluginManagement>
+    <plugins>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>build-helper-maven-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>attach-artifacts</id>
+            <phase>package</phase>
+            <goals>
+              <goal>attach-artifact</goal>
+            </goals>
+            <configuration>
+              <artifacts>
+                <artifact>
+                  <file>src/main/resources/LICENSE</file>
+                  <type>license</type>
+                </artifact>
+              </artifacts>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
   </build>
 </project>
 
index 13a0b42e88d63decb00fa732b841122d4c18abc4..7b120ee5223a85095edd8a117cdb1ead321f000e 100644 (file)
               <artifactId>checkstyle</artifactId>
               <version>6.0.0-SNAPSHOT</version>
             </dependency>
-            <dependency>
-              <groupId>org.opendaylight.odlparent</groupId>
-              <artifactId>odl-license</artifactId>
-              <version>6.0.0-SNAPSHOT</version>
-            </dependency>
             <dependency>
               <groupId>com.github.sevntu-checkstyle</groupId>
               <artifactId>sevntu-checkstyle-maven-plugin</artifactId>
             <execution>
               <id>unpack-license</id>
               <phase>generate-resources</phase>
-              <goals><goal>unpack</goal></goals>
+              <goals>
+                <goal>copy</goal>
+              </goals>
               <configuration>
                 <artifactItems>
                   <artifactItem>
                     <groupId>org.opendaylight.odlparent</groupId>
                     <artifactId>odl-license</artifactId>
                     <version>6.0.0-SNAPSHOT</version>
+                    <type>license</type>
+                    <outputDirectory>${project.build.outputDirectory}</outputDirectory>
+                    <destFileName>LICENSE</destFileName>
+                    <overWrite>false</overWrite>
                   </artifactItem>
                 </artifactItems>
-                <outputDirectory>${project.build.outputDirectory}</outputDirectory>
-                <excludes>META-INF/**</excludes>
                 <silent>true</silent>
               </configuration>
             </execution>