Bug 8571: copy src/main/assembly 46/59246/2
authorStephen Kitt <skitt@redhat.com>
Tue, 20 Jun 2017 17:03:51 +0000 (19:03 +0200)
committerMichael Vorburger <vorburger@redhat.com>
Tue, 20 Jun 2017 17:46:36 +0000 (17:46 +0000)
The contents of src/main/assembly need to be copied to
target/assembly, overwriting any conflicting file from Karaf.
integration/distribution needs this to be able to add custom scripts
and replace configuration files.

(Arguably this should be part of integration/distribution, but it
can’t be — at least not in a maintainable fashion.)

Change-Id: Ifcce82862d350b87853727e2c77140adee164886
Signed-off-by: Stephen Kitt <skitt@redhat.com>
karaf/karaf4-parent/pom.xml

index 783ee00845995cd752e99d666f081c0f381be949..aa52fa597ec62b78afdcc7b7a575d0ab04962867 100644 (file)
 
     <build>
         <plugins>
-            <plugin>
-                <artifactId>maven-resources-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <id>process-resources</id>
-                        <goals>
-                            <goal>resources</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
             <plugin>
                 <artifactId>maven-remote-resources-plugin</artifactId>
                 <configuration>
                     </execution>
                 </executions>
             </plugin>
+            <plugin>
+                <artifactId>maven-resources-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>copy-resources</id>
+                        <phase>prepare-package</phase>
+                        <goals>
+                            <goal>copy-resources</goal>
+                        </goals>
+                        <configuration>
+                            <outputDirectory>${basedir}/target/assembly</outputDirectory>
+                            <resources>
+                                <resource>
+                                    <directory>src/main/assembly</directory>
+                                </resource>
+                            </resources>
+                            <overwrite>true</overwrite>
+                        </configuration>
+                    </execution>
+                    <execution>
+                        <id>process-resources</id>
+                        <goals>
+                            <goal>resources</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
             <plugin>
                 <groupId>org.apache.karaf.tooling</groupId>
                 <artifactId>karaf-maven-plugin</artifactId>