servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r573570 - /incubator/servicemix/branches/servicemix-3.1/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/GenerateServiceAssemblyDescriptorMojo.java
Date Fri, 07 Sep 2007 13:14:59 GMT
Author: gnodet
Date: Fri Sep  7 06:14:54 2007
New Revision: 573570

URL: http://svn.apache.org/viewvc?rev=573570&view=rev
Log:
SM-1045: Accept property replacement when generating SA descriptor

Modified:
    incubator/servicemix/branches/servicemix-3.1/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/GenerateServiceAssemblyDescriptorMojo.java

Modified: incubator/servicemix/branches/servicemix-3.1/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/GenerateServiceAssemblyDescriptorMojo.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/servicemix-3.1/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/GenerateServiceAssemblyDescriptorMojo.java?rev=573570&r1=573569&r2=573570&view=diff
==============================================================================
--- incubator/servicemix/branches/servicemix-3.1/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/GenerateServiceAssemblyDescriptorMojo.java
(original)
+++ incubator/servicemix/branches/servicemix-3.1/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/GenerateServiceAssemblyDescriptorMojo.java
Fri Sep  7 06:14:54 2007
@@ -345,6 +345,19 @@
 		List orderedServiceUnits = new ArrayList();
 		while (dependencies.hasNext()) {
 			Dependency dependency = (Dependency) dependencies.next();
+ 			if (dependency.getArtifactId().contains("${")) {
+ 				int first = dependency.getArtifactId().indexOf("${");
+ 				int last  = dependency.getArtifactId().indexOf("}");
+  				String property = dependency.getArtifactId().substring(first + 2, last);
+  				Object propValue = project.getProperties().get(property);
+ 				if (propValue == null) {
+ 					throw new MojoExecutionException("The value for the property " + property + "is not
set."
+ 							+ "Jbi descriptor may not be generated properly");
+ 				}
+ 				String propString = (String) propValue;
+ 				String artifactID = dependency.getArtifactId().replace("${" + property + "}", propString);
+ 				dependency.setArtifactId(artifactID);
+ 			}
 			for (Iterator it = serviceUnits.iterator(); it.hasNext();) {
 				DependencyInformation serviceUnitInfo = (DependencyInformation) it
 						.next();



Mime
View raw message