geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r349830 [4/4] - in /geronimo/trunk: applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/ applications/console-standard/src/webapp/WEB-INF/view/realmwizard/ applications/demo/src/webapp/WEB-INF/ applicat...
Date Tue, 29 Nov 2005 23:15:48 GMT
Modified: geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/repository/FileSystemRepository.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/repository/FileSystemRepository.java?rev=349830&r1=349829&r2=349830&view=diff
==============================================================================
--- geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/repository/FileSystemRepository.java
(original)
+++ geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/repository/FileSystemRepository.java
Tue Nov 29 15:14:42 2005
@@ -31,6 +31,8 @@
 import java.util.List;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.regex.Pattern;
+import java.util.regex.Matcher;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -59,9 +61,9 @@
     private File rootFile;
 
     public FileSystemRepository(URI root, ServerInfo serverInfo) {
-        if(!root.toString().endsWith("/")) {
+        if (!root.toString().endsWith("/")) {
             try {
-                root = new URI(root.toString()+"/");
+                root = new URI(root.toString() + "/");
             } catch (URISyntaxException e) {
                 throw new RuntimeException("Invalid repository root (does not end with /
) and can't add myself", e);
             }
@@ -71,7 +73,7 @@
     }
 
     public boolean hasURI(URI uri) {
-        uri = rootURI.resolve(uri);
+        uri = resolve(uri);
         if ("file".equals(uri.getScheme())) {
             File f = new File(uri);
             return f.exists() && f.canRead();
@@ -81,35 +83,59 @@
     }
 
     public URL getURL(URI uri) throws MalformedURLException {
-        URL url = rootURI.resolve(uri).toURL();
-        if(!url.getProtocol().equals("file")) {
+        URL url = resolve(uri).toURL();
+        if (!url.getProtocol().equals("file")) {
             return null;
         }
         return url;
     }
 
+    private URI resolve(final URI uri) {
+        String[] bits = uri.toString().split("/");
+        StringBuffer buf = new StringBuffer(bits[0]).append('/');
+        String type = bits.length >= 4 ? bits[3] : "jar";
+        buf.append(type).append('s').append('/').append(bits[1]).append('-').append(bits[2]).append('.').append(type);
+        return rootURI.resolve(buf.toString());
+    }
+
+
+    //thanks to Brett Porter for this regex lifted from a maven1-2 porting tool
+    private static final Pattern pattern = Pattern.compile("(.+)/(.+)s/(.+)-([0-9].+)\\.([^0-9]+)");
+
     public URI[] listURIs() throws URISyntaxException {
         String[] results = getFiles(rootFile, "");
         URI[] out = new URI[results.length];
+        Matcher matcher = pattern.matcher("");
         for (int i = 0; i < out.length; i++) {
-            out[i] = new URI(results[i]);
+            matcher.reset(results[i]);
+            if (matcher.matches()) {
+                String groupId = matcher.group(1);
+                String artifactId = matcher.group(3);
+                String version = matcher.group(4);
+                String type = matcher.group(5);
+                StringBuffer buf = new StringBuffer(groupId).append("/").append(artifactId).append("/").append(version).append("/").append(type);
+                out[i] = new URI(buf.toString());
+            } else {
+                //??
+            }
+
         }
         return out;
     }
 
     public String[] getFiles(File base, String prefix) {
-        if(!base.canRead() || !base.isDirectory()) {
+        if (!base.canRead() || !base.isDirectory()) {
             throw new IllegalArgumentException(base.getAbsolutePath());
         }
         List list = new ArrayList();
         File[] hits = base.listFiles();
         for (int i = 0; i < hits.length; i++) {
             File hit = hits[i];
-            if(hit.canRead()) {
-                if(hit.isDirectory()) {
-                    list.addAll(Arrays.asList(getFiles(hit, prefix.equals("") ? hit.getName()
: prefix+"/"+hit.getName())));
+            if (hit.canRead()) {
+                if (hit.isDirectory()) {
+                    list.addAll(Arrays.asList(getFiles(hit, prefix.equals("") ? hit.getName()
: prefix + "/" + hit.getName())));
                 } else {
-                    list.add(prefix.equals("") ? hit.getName() : prefix+"/"+hit.getName());
+                    list.add(prefix.equals("") ? hit.getName() : prefix + "/" + hit.getName());
                 }
             }
         }
@@ -117,22 +143,22 @@
     }
 
     public void copyToRepository(File source, URI destination, FileWriteMonitor monitor)
throws IOException {
-        if(!source.exists() || !source.canRead() || source.isDirectory()) {
-            throw new IllegalArgumentException("Cannot read source file at "+source.getAbsolutePath());
+        if (!source.exists() || !source.canRead() || source.isDirectory()) {
+            throw new IllegalArgumentException("Cannot read source file at " + source.getAbsolutePath());
         }
         copyToRepository(new FileInputStream(source), destination, monitor);
     }
 
     public void copyToRepository(InputStream source, URI destination, FileWriteMonitor monitor)
throws IOException {
-        File dest = new File(rootURI.resolve(destination));
-        if(dest.exists()) {
-            throw new IllegalArgumentException("Destination "+dest.getAbsolutePath()+" already
exists!");
+        File dest = new File(resolve(destination));
+        if (dest.exists()) {
+            throw new IllegalArgumentException("Destination " + dest.getAbsolutePath() +
" already exists!");
         }
         final File parent = dest.getParentFile();
-        if(!parent.exists() && !parent.mkdirs()) {
-            throw new RuntimeException("Unable to create directories from "+rootFile.getAbsolutePath()+"
to "+parent.getAbsolutePath());
+        if (!parent.exists() && !parent.mkdirs()) {
+            throw new RuntimeException("Unable to create directories from " + rootFile.getAbsolutePath()
+ " to " + parent.getAbsolutePath());
         }
-        if(monitor != null) {
+        if (monitor != null) {
             monitor.writeStarted(destination.toString());
         }
         int total = 0;
@@ -142,11 +168,11 @@
             BufferedInputStream in = new BufferedInputStream(source);
             byte[] buf = new byte[TRANSFER_BUF_SIZE];
             int count;
-            while((count = in.read(buf)) > -1) {
+            while ((count = in.read(buf)) > -1) {
                 out.write(buf, 0, count);
-                if(monitor != null) {
+                if (monitor != null) {
                     total += count;
-                    if(total > threshold) {
+                    if (total > threshold) {
                         threshold += TRANSFER_NOTIFICATION_SIZE;
                         monitor.writeProgress(total);
                     }
@@ -156,7 +182,7 @@
             out.close();
             in.close();
         } finally {
-            if(monitor != null) {
+            if (monitor != null) {
                 monitor.writeComplete(total);
             }
         }
@@ -169,12 +195,12 @@
             } else {
                 rootURI = root;
             }
-            if(!rootURI.getScheme().equals("file")) {
-                throw new IllegalStateException("FileSystemRepository must have a root that's
a local directory (not "+rootURI+")");
+            if (!rootURI.getScheme().equals("file")) {
+                throw new IllegalStateException("FileSystemRepository must have a root that's
a local directory (not " + rootURI + ")");
             }
             rootFile = new File(rootURI);
-            if(!rootFile.exists() || !rootFile.isDirectory() || !rootFile.canRead() || !rootFile.canWrite())
{
-                throw new IllegalStateException("FileSystemRepository must have a root that's
a valid writable directory (not "+rootFile.getAbsolutePath()+")");
+            if (!rootFile.exists() || !rootFile.isDirectory() || !rootFile.canRead() || !rootFile.canWrite())
{
+                throw new IllegalStateException("FileSystemRepository must have a root that's
a valid writable directory (not " + rootFile.getAbsolutePath() + ")");
             }
         }
         log.debug("Repository root is " + rootFile.getAbsolutePath());

Modified: geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/repository/ReadOnlyRepository.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/repository/ReadOnlyRepository.java?rev=349830&r1=349829&r2=349830&view=diff
==============================================================================
--- geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/repository/ReadOnlyRepository.java
(original)
+++ geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/repository/ReadOnlyRepository.java
Tue Nov 29 15:14:42 2005
@@ -56,7 +56,7 @@
     }
 
     public boolean hasURI(URI uri) {
-        uri = rootURI.resolve(uri);
+        uri = resolve(uri);
         if ("file".equals(uri.getScheme())) {
             File f = new File(uri);
             return f.exists() && f.canRead();
@@ -71,9 +71,17 @@
     }
 
     public URL getURL(URI uri) throws MalformedURLException {
-        return rootURI.resolve(uri).toURL();
+        return resolve(uri).toURL();
     }
 
+    private URI resolve(final URI uri) {
+        String[] bits = uri.toString().split("/");
+        StringBuffer buf = new StringBuffer(bits[0]).append('/');
+        String type = bits.length >= 4? bits[3]: "jar";
+        buf.append(type).append('s').append('/').append(bits[1]).append('-').append(bits[2]).append('.').append(type);
+        return rootURI.resolve(buf.toString());
+    }
+    
     public void doStart() throws Exception {
         if (rootURI == null) {
             rootURI = serverInfo.resolve(root);

Modified: geronimo/trunk/plugins/geronimo-assembly-plugin/plugin.jelly
URL: http://svn.apache.org/viewcvs/geronimo/trunk/plugins/geronimo-assembly-plugin/plugin.jelly?rev=349830&r1=349829&r2=349830&view=diff
==============================================================================
--- geronimo/trunk/plugins/geronimo-assembly-plugin/plugin.jelly (original)
+++ geronimo/trunk/plugins/geronimo-assembly-plugin/plugin.jelly Tue Nov 29 15:14:42 2005
@@ -33,7 +33,7 @@
         <define:jellybean name="installConfigToRepo" className="org.apache.geronimo.plugin.assembly.RepoConfigInstaller"
method="execute"/>
     </define:taglib>
 
-    <goal name="geronimo:assemble-prepare">
+    <goal name="assemble:assemble-prepare">
         <ant:mkdir dir="${geronimo.assembly.dest}"/>
         <ant:copy todir="${geronimo.assembly.dest}">
             <ant:fileset dir="${geronimo.assembly.src}"/>
@@ -42,7 +42,7 @@
         <velocity:merge basedir="${geronimo.assembly.src}/var/config" template="config.xml"
name="${geronimo.assembly.dest}/var/config/config.xml"/>
     </goal>
 
-    <goal name="geronimo:assemble-lib">
+    <goal name="assemble:assemble-lib">
         <ant:mkdir dir="${geronimo.assembly.dest}/lib"/>
         <ant:copy todir="${geronimo.assembly.dest}/lib" flatten="true">
             <ant:fileset dir="${maven.repo.local}">
@@ -89,7 +89,7 @@
         </ant:copy>
     </goal>
 
-    <goal name="geronimo:assemble-repository">
+    <goal name="assemble:assemble-repository">
         <ant:mkdir dir="${geronimo.assembly.dest}/repository"/>
         <ant:copy todir="${geronimo.assembly.dest}/repository">
             <ant:fileset dir="${maven.repo.local}">
@@ -104,9 +104,9 @@
     </goal>
 
     <!-- todo automatically add libraries listed in an executable's MCP in the right place,
relative to it -->
-    <goal name="geronimo:assemble-configurations">
+    <goal name="assemble:assemble-configurations">
         <j:set var="configStoreDir" value="${geronimo.assembly.dest}/config-store"/>
-        <ant:delete dir="${configStoreDir}"/>
+<!--        <ant:delete dir="${configStoreDir}"/>-->
         <ant:mkdir dir="${configStoreDir}"/>
         <ant:mkdir dir="${geronimo.assembly.dest}/repository"/>
         <j:forEach var="artifact" items="${pom.artifacts}">
@@ -118,7 +118,7 @@
                         targetConfigStore="config-store"
                         targetRepository="repository"
                         sourceRepository="${maven.repo.local}"
-                        artifact="${dependency.getArtifactDirectory()}/${dependency.getType()}s/${dependency.getArtifact()}"/>
+                        artifact="${dependency.getGroupId()}/${dependency.getArtifactId()}/${dependency.getVersion()}/${dependency.getType()}"/>
                 </j:if>
 
                 <!-- handle executable configs -->
@@ -131,9 +131,9 @@
         </j:forEach>
     </goal>
 
-    <goal name="geronimo:assemble-configurations-to-repo">
+    <goal name="assemble:assemble-configurations-to-repo">
         <j:set var="configStoreDir" value="${geronimo.assembly.dest}/config-store"/>
-        <ant:delete dir="${configStoreDir}"/>
+<!--        <ant:delete dir="${configStoreDir}"/>-->
         <ant:mkdir dir="${configStoreDir}"/>
         <ant:mkdir dir="${geronimo.assembly.dest}/repository"/>
         <j:forEach var="artifact" items="${pom.artifacts}">
@@ -158,23 +158,23 @@
         </j:forEach>
     </goal>
 
-    <goal name="geronimo:assemble" prereqs="geronimo:assemble-prepare" description="Assemble
a Geronimo installation">
-        <attainGoal name="geronimo:assemble-repository"/>
-        <attainGoal name="geronimo:assemble-lib"/>
-        <attainGoal name="geronimo:assemble-configurations"/>
+    <goal name="assemble:assemble" prereqs="assemble:assemble-prepare" description="Assemble
a Geronimo installation">
+        <attainGoal name="assemble:assemble-repository"/>
+        <attainGoal name="assemble:assemble-lib"/>
+        <attainGoal name="assemble:assemble-configurations"/>
     </goal>
 
-    <goal name="geronimo:assemble-to-repo" prereqs="geronimo:assemble-prepare" description="Assemble
a Geronimo installation">
-        <attainGoal name="geronimo:assemble-repository"/>
-        <attainGoal name="geronimo:assemble-lib"/>
-        <attainGoal name="geronimo:assemble-configurations-to-repo"/>
+    <goal name="assemble:assemble-to-repo" prereqs="assemble:assemble-prepare" description="Assemble
a Geronimo installation">
+        <attainGoal name="assemble:assemble-repository"/>
+        <attainGoal name="assemble:assemble-lib"/>
+        <attainGoal name="assemble:assemble-configurations-to-repo"/>
     </goal>
 
-    <goal name="geronimo:jar-assembly" prereqs="geronimo:assemble">
+    <goal name="assemble:jar-assembly" prereqs="assemble:assemble">
         <ant:jar jarfile="${maven.build.dir}/${maven.final.name}.jar" basedir="${geronimo.assembly.dest}"/>
     </goal>
 
-    <goal name="geronimo:package-assembly" prereqs="geronimo:assemble" description="Build
the binary distribution.">
+    <goal name="assemble:package-assembly" prereqs="assemble:assemble" description="Build
the binary distribution.">
         <!-- Create a tar.gz file -->
         <j:if test="${context.getVariable('geronimo.assembly.tar') == 'true'}">
             <ant:tar longfile="gnu" compression="gzip" tarfile="${maven.build.dir}/${maven.final.name}.tar.gz">
@@ -201,7 +201,7 @@
     </goal>
 
     <!-- Maven artifict tags are broken so we must copy by hand -->
-    <goal name="geronimo:install-assembly" description="Deploy a binary distribution"
prereqs="geronimo:package-assembly">
+    <goal name="assemble:install-assembly" description="Deploy a binary distribution"
prereqs="assemble:package-assembly">
         <j:if test="${context.getVariable('geronimo.assembly.tar') == 'true'}">
             <ant:mkdir dir="${maven.repo.local}/${pom.groupId}/distributions"/>
             <ant:copy file="${maven.build.dir}/${maven.final.name}.tar.gz"

Modified: geronimo/trunk/plugins/geronimo-assembly-plugin/src/java/org/apache/geronimo/plugin/assembly/BaseConfigInstaller.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/plugins/geronimo-assembly-plugin/src/java/org/apache/geronimo/plugin/assembly/BaseConfigInstaller.java?rev=349830&r1=349829&r2=349830&view=diff
==============================================================================
--- geronimo/trunk/plugins/geronimo-assembly-plugin/src/java/org/apache/geronimo/plugin/assembly/BaseConfigInstaller.java
(original)
+++ geronimo/trunk/plugins/geronimo-assembly-plugin/src/java/org/apache/geronimo/plugin/assembly/BaseConfigInstaller.java
Tue Nov 29 15:14:42 2005
@@ -21,6 +21,7 @@
 import java.io.InputStream;
 import java.net.URI;
 import java.net.URL;
+import java.net.MalformedURLException;
 import java.util.Iterator;
 import java.util.List;
 
@@ -141,6 +142,42 @@
 
         public void writeComplete(int bytes) {
 
+        }
+    }
+
+    protected class InnerRepository implements Repository {
+
+        public boolean hasURI(URI uri) {
+            uri = resolve(uri);
+            if ("file".equals(uri.getScheme())) {
+                return new File(uri).canRead();
+            } else {
+                try {
+                    uri.toURL().openStream().close();
+                    return true;
+                } catch (IOException e) {
+                    return false;
+                }
+            }
+        }
+
+        public URL getURL(URI uri) throws MalformedURLException {
+            uri = resolve(uri);
+            return uri.toURL();
+        }
+
+        /**
+         * todo if the uri has a scheme, don't dissect it.
+         *
+         * @param uri
+         * @return
+         */
+        private URI resolve(final URI uri) {
+            String[] bits = uri.toString().split("/");
+            StringBuffer buf = new StringBuffer(bits[0]).append('/');
+            String type = bits.length >= 4 ? bits[3] : "jar";
+            buf.append(type).append('s').append('/').append(bits[1]).append('-').append(bits[2]).append('.').append(type);
+            return sourceRepositoryURI.resolve(buf.toString());
         }
     }
 }

Modified: geronimo/trunk/plugins/geronimo-assembly-plugin/src/java/org/apache/geronimo/plugin/assembly/LocalConfigInstaller.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/plugins/geronimo-assembly-plugin/src/java/org/apache/geronimo/plugin/assembly/LocalConfigInstaller.java?rev=349830&r1=349829&r2=349830&view=diff
==============================================================================
--- geronimo/trunk/plugins/geronimo-assembly-plugin/src/java/org/apache/geronimo/plugin/assembly/LocalConfigInstaller.java
(original)
+++ geronimo/trunk/plugins/geronimo-assembly-plugin/src/java/org/apache/geronimo/plugin/assembly/LocalConfigInstaller.java
Tue Nov 29 15:14:42 2005
@@ -50,27 +50,7 @@
                 return dependencies;
             }
         };
-        Repository sourceRepo = new Repository() {
-
-            public boolean hasURI(URI uri) {
-                uri = sourceRepositoryURI.resolve(uri);
-                if ("file".equals(uri.getScheme())) {
-                    return new File(uri).canRead();
-                } else {
-                    try {
-                        uri.toURL().openStream().close();
-                        return true;
-                    } catch (IOException e) {
-                        return false;
-                    }
-                }
-            }
-
-            public URL getURL(URI uri) throws MalformedURLException {
-                uri = sourceRepositoryURI.resolve(uri);
-                return uri.toURL();
-            }
-        };
+        Repository sourceRepo = new InnerRepository();
         URI rootURI = targetRoot.toURI().resolve(targetRepository);
         FileSystemRepository targetRepo = new FileSystemRepository(rootURI, null);
         targetRepo.doStart();

Modified: geronimo/trunk/plugins/geronimo-assembly-plugin/src/java/org/apache/geronimo/plugin/assembly/RepoConfigInstaller.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/plugins/geronimo-assembly-plugin/src/java/org/apache/geronimo/plugin/assembly/RepoConfigInstaller.java?rev=349830&r1=349829&r2=349830&view=diff
==============================================================================
--- geronimo/trunk/plugins/geronimo-assembly-plugin/src/java/org/apache/geronimo/plugin/assembly/RepoConfigInstaller.java
(original)
+++ geronimo/trunk/plugins/geronimo-assembly-plugin/src/java/org/apache/geronimo/plugin/assembly/RepoConfigInstaller.java
Tue Nov 29 15:14:42 2005
@@ -40,27 +40,7 @@
 public class RepoConfigInstaller extends BaseConfigInstaller {
 
     public void execute() throws Exception {
-        Repository sourceRepo = new Repository() {
-
-            public boolean hasURI(URI uri) {
-                uri = sourceRepositoryURI.resolve(uri);
-                if ("file".equals(uri.getScheme())) {
-                    return new File(uri).canRead();
-                } else {
-                    try {
-                        uri.toURL().openStream().close();
-                        return true;
-                    } catch (IOException e) {
-                        return false;
-                    }
-                }
-            }
-
-            public URL getURL(URI uri) throws MalformedURLException {
-                uri = sourceRepositoryURI.resolve(uri);
-                return uri.toURL();
-            }
-        };
+        Repository sourceRepo = new InnerRepository();
         URI rootURI = targetRoot.toURI().resolve(targetRepository);
         FileSystemRepository targetRepo = new FileSystemRepository(rootURI, null);
         InstallAdapter installAdapter = new CopyConfigStore(targetRepo);

Modified: geronimo/trunk/plugins/geronimo-deployment-plugin/plugin.jelly
URL: http://svn.apache.org/viewcvs/geronimo/trunk/plugins/geronimo-deployment-plugin/plugin.jelly?rev=349830&r1=349829&r2=349830&view=diff
==============================================================================
--- geronimo/trunk/plugins/geronimo-deployment-plugin/plugin.jelly (original)
+++ geronimo/trunk/plugins/geronimo-deployment-plugin/plugin.jelly Tue Nov 29 15:14:42 2005
@@ -58,14 +58,17 @@
             <j:if test="${geronimoVersion == null}">
                 <fail>Missing required attribute: geronimoVersion</fail>
             </j:if>
-            <j:if test="${geronimoName == null}">
-                <j:set var="geronimoName" value="geronimo"/>
+            <j:if test="${geronimoGroupId == null}">
+                <j:set var="geronimoGroupId" value="geronimo"/>
+            </j:if>
+            <j:if test="${geronimoArtifactId == null}">
+                <j:set var="geronimoArtifactId" value="geronimo"/>
             </j:if>
             <j:if test="${targetDir == null}">
                 <j:set var="targetDir" value="${maven.build.dir}"/>
             </j:if>
 
-            <unzip dest="${maven.build.dir}" src="${maven.repo.local}/${geronimoName}/distributions/${geronimoName}-${geronimo_version}.zip"/>
+            <unzip dest="${maven.build.dir}" src="${maven.repo.local}/${geronimoGroupId}/distributions/${geronimoArtifactId}-${geronimoVersion}.zip"/>
 
             <!--copy stuff for this project into new geronimo repository-->
             <!-- this code deals with jar overrides correctly -->

Modified: geronimo/trunk/plugins/geronimo-deployment-plugin/plugin.properties
URL: http://svn.apache.org/viewcvs/geronimo/trunk/plugins/geronimo-deployment-plugin/plugin.properties?rev=349830&r1=349829&r2=349830&view=diff
==============================================================================
--- geronimo/trunk/plugins/geronimo-deployment-plugin/plugin.properties (original)
+++ geronimo/trunk/plugins/geronimo-deployment-plugin/plugin.properties Tue Nov 29 15:14:42
2005
@@ -19,5 +19,7 @@
 ## $Rev: 45927 $ $Date: 2004-09-11 16:29:34 -0700 (Sat, 11 Sep 2004) $
 ##
 
-
+geronimoGroupId=geronimo
+geronimoArtifactId=geronimo
+geronimoVersion=1.0-SNAPSHOT
 geronimo.deploy.var.source=src/var

Modified: geronimo/trunk/plugins/geronimo-packaging-plugin/plugin.properties
URL: http://svn.apache.org/viewcvs/geronimo/trunk/plugins/geronimo-packaging-plugin/plugin.properties?rev=349830&r1=349829&r2=349830&view=diff
==============================================================================
--- geronimo/trunk/plugins/geronimo-packaging-plugin/plugin.properties (original)
+++ geronimo/trunk/plugins/geronimo-packaging-plugin/plugin.properties Tue Nov 29 15:14:42
2005
@@ -19,14 +19,16 @@
 ## $Rev$ $Date$
 ##
 
+geronimo.packaging.geronimo_version=1.0-SNAPSHOT
+
 geronimo.packaging.srcDir=${basedir}/src/plan
 geronimo.packaging.planFile=plan.xml
 geronimo.packaging.buildDir=${maven.build.dir}/plan
 geronimo.packaging.buildFile=${geronimo.packaging.buildDir}/${geronimo.packaging.planFile}
 
 geronimo.packaging.repository=${maven.repo.local}
-geronimo.packaging.deploymentConfig=${pom.groupId}/cars/j2ee-deployer-${pom.currentVersion}.car
-geronimo.packaging.deployerName=geronimo.maven:name=Deployer,j2eeType=Deployer,J2EEModule=${pom.groupId}/cars/geronimo-gbean-deployer-${pom.currentVersion}.car,*
+geronimo.packaging.deploymentConfig=geronimo/geronimo-gbean-deployer/${geronimo.packaging.geronimo_version}/car,geronimo/j2ee-deployer/${geronimo.packaging.geronimo_version}/car
+geronimo.packaging.deployerName=geronimo.maven:name=Deployer,j2eeType=Deployer,J2EEModule=geronimo/geronimo-gbean-deployer/${geronimo.packaging.geronimo_version}/car,*
 
 geronimo.packaging.user=system
 geronimo.packaging.password=manager

Modified: geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/MavenRepository.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/MavenRepository.java?rev=349830&r1=349829&r2=349830&view=diff
==============================================================================
--- geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/MavenRepository.java
(original)
+++ geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/MavenRepository.java
Tue Nov 29 15:14:42 2005
@@ -32,14 +32,14 @@
  * @version $Rev$ $Date$
  */
 public class MavenRepository implements Repository {
-    private final URI root;
+    private final URI rootURI;
 
     public MavenRepository(File root) {
-        this.root = root.toURI();
+        this.rootURI = root.toURI();
     }
 
     public boolean hasURI(URI uri) {
-        uri = root.resolve(uri);
+        uri = resolve(uri);
         if ("file".equals(uri.getScheme())) {
             return new File(uri).canRead();
         } else {
@@ -53,8 +53,21 @@
     }
 
     public URL getURL(URI uri) throws MalformedURLException {
-        uri = root.resolve(uri);
+        uri = resolve(uri);
         return uri.toURL();
+    }
+
+    /**
+     * todo if the uri has a scheme, don't dissect it.
+     * @param uri
+     * @return
+     */
+    private URI resolve(final URI uri) {
+        String[] bits = uri.toString().split("/");
+        StringBuffer buf = new StringBuffer(bits[0]).append('/');
+        String type = bits.length >= 4? bits[3]: "jar";
+        buf.append(type).append('s').append('/').append(bits[1]).append('-').append(bits[2]).append('.').append(type);
+        return rootURI.resolve(buf.toString());
     }
 
     public static final GBeanInfo GBEAN_INFO;



Mime
View raw message