diff options
author | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2008-10-15 17:58:08 +0000 |
---|---|---|
committer | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2008-10-15 17:58:08 +0000 |
commit | 14ea8ba79d2f12b90d0318525af8c1d08fb83a8b (patch) | |
tree | 9c7e67ea9bd7c90150f9312785671e4643e1e5ea /branches/sca-equinox/tools/maven/maven-bundle-plugin/src/main/java/org | |
parent | 1ff9b3b7cd9f2e1b9f0a2a7662445499460e0a79 (diff) |
Adjust the phase to make sure pde-classpath comes after assemble-bundle
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@704971 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-equinox/tools/maven/maven-bundle-plugin/src/main/java/org')
-rw-r--r-- | branches/sca-equinox/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/ThirdPartyBundleClasspathGeneratorMojo.java | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/branches/sca-equinox/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/ThirdPartyBundleClasspathGeneratorMojo.java b/branches/sca-equinox/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/ThirdPartyBundleClasspathGeneratorMojo.java index 159949242d..57384fda5d 100644 --- a/branches/sca-equinox/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/ThirdPartyBundleClasspathGeneratorMojo.java +++ b/branches/sca-equinox/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/ThirdPartyBundleClasspathGeneratorMojo.java @@ -18,37 +18,25 @@ */ package org.apache.tuscany.sca.tools.bundle.plugin; -import static org.apache.tuscany.sca.tools.bundle.plugin.BundleUtil.write; - import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; -import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.io.StringWriter; import java.io.Writer; -import java.util.HashSet; -import java.util.Set; -import java.util.jar.Manifest; -import org.apache.maven.artifact.Artifact; -import org.apache.maven.artifact.resolver.ArtifactNotFoundException; -import org.apache.maven.artifact.resolver.ArtifactResolutionException; -import org.apache.maven.artifact.versioning.VersionRange; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.logging.Log; import org.apache.maven.project.MavenProject; -import org.apache.maven.shared.dependency.tree.DependencyTree; -import org.apache.maven.shared.dependency.tree.DependencyTreeBuilderException; /** * @version $Rev$ $Date$ * @goal generate-pde-classpath - * @phase process-resources + * @phase process-classes * @requiresDependencyResolution test * @description Adjust third party bundle classpath */ @@ -86,19 +74,20 @@ public class ThirdPartyBundleClasspathGeneratorMojo extends AbstractMojo { BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(classpath))); StringWriter buffer = new StringWriter(); PrintWriter printer = new PrintWriter(buffer); - boolean generatedLib = false; for (;;) { String line = reader.readLine(); if (line == null) { break; } - if (line.contains("kind=\"var\"")) { - if (!generatedLib) { - generateLibClasspathEntries(printer); - generatedLib = true; - } + if(line.contains("kind=\"lib\"") || line.contains("kind=\"var\"")) { + // Skip kind="lib", kind="var" continue; } + if (line.contains("</classpath>")) { + log.info("Adding lib classpath entries ..."); + // Generate the lib classpath entries before the </classpath> + generateLibClasspathEntries(printer); + } printer.println(line); } reader.close(); |