incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1378957 - /sling/trunk/maven/maven-launchpad-plugin/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
Date Thu, 30 Aug 2012 14:31:44 GMT
Author: cziegeler
Date: Thu Aug 30 14:31:43 2012
New Revision: 1378957

URL: http://svn.apache.org/viewvc?rev=1378957&view=rev
Log:
SLING-2589 : Project Configurations are overwritten by inherited

Modified:
    sling/trunk/maven/maven-launchpad-plugin/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java

Modified: sling/trunk/maven/maven-launchpad-plugin/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
URL: http://svn.apache.org/viewvc/sling/trunk/maven/maven-launchpad-plugin/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java?rev=1378957&r1=1378956&r2=1378957&view=diff
==============================================================================
--- sling/trunk/maven/maven-launchpad-plugin/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
(original)
+++ sling/trunk/maven/maven-launchpad-plugin/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
Thu Aug 30 14:31:43 2012
@@ -239,7 +239,7 @@ public abstract class AbstractUsingBundl
         for (Artifact artifact : dependencies) {
             if (PARTIAL.equals(artifact.getType())) {
                 getLog().info(
-                        String.format("merging partial bundle list for %s:%s:%s", artifact.getGroupId(),
+                        String.format("Merging partial bundle list %s:%s:%s", artifact.getGroupId(),
                                 artifact.getArtifactId(), artifact.getVersion()));
                 initializedBundleList.merge(readBundleList(artifact.getFile()));
             }
@@ -263,15 +263,17 @@ public abstract class AbstractUsingBundl
         final Set<Artifact> dependencies = project.getDependencyArtifacts();
         for (Artifact artifact : dependencies) {
             if (PARTIAL.equals(artifact.getType())) {
-                getLog().info(
-                        String.format("merging configuration from partial bundle list for
%s:%s:%s", artifact.getGroupId(),
-                                artifact.getArtifactId(), artifact.getVersion()));
                 extractConfiguration(artifact);
             }
         }
+        // copy own config files
+        if ( this.overlayConfigDir != null && super.getConfigDirectory().exists()
) {
+            FileUtils.copyDirectory(super.getConfigDirectory(), this.overlayConfigDir,
+                    null, FileUtils.getDefaultExcludesAsString());
+        }
     }
 
-    private void extractConfiguration(Artifact artifact) throws MojoExecutionException, IOException
{
+    private void extractConfiguration(final Artifact artifact) throws MojoExecutionException,
IOException {
         // check for configuration artifact
         Artifact cfgArtifact = null;
         try {
@@ -285,7 +287,7 @@ public abstract class AbstractUsingBundl
         }
         if ( cfgArtifact != null ) {
             getLog().info(
-                    String.format("merging partial bundle list configuration for %s:%s:%s",
cfgArtifact.getGroupId(),
+                    String.format("Merging settings from partial bundle list %s:%s:%s", cfgArtifact.getGroupId(),
                             cfgArtifact.getArtifactId(), cfgArtifact.getVersion()));
 
             // extract
@@ -304,17 +306,13 @@ public abstract class AbstractUsingBundl
                 this.readSlingBootstrap(new File(slingDir, AttachPartialBundleListMojo.SLING_STANDALONE_BOOTSTRAP),
2);
 
                 // and now configurations
-                if ( this.overlayConfigDir == null ) {
-                    this.tempConfigDir.mkdirs();
-                    if ( this.getConfigDirectory().exists() ) {
-                        FileUtils.copyDirectory(this.getConfigDirectory(), this.tempConfigDir,
-                                null, FileUtils.getDefaultExcludesAsString());
-                    }
-                    this.overlayConfigDir = this.tempConfigDir;
-                }
                 final File configDir = new File(this.tmpOutputDir, "config");
                 if ( configDir.exists() ) {
-                    FileUtils.copyDirectory(configDir, this.tempConfigDir,
+                    if ( this.overlayConfigDir == null ) {
+                        this.tempConfigDir.mkdirs();
+                        this.overlayConfigDir = this.tempConfigDir;
+                    }
+                    FileUtils.copyDirectory(configDir, this.overlayConfigDir,
                             null, FileUtils.getDefaultExcludesAsString());
                 }
             } catch (final ArchiverException ae) {



Mime
View raw message