diff options
-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(); |