Repository: karaf
Updated Branches:
  refs/heads/master 8aa1f71f3 -> 91864ae8d


KARAF-4079: Added support for src/main/resources/assembly to overwrite config 
files e.g. etc/*


Project: http://git-wip-us.apache.org/repos/asf/karaf/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/91864ae8
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/91864ae8
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/91864ae8

Branch: refs/heads/master
Commit: 91864ae8d1dcf0b63805a4e14c976dfa56195aad
Parents: 8aa1f71
Author: Dhiraj Bokde <[email protected]>
Authored: Wed Oct 28 12:34:54 2015 -0700
Committer: Dhiraj Bokde <[email protected]>
Committed: Wed Oct 28 12:34:54 2015 -0700

----------------------------------------------------------------------
 .../main/java/org/apache/karaf/tooling/AssemblyMojo.java  | 10 ++++++++++
 1 file changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf/blob/91864ae8/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/AssemblyMojo.java
----------------------------------------------------------------------
diff --git 
a/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/AssemblyMojo.java
 
b/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/AssemblyMojo.java
index 1b90322..166999c 100644
--- 
a/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/AssemblyMojo.java
+++ 
b/tooling/karaf-maven-plugin/src/main/java/org/apache/karaf/tooling/AssemblyMojo.java
@@ -43,6 +43,12 @@ import java.util.List;
 public class AssemblyMojo extends MojoSupport {
 
     /**
+     * Base directory used to overwrite resources in generated assembly after 
the build (resource directory).
+     */
+    @Parameter(defaultValue = "${project.basedir}/src/main/resources/assembly")
+    protected File sourceDirectory;
+
+    /**
      * Base directory used to copy the resources during the build (working 
directory).
      */
     @Parameter(defaultValue = "${project.build.directory}/assembly")
@@ -327,6 +333,10 @@ public class AssemblyMojo extends MojoSupport {
         if (includeBuildOutputDirectory)
             IoUtils.copyDirectory(new 
File(project.getBuild().getOutputDirectory()), workDirectory);
 
+        // Overwrite assembly dir contents
+        if (sourceDirectory.exists())
+            IoUtils.copyDirectory(sourceDirectory, workDirectory);
+
         // Chmod the bin/* scripts
         File[] files = new File(workDirectory, "bin").listFiles();
         if( files!=null ) {

Reply via email to