incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jus...@apache.org
Subject svn commit: r1197607 - /sling/trunk/maven/maven-launchpad-plugin/src/main/java/org/apache/sling/maven/projectsupport/
Date Fri, 04 Nov 2011 15:46:50 GMT
Author: justin
Date: Fri Nov  4 15:46:50 2011
New Revision: 1197607

URL: http://svn.apache.org/viewvc?rev=1197607&view=rev
Log:
trivial formatting and field name change

Modified:
    sling/trunk/maven/maven-launchpad-plugin/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadStartingMojo.java
    sling/trunk/maven/maven-launchpad-plugin/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
    sling/trunk/maven/maven-launchpad-plugin/src/main/java/org/apache/sling/maven/projectsupport/AttachBundleListMojo.java
    sling/trunk/maven/maven-launchpad-plugin/src/main/java/org/apache/sling/maven/projectsupport/AttachPartialBundleListMojo.java
    sling/trunk/maven/maven-launchpad-plugin/src/main/java/org/apache/sling/maven/projectsupport/CheckBundleListForSnapshotsMojo.java
    sling/trunk/maven/maven-launchpad-plugin/src/main/java/org/apache/sling/maven/projectsupport/CreateBundleJarMojo.java
    sling/trunk/maven/maven-launchpad-plugin/src/main/java/org/apache/sling/maven/projectsupport/CreateKarafFeatureDescriptorMojo.java
    sling/trunk/maven/maven-launchpad-plugin/src/main/java/org/apache/sling/maven/projectsupport/OutputBundleListMojo.java
    sling/trunk/maven/maven-launchpad-plugin/src/main/java/org/apache/sling/maven/projectsupport/PreparePackageMojo.java
    sling/trunk/maven/maven-launchpad-plugin/src/main/java/org/apache/sling/maven/projectsupport/ValidateBundleListMojo.java

Modified: sling/trunk/maven/maven-launchpad-plugin/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadStartingMojo.java
URL: http://svn.apache.org/viewvc/sling/trunk/maven/maven-launchpad-plugin/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadStartingMojo.java?rev=1197607&r1=1197606&r2=1197607&view=diff
==============================================================================
--- sling/trunk/maven/maven-launchpad-plugin/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadStartingMojo.java
(original)
+++ sling/trunk/maven/maven-launchpad-plugin/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadStartingMojo.java
Fri Nov  4 15:46:50 2011
@@ -108,7 +108,7 @@ public abstract class AbstractLaunchpadS
         public Iterator<String> getChildren(String path) {
             if (path.equals(BUNDLE_PATH_PREFIX)) {
                 final Set<String> levels = new HashSet<String>();
-                for (final StartLevel level : getBundleList().getStartLevels()) {
+                for (final StartLevel level : getInitializedBundleList().getStartLevels())
{
                     // we treat the boot level as level 1
                     if ( level.getStartLevel() == -1 ) {
                         levels.add(BUNDLE_PATH_PREFIX + "/1/");
@@ -148,7 +148,7 @@ public abstract class AbstractLaunchpadS
                     final int startLevel = Integer.parseInt(startLevelInfo);
 
                     final List<String> bundles = new ArrayList<String>();
-                    for (final StartLevel level : getBundleList().getStartLevels()) {
+                    for (final StartLevel level : getInitializedBundleList().getStartLevels())
{
                         if (level.getStartLevel() == startLevel || (startLevel == 1 &&
level.getStartLevel() == -1)) {
                             for (final Bundle bundle : level.getBundles()) {
                                 final ArtifactDefinition d = new ArtifactDefinition(bundle,
startLevel);

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=1197607&r1=1197606&r2=1197607&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
Fri Nov  4 15:46:50 2011
@@ -81,7 +81,7 @@ public abstract class AbstractUsingBundl
      */
     private ArtifactDefinition[] additionalBundles;
 
-    private BundleList bundleList;
+    private BundleList initializedBundleList;
 
     /**
      * Bundles which should be removed from the project's bundles directory.
@@ -164,8 +164,8 @@ public abstract class AbstractUsingBundl
      */
     protected abstract void executeWithArtifacts() throws MojoExecutionException, MojoFailureException;
 
-    protected BundleList getBundleList() {
-        return bundleList;
+    protected BundleList getInitializedBundleList() {
+        return initializedBundleList;
     }
 
     /**
@@ -211,30 +211,30 @@ public abstract class AbstractUsingBundl
     private final void initBundleList() throws IOException, XmlPullParserException, MojoExecutionException
{
         initArtifactDefinitions();
         if (isCurrentArtifact(defaultBundleList)) {
-            bundleList = readBundleList(bundleListFile);
+            initializedBundleList = readBundleList(bundleListFile);
         } else {
-            bundleList = new BundleList();
+            initializedBundleList = new BundleList();
             if (includeDefaultBundles) {
                 Artifact defBndListArtifact = getArtifact(defaultBundleList.getGroupId(),
                         defaultBundleList.getArtifactId(), defaultBundleList.getVersion(),
defaultBundleList.getType(),
                         defaultBundleList.getClassifier());
                 getLog().info("Using bundle list file from " + defBndListArtifact.getFile().getAbsolutePath());
-                bundleList = readBundleList(defBndListArtifact.getFile());
+                initializedBundleList = readBundleList(defBndListArtifact.getFile());
             }
 
             if (bundleListFile.exists()) {
-                bundleList.merge(readBundleList(bundleListFile));
+                initializedBundleList.merge(readBundleList(bundleListFile));
             }
         }
         if (additionalBundles != null) {
             for (ArtifactDefinition def : additionalBundles) {
-                bundleList.add(def.toBundle());
+                initializedBundleList.add(def.toBundle());
             }
         }
-        addDependencies(bundleList);
+        addDependencies(initializedBundleList);
         if (bundleExclusions != null) {
             for (ArtifactDefinition def : bundleExclusions) {
-                bundleList.remove(def.toBundle(), false);
+                initializedBundleList.remove(def.toBundle(), false);
             }
         }
 
@@ -244,7 +244,7 @@ public abstract class AbstractUsingBundl
                 getLog().info(
                         String.format("merging partial bundle list for %s:%s:%s", artifact.getGroupId(),
                                 artifact.getArtifactId(), artifact.getVersion()));
-                bundleList.merge(readBundleList(artifact.getFile()));
+                initializedBundleList.merge(readBundleList(artifact.getFile()));
 
                 // check for configuration artifact
                 Artifact cfgArtifact = null;
@@ -302,11 +302,11 @@ public abstract class AbstractUsingBundl
         }
 
 
-        initBundleList(bundleList);
+        initBundleList(initializedBundleList);
 
-        interpolateProperties(bundleList);
+        interpolateProperties(initializedBundleList);
 
-        rewriteBundleList(bundleList);
+        rewriteBundleList(initializedBundleList);
     }
     
     private void rewriteBundleList(BundleList bundleList) throws MojoExecutionException {

Modified: sling/trunk/maven/maven-launchpad-plugin/src/main/java/org/apache/sling/maven/projectsupport/AttachBundleListMojo.java
URL: http://svn.apache.org/viewvc/sling/trunk/maven/maven-launchpad-plugin/src/main/java/org/apache/sling/maven/projectsupport/AttachBundleListMojo.java?rev=1197607&r1=1197606&r2=1197607&view=diff
==============================================================================
--- sling/trunk/maven/maven-launchpad-plugin/src/main/java/org/apache/sling/maven/projectsupport/AttachBundleListMojo.java
(original)
+++ sling/trunk/maven/maven-launchpad-plugin/src/main/java/org/apache/sling/maven/projectsupport/AttachBundleListMojo.java
Fri Nov  4 15:46:50 2011
@@ -49,7 +49,7 @@ public class AttachBundleListMojo extend
         FileWriter fw = null;
         try {
             fw = new FileWriter(outputFile);
-            writer.write(fw, getBundleList());
+            writer.write(fw, getInitializedBundleList());
             projectHelper.attachArtifact(project, TYPE, CLASSIFIER, outputFile);
         } catch (IOException e) {
             throw new MojoExecutionException("Unable to output effective bundle list", e);

Modified: sling/trunk/maven/maven-launchpad-plugin/src/main/java/org/apache/sling/maven/projectsupport/AttachPartialBundleListMojo.java
URL: http://svn.apache.org/viewvc/sling/trunk/maven/maven-launchpad-plugin/src/main/java/org/apache/sling/maven/projectsupport/AttachPartialBundleListMojo.java?rev=1197607&r1=1197606&r2=1197607&view=diff
==============================================================================
--- sling/trunk/maven/maven-launchpad-plugin/src/main/java/org/apache/sling/maven/projectsupport/AttachPartialBundleListMojo.java
(original)
+++ sling/trunk/maven/maven-launchpad-plugin/src/main/java/org/apache/sling/maven/projectsupport/AttachPartialBundleListMojo.java
Fri Nov  4 15:46:50 2011
@@ -72,24 +72,24 @@ public class AttachPartialBundleListMojo
     private ZipArchiver zipArchiver;
 
     public void execute() throws MojoExecutionException, MojoFailureException {
-        final BundleList bundleList;
+        final BundleList initializedBundleList;
         if (bundleListFile.exists()) {
             try {
-                bundleList = readBundleList(bundleListFile);
+                initializedBundleList = readBundleList(bundleListFile);
             } catch (IOException e) {
                 throw new MojoExecutionException("Unable to read bundle list file", e);
             } catch (XmlPullParserException e) {
                 throw new MojoExecutionException("Unable to read bundle list file", e);
             }
         } else {
-            bundleList = new BundleList();
+            initializedBundleList = new BundleList();
         }
         
-        addDependencies(bundleList);
+        addDependencies(initializedBundleList);
         
         BundleListXpp3Writer writer = new BundleListXpp3Writer();
         try {
-            writer.write(new FileWriter(bundleListOutput), bundleList);
+            writer.write(new FileWriter(bundleListOutput), initializedBundleList);
         } catch (IOException e) {
             throw new MojoExecutionException("Unable to write bundle list", e);
         }

Modified: sling/trunk/maven/maven-launchpad-plugin/src/main/java/org/apache/sling/maven/projectsupport/CheckBundleListForSnapshotsMojo.java
URL: http://svn.apache.org/viewvc/sling/trunk/maven/maven-launchpad-plugin/src/main/java/org/apache/sling/maven/projectsupport/CheckBundleListForSnapshotsMojo.java?rev=1197607&r1=1197606&r2=1197607&view=diff
==============================================================================
--- sling/trunk/maven/maven-launchpad-plugin/src/main/java/org/apache/sling/maven/projectsupport/CheckBundleListForSnapshotsMojo.java
(original)
+++ sling/trunk/maven/maven-launchpad-plugin/src/main/java/org/apache/sling/maven/projectsupport/CheckBundleListForSnapshotsMojo.java
Fri Nov  4 15:46:50 2011
@@ -44,7 +44,7 @@ public class CheckBundleListForSnapshots
     @Override
     protected void executeWithArtifacts() throws MojoExecutionException, MojoFailureException
{
         List<Bundle> snapshots = new ArrayList<Bundle>();
-        BundleList bundleList = getBundleList();
+        BundleList bundleList = getInitializedBundleList();
         for (StartLevel level : bundleList.getStartLevels()) {
             for (Bundle bundle : level.getBundles()) {
                 if (isSnapshot(bundle)) {

Modified: sling/trunk/maven/maven-launchpad-plugin/src/main/java/org/apache/sling/maven/projectsupport/CreateBundleJarMojo.java
URL: http://svn.apache.org/viewvc/sling/trunk/maven/maven-launchpad-plugin/src/main/java/org/apache/sling/maven/projectsupport/CreateBundleJarMojo.java?rev=1197607&r1=1197606&r2=1197607&view=diff
==============================================================================
--- sling/trunk/maven/maven-launchpad-plugin/src/main/java/org/apache/sling/maven/projectsupport/CreateBundleJarMojo.java
(original)
+++ sling/trunk/maven/maven-launchpad-plugin/src/main/java/org/apache/sling/maven/projectsupport/CreateBundleJarMojo.java
Fri Nov  4 15:46:50 2011
@@ -41,148 +41,148 @@ import org.codehaus.plexus.util.Director
  */
 public class CreateBundleJarMojo extends AbstractLaunchpadFrameworkMojo {
 
-	/**
-	 * The list of resources we want to add to the bundle JAR file.
-	 *
-	 * @parameter
-	 */
-	private Resource[] resources;
-
-	/**
-	 * The output directory.
-	 *
-	 * @parameter default-value="${project.build.directory}"
-	 */
-	private File outputDirectory;
-
-	/**
-	 * Name of the generated JAR.
-	 *
-	 * @parameter default-value="${project.artifactId}-${project.version}"
-	 * @required
-	 */
-	private String jarName;
-
-	/**
-	 * The Jar archiver.
-	 *
-	 * @component role="org.codehaus.plexus.archiver.Archiver" roleHint="jar"
-	 */
-	private JarArchiver jarArchiver;
-
-	private static final String CLASSIFIER = "bundles";
-
-	public static final String[] DEFAULT_INCLUDES = { "**/**" };
-
-	private void addBundles() throws MojoExecutionException {
-		BundleList bundles = getBundleList();
-
-		for (StartLevel level : bundles.getStartLevels()) {
-			for (Bundle bundle : level.getBundles()) {
-				Artifact artifact = getArtifact(new ArtifactDefinition(bundle,
-						level.getStartLevel()));
-				final String destFileName = getPathForArtifact(level.getStartLevel(), artifact.getFile().getName());
-				try {
-					jarArchiver.addFile(artifact.getFile(), destFileName);
-				} catch (ArchiverException e) {
-					throw new MojoExecutionException(
-							"Unable to add file to bundle jar file: "
-									+ artifact.getFile().getAbsolutePath(), e);
-				}
-			}
-		}
-	}
-
-	private void addResources(Resource resource) throws MojoExecutionException {
-		getLog().info(
-				String.format("Adding resources [%s] to [%s]", resource
-						.getDirectory(), resource.getTargetPath()));
-		String[] fileNames = getFilesToCopy(resource);
-		for (int i = 0; i < fileNames.length; i++) {
-			String targetFileName = fileNames[i];
-			if (resource.getTargetPath() != null) {
-				targetFileName = resource.getTargetPath() + File.separator
-						+ targetFileName;
-			}
-
-			try {
-				jarArchiver.addFile(new File(resource.getDirectory(),
-						fileNames[i]), targetFileName);
-			} catch (ArchiverException e) {
-				throw new MojoExecutionException(
-						"Unable to add resources to JAR file", e);
-			}
-
-		}
-	}
-
-	private File createJARFile() throws MojoExecutionException {
-		File jarFile = new File(outputDirectory, jarName + "-" + CLASSIFIER
-				+ "." + JAR);
-		jarArchiver.setDestFile(jarFile);
-
-		addBundles();
-		addResources();
-
-		try {
-			jarArchiver.createArchive();
-		} catch (ArchiverException e) {
-			throw new MojoExecutionException(
-					"Unable to create bundle jar file", e);
-		} catch (IOException e) {
-			throw new MojoExecutionException(
-					"Unable to create bundle jar file", e);
-		}
-
-		return jarFile;
-	}
-
-	private void addResources() throws MojoExecutionException {
-		if (resources != null) {
-			for (Resource resource : resources) {
-				if (!(new File(resource.getDirectory())).isAbsolute()) {
-					resource.setDirectory(project.getBasedir() + File.separator
-							+ resource.getDirectory());
-				}
-				addResources(resource);
-			}
-		}
-	}
-
-	@Override
-	protected void executeWithArtifacts() throws MojoExecutionException,
-			MojoFailureException {
-		File jarFile = createJARFile();
-		projectHelper.attachArtifact(project, JAR, CLASSIFIER, jarFile);
-	}
-
-	/**
-	 * Returns a list of filenames that should be copied over to the destination
-	 * directory.
-	 *
-	 * @param resource
-	 *            the resource to be scanned
-	 * @return the array of filenames, relative to the sourceDir
-	 */
-	@SuppressWarnings("unchecked")
+    /**
+     * The list of resources we want to add to the bundle JAR file.
+     *
+     * @parameter
+     */
+    private Resource[] resources;
+
+    /**
+     * The output directory.
+     *
+     * @parameter default-value="${project.build.directory}"
+     */
+    private File outputDirectory;
+
+    /**
+     * Name of the generated JAR.
+     *
+     * @parameter default-value="${project.artifactId}-${project.version}"
+     * @required
+     */
+    private String jarName;
+
+    /**
+     * The Jar archiver.
+     *
+     * @component role="org.codehaus.plexus.archiver.Archiver" roleHint="jar"
+     */
+    private JarArchiver jarArchiver;
+
+    private static final String CLASSIFIER = "bundles";
+
+    public static final String[] DEFAULT_INCLUDES = { "**/**" };
+
+    private void addBundles() throws MojoExecutionException {
+        BundleList bundles = getInitializedBundleList();
+
+        for (StartLevel level : bundles.getStartLevels()) {
+            for (Bundle bundle : level.getBundles()) {
+                Artifact artifact = getArtifact(new ArtifactDefinition(bundle,
+                        level.getStartLevel()));
+                final String destFileName = getPathForArtifact(level.getStartLevel(), artifact.getFile().getName());
+                try {
+                    jarArchiver.addFile(artifact.getFile(), destFileName);
+                } catch (ArchiverException e) {
+                    throw new MojoExecutionException(
+                            "Unable to add file to bundle jar file: "
+                                    + artifact.getFile().getAbsolutePath(), e);
+                }
+            }
+        }
+    }
+
+    private void addResources(Resource resource) throws MojoExecutionException {
+        getLog().info(
+                String.format("Adding resources [%s] to [%s]", resource
+                        .getDirectory(), resource.getTargetPath()));
+        String[] fileNames = getFilesToCopy(resource);
+        for (int i = 0; i < fileNames.length; i++) {
+            String targetFileName = fileNames[i];
+            if (resource.getTargetPath() != null) {
+                targetFileName = resource.getTargetPath() + File.separator
+                        + targetFileName;
+            }
+
+            try {
+                jarArchiver.addFile(new File(resource.getDirectory(),
+                        fileNames[i]), targetFileName);
+            } catch (ArchiverException e) {
+                throw new MojoExecutionException(
+                        "Unable to add resources to JAR file", e);
+            }
+
+        }
+    }
+
+    private File createJARFile() throws MojoExecutionException {
+        File jarFile = new File(outputDirectory, jarName + "-" + CLASSIFIER
+                + "." + JAR);
+        jarArchiver.setDestFile(jarFile);
+
+        addBundles();
+        addResources();
+
+        try {
+            jarArchiver.createArchive();
+        } catch (ArchiverException e) {
+            throw new MojoExecutionException(
+                    "Unable to create bundle jar file", e);
+        } catch (IOException e) {
+            throw new MojoExecutionException(
+                    "Unable to create bundle jar file", e);
+        }
+
+        return jarFile;
+    }
+
+    private void addResources() throws MojoExecutionException {
+        if (resources != null) {
+            for (Resource resource : resources) {
+                if (!(new File(resource.getDirectory())).isAbsolute()) {
+                    resource.setDirectory(project.getBasedir() + File.separator
+                            + resource.getDirectory());
+                }
+                addResources(resource);
+            }
+        }
+    }
+
+    @Override
+    protected void executeWithArtifacts() throws MojoExecutionException,
+            MojoFailureException {
+        File jarFile = createJARFile();
+        projectHelper.attachArtifact(project, JAR, CLASSIFIER, jarFile);
+    }
+
+    /**
+     * Returns a list of filenames that should be copied over to the destination
+     * directory.
+     *
+     * @param resource
+     *            the resource to be scanned
+     * @return the array of filenames, relative to the sourceDir
+     */
+    @SuppressWarnings("unchecked")
     private static String[] getFilesToCopy(Resource resource) {
-		DirectoryScanner scanner = new DirectoryScanner();
-		scanner.setBasedir(resource.getDirectory());
-		if (resource.getIncludes() != null && !resource.getIncludes().isEmpty()) {
-			scanner.setIncludes((String[]) resource.getIncludes().toArray(
-					new String[resource.getIncludes().size()]));
-		} else {
-			scanner.setIncludes(DEFAULT_INCLUDES);
-		}
-		if (resource.getExcludes() != null && !resource.getExcludes().isEmpty()) {
-			scanner.setExcludes((String[]) resource.getExcludes().toArray(
-					new String[resource.getExcludes().size()]));
-		}
+        DirectoryScanner scanner = new DirectoryScanner();
+        scanner.setBasedir(resource.getDirectory());
+        if (resource.getIncludes() != null && !resource.getIncludes().isEmpty())
{
+            scanner.setIncludes((String[]) resource.getIncludes().toArray(
+                    new String[resource.getIncludes().size()]));
+        } else {
+            scanner.setIncludes(DEFAULT_INCLUDES);
+        }
+        if (resource.getExcludes() != null && !resource.getExcludes().isEmpty())
{
+            scanner.setExcludes((String[]) resource.getExcludes().toArray(
+                    new String[resource.getExcludes().size()]));
+        }
 
-		scanner.addDefaultExcludes();
+        scanner.addDefaultExcludes();
 
-		scanner.scan();
+        scanner.scan();
 
-		return scanner.getIncludedFiles();
-	}
+        return scanner.getIncludedFiles();
+    }
 }

Modified: sling/trunk/maven/maven-launchpad-plugin/src/main/java/org/apache/sling/maven/projectsupport/CreateKarafFeatureDescriptorMojo.java
URL: http://svn.apache.org/viewvc/sling/trunk/maven/maven-launchpad-plugin/src/main/java/org/apache/sling/maven/projectsupport/CreateKarafFeatureDescriptorMojo.java?rev=1197607&r1=1197606&r2=1197607&view=diff
==============================================================================
--- sling/trunk/maven/maven-launchpad-plugin/src/main/java/org/apache/sling/maven/projectsupport/CreateKarafFeatureDescriptorMojo.java
(original)
+++ sling/trunk/maven/maven-launchpad-plugin/src/main/java/org/apache/sling/maven/projectsupport/CreateKarafFeatureDescriptorMojo.java
Fri Nov  4 15:46:50 2011
@@ -78,7 +78,7 @@ public class CreateKarafFeatureDescripto
         feature.setAttribute("name", featureName);
         feature.setAttribute("version", featureVersion);
 
-        BundleList bundleList = getBundleList();
+        BundleList bundleList = getInitializedBundleList();
         for (StartLevel level : bundleList.getStartLevels()) {
             for (Bundle bundle : level.getBundles()) {
                 String bundleRef = String.format("mvn:%s/%s/%s", bundle.getGroupId(), bundle.getArtifactId(),
bundle

Modified: sling/trunk/maven/maven-launchpad-plugin/src/main/java/org/apache/sling/maven/projectsupport/OutputBundleListMojo.java
URL: http://svn.apache.org/viewvc/sling/trunk/maven/maven-launchpad-plugin/src/main/java/org/apache/sling/maven/projectsupport/OutputBundleListMojo.java?rev=1197607&r1=1197606&r2=1197607&view=diff
==============================================================================
--- sling/trunk/maven/maven-launchpad-plugin/src/main/java/org/apache/sling/maven/projectsupport/OutputBundleListMojo.java
(original)
+++ sling/trunk/maven/maven-launchpad-plugin/src/main/java/org/apache/sling/maven/projectsupport/OutputBundleListMojo.java
Fri Nov  4 15:46:50 2011
@@ -35,7 +35,7 @@ public class OutputBundleListMojo extend
     protected void executeWithArtifacts() throws MojoExecutionException, MojoFailureException
{
         BundleListXpp3Writer writer = new BundleListXpp3Writer();
         try {
-            writer.write(new OutputStreamWriter(System.out), getBundleList());
+            writer.write(new OutputStreamWriter(System.out), getInitializedBundleList());
         } catch (IOException e) {
             throw new MojoExecutionException("Unable to write bundle list", e);
         }

Modified: sling/trunk/maven/maven-launchpad-plugin/src/main/java/org/apache/sling/maven/projectsupport/PreparePackageMojo.java
URL: http://svn.apache.org/viewvc/sling/trunk/maven/maven-launchpad-plugin/src/main/java/org/apache/sling/maven/projectsupport/PreparePackageMojo.java?rev=1197607&r1=1197606&r2=1197607&view=diff
==============================================================================
--- sling/trunk/maven/maven-launchpad-plugin/src/main/java/org/apache/sling/maven/projectsupport/PreparePackageMojo.java
(original)
+++ sling/trunk/maven/maven-launchpad-plugin/src/main/java/org/apache/sling/maven/projectsupport/PreparePackageMojo.java
Fri Nov  4 15:46:50 2011
@@ -46,44 +46,44 @@ import org.codehaus.plexus.util.FileUtil
  */
 public class PreparePackageMojo extends AbstractLaunchpadFrameworkMojo {
 
-	/**
-	 * The output directory for the default bundles in a WAR-packaged project,
-	 * the base JAR (in the subdirectory named in the baseDestination
-	 * parameter), and any additional bundles.
-	 *
-	 * @parameter default-value="${project.build.directory}/launchpad-bundles"
-	 */
-	private File warOutputDirectory;
-
-	/**
-	 * The project's packaging type.
-	 *
-	 * @parameter expression="${project.packaging}"
-	 */
-	private String packaging;
-
-	/**
-	 * The definition of the base JAR.
-	 *
-	 * @parameter
-	 */
-	private ArtifactDefinition base;
-
-	/**
-	 * The definition of the package to be included to provide web support for
-	 * JAR-packaged projects (i.e. pax-web).
-	 *
-	 * @parameter
-	 */
-	private ArtifactDefinition jarWebSupport;
-
-	/**
-	 * The project's build output directory (i.e. target/classes).
-	 *
-	 * @parameter expression="${project.build.outputDirectory}"
-	 * @readonly
-	 */
-	private File buildOutputDirectory;
+    /**
+     * The output directory for the default bundles in a WAR-packaged project,
+     * the base JAR (in the subdirectory named in the baseDestination
+     * parameter), and any additional bundles.
+     *
+     * @parameter default-value="${project.build.directory}/launchpad-bundles"
+     */
+    private File warOutputDirectory;
+
+    /**
+     * The project's packaging type.
+     *
+     * @parameter expression="${project.packaging}"
+     */
+    private String packaging;
+
+    /**
+     * The definition of the base JAR.
+     *
+     * @parameter
+     */
+    private ArtifactDefinition base;
+
+    /**
+     * The definition of the package to be included to provide web support for
+     * JAR-packaged projects (i.e. pax-web).
+     *
+     * @parameter
+     */
+    private ArtifactDefinition jarWebSupport;
+
+    /**
+     * The project's build output directory (i.e. target/classes).
+     *
+     * @parameter expression="${project.build.outputDirectory}"
+     * @readonly
+     */
+    private File buildOutputDirectory;
 
     /**
      * The temp directory (i.e. target/maven-launchpad-plugintmp).
@@ -108,27 +108,27 @@ public class PreparePackageMojo extends 
     private JarArchiver jarArchiver;
 
     public void executeWithArtifacts() throws MojoExecutionException, MojoFailureException
{
-		copyBaseArtifact();
-		copyBundles(getBundleList(), getOutputDirectory());
-		copyConfigurationFiles();
-		if (JAR.equals(packaging)) {
-			unpackBaseArtifact();
-		}
-	}
+        copyBaseArtifact();
+        copyBundles(getInitializedBundleList(), getOutputDirectory());
+        copyConfigurationFiles();
+        if (JAR.equals(packaging)) {
+            unpackBaseArtifact();
+        }
+    }
 
     protected void initArtifactDefinitions(Properties dependencies) {
-		if (base == null) {
-			base = new ArtifactDefinition();
-		}
-		base.initDefaults(dependencies.getProperty("base"));
-
-		if (jarWebSupport == null) {
-			jarWebSupport = new ArtifactDefinition();
-		}
-		jarWebSupport.initDefaults(dependencies.getProperty("jarWebSupport"));
-	}
+        if (base == null) {
+            base = new ArtifactDefinition();
+        }
+        base.initDefaults(dependencies.getProperty("base"));
 
-	/**
+        if (jarWebSupport == null) {
+            jarWebSupport = new ArtifactDefinition();
+        }
+        jarWebSupport.initDefaults(dependencies.getProperty("jarWebSupport"));
+    }
+
+    /**
      * Add the JAR Web Support bundle to the bundle list.
      */
     @Override
@@ -210,96 +210,96 @@ public class PreparePackageMojo extends 
     }
 
     private void copyBaseArtifact() throws MojoExecutionException {
-		Artifact artifact = getBaseArtifact();
-		if (artifact == null) {
-			throw new MojoExecutionException(
-					String.format("Project doesn't have a base dependency of groupId %s and artifactId %s",
-									base.getGroupId(), base.getArtifactId()));
-		}
-		File destinationDir = new File(getOutputDirectory(), baseDestination);
-		File destinationFile = new File(destinationDir, artifact
-				.getArtifactId()
-				+ "." + artifact.getArtifactHandler().getExtension());
-
-		// check if custom sling.properties file or bootstrap command exists
-		final Properties additionalProps = this.getSlingProperties(JAR.equals(this.packaging));
-		final String bootstrapCmd = this.getSlingBootstrap(JAR.equals(this.packaging));
-		if ( additionalProps != null || bootstrapCmd != null ) {
-    		// unpack to a temp destination
-		    final File dest = new File(this.tempDirectory, "basejar");
-		    try {
-        		unpack(artifact.getFile(), dest);
-
-        		// patch sling properties
-        		if ( additionalProps != null ) {
-        		    this.patchSlingProperties(dest, additionalProps);
-        		}
+        Artifact artifact = getBaseArtifact();
+        if (artifact == null) {
+            throw new MojoExecutionException(
+                    String.format("Project doesn't have a base dependency of groupId %s and
artifactId %s",
+                                    base.getGroupId(), base.getArtifactId()));
+        }
+        File destinationDir = new File(getOutputDirectory(), baseDestination);
+        File destinationFile = new File(destinationDir, artifact
+                .getArtifactId()
+                + "." + artifact.getArtifactHandler().getExtension());
+
+        // check if custom sling.properties file or bootstrap command exists
+        final Properties additionalProps = this.getSlingProperties(JAR.equals(this.packaging));
+        final String bootstrapCmd = this.getSlingBootstrap(JAR.equals(this.packaging));
+        if ( additionalProps != null || bootstrapCmd != null ) {
+            // unpack to a temp destination
+            final File dest = new File(this.tempDirectory, "basejar");
+            try {
+                unpack(artifact.getFile(), dest);
+
+                // patch sling properties
+                if ( additionalProps != null ) {
+                    this.patchSlingProperties(dest, additionalProps);
+                }
 
-        		// patch bootstrap command
+                // patch bootstrap command
                 if  ( bootstrapCmd != null ) {
                     this.patchSlingBootstrap(dest, bootstrapCmd);
                 }
 
                 // and repack again
-        		pack(dest, destinationFile);
-		    } finally {
-		        this.tempDirectory.delete();
-		    }
-		} else {
-		    // we can just copy
-    		if (shouldCopy(artifact.getFile(), destinationFile)) {
-    			try {
-    				getLog().info(
-    						String.format("Copying base artifact from %s to %s.",
-    								artifact.getFile(), destinationFile));
-    				FileUtils.copyFile(artifact.getFile(), destinationFile);
-    			} catch (IOException e) {
-    				throw new MojoExecutionException(
-    						"Unable to copy base artifact.", e);
-    			}
-    		} else {
-    			getLog().debug(
-    					String.format("Skipping copy of base artifact from %s.",
-    							artifact.getFile()));
-    		}
-		}
-	}
-
-	private Artifact getBaseArtifact() throws MojoExecutionException {
-		Artifact baseDependency = getBaseDependency();
-		if (baseDependency == null) {
-			return null;
-		}
-
-		return getArtifact(base.getGroupId(), base.getArtifactId(),
-				baseDependency.getVersion(), base.getType(), base
-						.getClassifier());
-
-	}
-
-	private Artifact getBaseDependency() {
-		return (Artifact) project.getArtifactMap().get(
-				base.getGroupId() + ":" + base.getArtifactId());
-	}
-
-	protected File getOutputDirectory() {
-		if (WAR.equals(packaging)) {
-			return warOutputDirectory;
-        }
-		return buildOutputDirectory;
-	}
-
-	protected void unpackBaseArtifact() throws MojoExecutionException {
-		Artifact artifact = getBaseDependency();
-		if (artifact == null) {
-			throw new MojoExecutionException(
-					String
-							.format(
-									"Project doesn't have a base dependency of groupId %s and artifactId %s",
-									base.getGroupId(), base.getArtifactId()));
-		}
-		unpack(artifact.getFile(), buildOutputDirectory);
-	}
+                pack(dest, destinationFile);
+            } finally {
+                this.tempDirectory.delete();
+            }
+        } else {
+            // we can just copy
+            if (shouldCopy(artifact.getFile(), destinationFile)) {
+                try {
+                    getLog().info(
+                            String.format("Copying base artifact from %s to %s.",
+                                    artifact.getFile(), destinationFile));
+                    FileUtils.copyFile(artifact.getFile(), destinationFile);
+                } catch (IOException e) {
+                    throw new MojoExecutionException(
+                            "Unable to copy base artifact.", e);
+                }
+            } else {
+                getLog().debug(
+                        String.format("Skipping copy of base artifact from %s.",
+                                artifact.getFile()));
+            }
+        }
+    }
+
+    private Artifact getBaseArtifact() throws MojoExecutionException {
+        Artifact baseDependency = getBaseDependency();
+        if (baseDependency == null) {
+            return null;
+        }
+
+        return getArtifact(base.getGroupId(), base.getArtifactId(),
+                baseDependency.getVersion(), base.getType(), base
+                        .getClassifier());
+
+    }
+
+    private Artifact getBaseDependency() {
+        return (Artifact) project.getArtifactMap().get(
+                base.getGroupId() + ":" + base.getArtifactId());
+    }
+
+    protected File getOutputDirectory() {
+        if (WAR.equals(packaging)) {
+            return warOutputDirectory;
+        }
+        return buildOutputDirectory;
+    }
+
+    protected void unpackBaseArtifact() throws MojoExecutionException {
+        Artifact artifact = getBaseDependency();
+        if (artifact == null) {
+            throw new MojoExecutionException(
+                    String
+                            .format(
+                                    "Project doesn't have a base dependency of groupId %s
and artifactId %s",
+                                    base.getGroupId(), base.getArtifactId()));
+        }
+        unpack(artifact.getFile(), buildOutputDirectory);
+    }
 
     private void copyConfigurationFiles() throws MojoExecutionException {
         try {

Modified: sling/trunk/maven/maven-launchpad-plugin/src/main/java/org/apache/sling/maven/projectsupport/ValidateBundleListMojo.java
URL: http://svn.apache.org/viewvc/sling/trunk/maven/maven-launchpad-plugin/src/main/java/org/apache/sling/maven/projectsupport/ValidateBundleListMojo.java?rev=1197607&r1=1197606&r2=1197607&view=diff
==============================================================================
--- sling/trunk/maven/maven-launchpad-plugin/src/main/java/org/apache/sling/maven/projectsupport/ValidateBundleListMojo.java
(original)
+++ sling/trunk/maven/maven-launchpad-plugin/src/main/java/org/apache/sling/maven/projectsupport/ValidateBundleListMojo.java
Fri Nov  4 15:46:50 2011
@@ -36,24 +36,24 @@ import org.codehaus.plexus.util.xml.pull
 public class ValidateBundleListMojo extends AbstractBundleListMojo {
    
     public void execute() throws MojoExecutionException, MojoFailureException {
-        final BundleList bundleList;
+        final BundleList initializedBundleList;
         if (bundleListFile.exists()) {
             try {
-                bundleList = readBundleList(bundleListFile);
+                initializedBundleList = readBundleList(bundleListFile);
             } catch (IOException e) {
                 throw new MojoExecutionException("Unable to read bundle list file", e);
             } catch (XmlPullParserException e) {
                 throw new MojoExecutionException("Unable to read bundle list file", e);
             }
         } else {
-            bundleList = new BundleList();
+            initializedBundleList = new BundleList();
         }
         
-        addDependencies(bundleList);
+        addDependencies(initializedBundleList);
 
-        interpolateProperties(bundleList);
+        interpolateProperties(initializedBundleList);
         
-        for (StartLevel sl : bundleList.getStartLevels()) {
+        for (StartLevel sl : initializedBundleList.getStartLevels()) {
             for (Bundle bundle : sl.getBundles()) {
                 getArtifact(new ArtifactDefinition(bundle, -1));
             }



Mime
View raw message