servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r573568 - /incubator/servicemix/trunk/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/GenerateServiceAssemblyDescriptorMojo.java
Date Fri, 07 Sep 2007 13:12:48 GMT
Author: gnodet
Date: Fri Sep  7 06:12:47 2007
New Revision: 573568

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

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

Modified: incubator/servicemix/trunk/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/GenerateServiceAssemblyDescriptorMojo.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/GenerateServiceAssemblyDescriptorMojo.java?rev=573568&r1=573567&r2=573568&view=diff
==============================================================================
--- incubator/servicemix/trunk/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/GenerateServiceAssemblyDescriptorMojo.java
(original)
+++ incubator/servicemix/trunk/tooling/jbi-maven-plugin/src/main/java/org/apache/servicemix/maven/plugin/jbi/GenerateServiceAssemblyDescriptorMojo.java
Fri Sep  7 06:12:47 2007
@@ -332,6 +332,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