summaryrefslogtreecommitdiffstats
path: root/branches
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2008-10-15 01:56:22 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2008-10-15 01:56:22 +0000
commit9e9ea93f12c82796d24df2c24817a8a43e355e0f (patch)
tree676901f7d83f5feacafd3e88c15b902b12bb69bd /branches
parent68b45429e7dbf814d2bdc458d458ac58f39fd875 (diff)
Added a parameter to the bundle plugin to allow configuration of the bundle symbolic name. Use that parameter in thirdparty-library/pom.xml. Ignore .classpath file if it doesn't exist yet.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@704767 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches')
-rw-r--r--branches/sca-equinox/modules/thirdparty-library/pom.xml3
-rw-r--r--branches/sca-equinox/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/BundleUtil.java4
-rw-r--r--branches/sca-equinox/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/ThirdPartyBundleBuildMojo.java9
-rw-r--r--branches/sca-equinox/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/ThirdPartyBundleClasspathGeneratorMojo.java3
4 files changed, 16 insertions, 3 deletions
diff --git a/branches/sca-equinox/modules/thirdparty-library/pom.xml b/branches/sca-equinox/modules/thirdparty-library/pom.xml
index e99e73c0d5..63893af9d5 100644
--- a/branches/sca-equinox/modules/thirdparty-library/pom.xml
+++ b/branches/sca-equinox/modules/thirdparty-library/pom.xml
@@ -63,6 +63,9 @@
<goals>
<goal>assemble-thirdparty-bundle</goal>
</goals>
+ <configuration>
+ <symbolicName>org.apache.tuscany.sca.thirdparty.library</symbolicName>
+ </configuration>
</execution>
</executions>
</plugin>
diff --git a/branches/sca-equinox/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/BundleUtil.java b/branches/sca-equinox/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/BundleUtil.java
index a93b6b29fe..ea9a206436 100644
--- a/branches/sca-equinox/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/BundleUtil.java
+++ b/branches/sca-equinox/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/BundleUtil.java
@@ -124,7 +124,7 @@ final class BundleUtil {
}
}
- static Manifest libraryManifest(Set<File> jarFiles, String name, String version)
+ static Manifest libraryManifest(Set<File> jarFiles, String name, String symbolicName, String version)
throws IllegalStateException {
try {
@@ -162,7 +162,7 @@ final class BundleUtil {
Attributes attributes = manifest.getMainAttributes();
attributes.putValue("Manifest-Version", "1.0");
attributes.putValue(BUNDLE_MANIFESTVERSION, "2");
- attributes.putValue(BUNDLE_SYMBOLICNAME, name);
+ attributes.putValue(BUNDLE_SYMBOLICNAME, symbolicName);
attributes.putValue(BUNDLE_NAME, name);
attributes.putValue(BUNDLE_VERSION, version);
attributes.putValue(DYNAMICIMPORT_PACKAGE, "*");
diff --git a/branches/sca-equinox/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/ThirdPartyBundleBuildMojo.java b/branches/sca-equinox/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/ThirdPartyBundleBuildMojo.java
index 3837a5a902..ccd29e4cd6 100644
--- a/branches/sca-equinox/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/ThirdPartyBundleBuildMojo.java
+++ b/branches/sca-equinox/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/ThirdPartyBundleBuildMojo.java
@@ -153,6 +153,13 @@ public class ThirdPartyBundleBuildMojo extends AbstractMojo {
*/
private ArtifactResolver artifactResolver;
+ /**
+ * The bundle symbolic name
+ *
+ * @parameter
+ */
+ private String symbolicName;
+
public void execute() throws MojoExecutionException {
Log log = getLog();
@@ -232,7 +239,7 @@ public class ThirdPartyBundleBuildMojo extends AbstractMojo {
version = version.substring(0, version.length() - Artifact.SNAPSHOT_VERSION.length() - 1);
}
- Manifest mf = BundleUtil.libraryManifest(jarFiles, project.getName(), version);
+ Manifest mf = BundleUtil.libraryManifest(jarFiles, project.getName(), symbolicName, version);
File file = new File(project.getBasedir(), "META-INF");
file.mkdir();
file= new File(file, "MANIFEST.MF");
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 7f4ba1a284..159949242d 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
@@ -80,6 +80,9 @@ public class ThirdPartyBundleClasspathGeneratorMojo extends AbstractMojo {
try {
// Adjust .classpath, make all classpath entries point to the lib directory
File classpath = new File(basedir, ".classpath");
+ if (!classpath.exists()) {
+ return;
+ }
BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(classpath)));
StringWriter buffer = new StringWriter();
PrintWriter printer = new PrintWriter(buffer);