geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r354678 - /geronimo/trunk/modules/service-builder/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java
Date Wed, 07 Dec 2005 02:54:44 GMT
Author: djencks
Date: Tue Dec  6 18:54:42 2005
New Revision: 354678

URL: http://svn.apache.org/viewcvs?rev=354678&view=rev
Log:
GERONIMO-1305. Fix includes

Modified:
    geronimo/trunk/modules/service-builder/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java

Modified: geronimo/trunk/modules/service-builder/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/service-builder/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java?rev=354678&r1=354677&r2=354678&view=diff
==============================================================================
--- geronimo/trunk/modules/service-builder/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java
(original)
+++ geronimo/trunk/modules/service-builder/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java
Tue Dec  6 18:54:42 2005
@@ -255,11 +255,7 @@
         for (int i = 0; i < includes.length; i++) {
             DependencyType include = includes[i];
             URI uri = getDependencyURI(include, repository);
-            String name = uri.toString();
-            int idx = name.lastIndexOf('/');
-            if (idx != -1) {
-                name = name.substring(idx + 1);
-            }
+            String name = getDependencyFileName(include);
             URI path;
             try {
                 path = new URI(name);
@@ -429,6 +425,20 @@
             }
         }
         return uri;
+    }
+    
+    private static String getDependencyFileName(DependencyType dep) throws DeploymentException
{
+        String name;
+        if (dep.isSetUri()) {
+        	name = dep.getUri().trim();
+        } else {
+            String groupId = dep.getGroupId().trim();
+            String type = dep.isSetType() ? dep.getType().trim() : "jar";
+            String artifactId = dep.getArtifactId().trim();
+            String version = dep.getVersion().trim();
+            name = artifactId + "-" + version + "." + type;
+        }
+        return name;
     }
 
     public static final GBeanInfo GBEAN_INFO;



Mime
View raw message