You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by db...@apache.org on 2006/10/26 05:14:44 UTC

svn commit: r467848 - in /geronimo/xbean/trunk/xbean-finder/src: main/java/org/apache/xbean/finder/ test/java/org/acme/foo/ test/java/org/apache/xbean/finder/

Author: dblevins
Date: Wed Oct 25 20:14:43 2006
New Revision: 467848

URL: http://svn.apache.org/viewvc?view=rev&rev=467848
Log:
Added a finder for locating classes in a classloader that have an annotation or implement an interface

Added:
    geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/ClassFinder.java
    geronimo/xbean/trunk/xbean-finder/src/test/java/org/acme/foo/
    geronimo/xbean/trunk/xbean-finder/src/test/java/org/acme/foo/Blue.java
    geronimo/xbean/trunk/xbean-finder/src/test/java/org/acme/foo/Color.java
    geronimo/xbean/trunk/xbean-finder/src/test/java/org/acme/foo/Green.java
    geronimo/xbean/trunk/xbean-finder/src/test/java/org/acme/foo/Halloween.java
    geronimo/xbean/trunk/xbean-finder/src/test/java/org/acme/foo/Holiday.java
    geronimo/xbean/trunk/xbean-finder/src/test/java/org/acme/foo/Primary.java
    geronimo/xbean/trunk/xbean-finder/src/test/java/org/acme/foo/Red.java
    geronimo/xbean/trunk/xbean-finder/src/test/java/org/acme/foo/Thanksgiving.java
    geronimo/xbean/trunk/xbean-finder/src/test/java/org/acme/foo/ValentinesDay.java
    geronimo/xbean/trunk/xbean-finder/src/test/java/org/apache/xbean/finder/ClassFinderTest.java
Modified:
    geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/ResourceFinder.java

Added: geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/ClassFinder.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/ClassFinder.java?view=auto&rev=467848
==============================================================================
--- geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/ClassFinder.java (added)
+++ geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/ClassFinder.java Wed Oct 25 20:14:43 2006
@@ -0,0 +1,185 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.xbean.finder;
+
+import java.lang.annotation.Annotation;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Collection;
+import java.util.Arrays;
+import java.util.jar.JarEntry;
+import java.util.jar.JarInputStream;
+import java.io.IOException;
+import java.io.File;
+import java.io.InputStream;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class ClassFinder {
+    private final ClassLoader classLoader;
+    private final List<Class> classes;
+    private final List<String> classesNotLoaded = new ArrayList();
+
+    public ClassFinder(ClassLoader classLoader) throws Exception {
+        this(classLoader, excludeParentUrls(classLoader));
+    }
+
+    public ClassFinder(ClassLoader classLoader, URL url) {
+        this(classLoader, Arrays.asList(new URL[]{url}));
+    }
+
+    public ClassFinder(ClassLoader classLoader, Collection<URL> urls) {
+        this.classLoader = classLoader;
+
+        List<String> classNames = new ArrayList();
+        for (URL location : urls) {
+            try {
+                if (location.getProtocol().equals("jar")) {
+                    classNames.addAll(jar(location));
+                } else if (location.getProtocol().equals("file")) {
+                    classNames.addAll(file(location));
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+
+        classes = new ArrayList();
+        for (String className : classNames) {
+            try {
+                Class clazz = classLoader.loadClass(className);
+                classes.add(clazz);
+            } catch (ClassNotFoundException e) {
+                classesNotLoaded.add(className);
+            } catch (NoClassDefFoundError e) {
+                classesNotLoaded.add(className);
+            }
+        }
+    }
+
+    public List<String> getClassesNotLoaded() {
+        return classesNotLoaded;
+    }
+
+    public List<Class> findAnnotatedClasses(Class<? extends Annotation> annotation) {
+        List<Class> allClasses = getClasses();
+        List<Class> classes = new ArrayList<Class>();
+        for (Class clazz : allClasses) {
+            if (clazz.isAnnotationPresent(annotation)) {
+                classes.add(clazz);
+            }
+        }
+        return classes;
+    }
+
+    public Map<Class<? extends Annotation>,List<Class>> mapAnnotatedClasses() {
+        List<Class> allClasses = getClasses();
+        Map<Class<? extends Annotation>,List<Class>> mappedClasses = new HashMap();
+        for (Class clazz : allClasses) {
+            if (Annotation.class.isAssignableFrom(clazz)){
+                continue;
+            }
+            for (Annotation annotation : clazz.getAnnotations()) {
+                Class<? extends Annotation> annotationType = annotation.annotationType();
+                List<Class> classes = mappedClasses.get(annotationType);
+                if (classes == null){
+                    classes = new ArrayList();
+                    mappedClasses.put(annotationType, classes);
+                }
+                classes.add(clazz);
+            }
+        }
+        return mappedClasses;
+    }
+
+    public List<Class> getClasses() {
+        return this.classes;
+    }
+
+    private static Collection<URL> excludeParentUrls(ClassLoader classLoader) throws IOException {
+        ClassLoader parent = classLoader.getParent();
+        Map<String,URL> parentUrls = toMap(parent.getResources("META-INF"));
+        Map<String,URL> urls = toMap(classLoader.getResources("META-INF"));
+
+        for (String url : parentUrls.keySet()) {
+            urls.remove(url);
+        }
+
+        return urls.values();
+    }
+
+    private static Map<String,URL> toMap(Enumeration<URL> enumeration){
+        Map<String,URL> urls = new HashMap();
+        while (enumeration.hasMoreElements()) {
+            URL url = enumeration.nextElement();
+            urls.put(url.toExternalForm(), url);
+        }
+        return urls;
+    }
+
+    private List<String> file(URL location) {
+        List<String> classNames = new ArrayList();
+        File dir = new File(location.getPath());
+        if (dir.getName().equals("META-INF")){
+            dir = dir.getParentFile(); // Scrape "META-INF" off
+        }
+        if (dir.isDirectory()) {
+            scanDir(dir, classNames, "");
+        }
+        return classNames;
+    }
+
+    private void scanDir(File dir, List<String> classNames, String packageName) {
+        File[] files = dir.listFiles();
+        for (File file : files) {
+            if (file.isDirectory()){
+                scanDir(file, classNames, packageName + file.getName() + ".");
+            } else if (file.getName().endsWith(".class")) {
+                String name = file.getName();
+                name = name.replaceFirst(".class$","");
+                classNames.add(packageName + name);
+            }
+        }
+    }
+
+    private List<String> jar(URL location) throws IOException {
+        List<String> classNames = new ArrayList();
+
+        String jarPath = location.getFile().replaceFirst("./META-INF","");
+        URL url = new URL(jarPath);
+        InputStream in = url.openStream();
+        JarInputStream jarStream = new JarInputStream(in);
+
+        JarEntry entry;
+        while ((entry = jarStream.getNextJarEntry()) != null) {
+            if (entry.isDirectory() || !entry.getName().endsWith(".class")) {
+                continue;
+            }
+            String className = entry.getName();
+            className = className.replaceFirst(".class$","");
+            className = className.replace('/','.');
+            classNames.add(className);
+        }
+
+        return classNames;
+    }
+}

Modified: geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/ResourceFinder.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/ResourceFinder.java?view=diff&rev=467848&r1=467847&r2=467848
==============================================================================
--- geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/ResourceFinder.java (original)
+++ geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/ResourceFinder.java Wed Oct 25 20:14:43 2006
@@ -461,9 +461,4 @@
         }
     }
 
-
-    public Enumeration doFindCommands() throws IOException {
-        return Thread.currentThread().getContextClassLoader().getResources(path);
-    }
-
 }

Added: geronimo/xbean/trunk/xbean-finder/src/test/java/org/acme/foo/Blue.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-finder/src/test/java/org/acme/foo/Blue.java?view=auto&rev=467848
==============================================================================
--- geronimo/xbean/trunk/xbean-finder/src/test/java/org/acme/foo/Blue.java (added)
+++ geronimo/xbean/trunk/xbean-finder/src/test/java/org/acme/foo/Blue.java Wed Oct 25 20:14:43 2006
@@ -0,0 +1,15 @@
+/* =====================================================================
+ *
+ * Copyright (c) 2003 David Blevins.  All rights reserved.
+ *
+ * =====================================================================
+ */
+package org.acme.foo;
+
+/**
+ * @version $Revision$ $Date$
+ */
+@Color public class Blue implements Primary {
+    @Color public static class Navy{}
+    @Color public static class Sky{}
+}

Added: geronimo/xbean/trunk/xbean-finder/src/test/java/org/acme/foo/Color.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-finder/src/test/java/org/acme/foo/Color.java?view=auto&rev=467848
==============================================================================
--- geronimo/xbean/trunk/xbean-finder/src/test/java/org/acme/foo/Color.java (added)
+++ geronimo/xbean/trunk/xbean-finder/src/test/java/org/acme/foo/Color.java Wed Oct 25 20:14:43 2006
@@ -0,0 +1,9 @@
+package org.acme.foo;
+
+/**
+ * @version $Revision$ $Date$
+ */
+@java.lang.annotation.Target(value = {java.lang.annotation.ElementType.TYPE})
+@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
+public @interface Color {
+}

Added: geronimo/xbean/trunk/xbean-finder/src/test/java/org/acme/foo/Green.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-finder/src/test/java/org/acme/foo/Green.java?view=auto&rev=467848
==============================================================================
--- geronimo/xbean/trunk/xbean-finder/src/test/java/org/acme/foo/Green.java (added)
+++ geronimo/xbean/trunk/xbean-finder/src/test/java/org/acme/foo/Green.java Wed Oct 25 20:14:43 2006
@@ -0,0 +1,14 @@
+/* =====================================================================
+ *
+ * Copyright (c) 2003 David Blevins.  All rights reserved.
+ *
+ * =====================================================================
+ */
+package org.acme.foo;
+
+/**
+ * @version $Revision$ $Date$
+ */
+@Color public class Green implements Primary {
+    @Color public static class Emerald extends Green {}
+}

Added: geronimo/xbean/trunk/xbean-finder/src/test/java/org/acme/foo/Halloween.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-finder/src/test/java/org/acme/foo/Halloween.java?view=auto&rev=467848
==============================================================================
--- geronimo/xbean/trunk/xbean-finder/src/test/java/org/acme/foo/Halloween.java (added)
+++ geronimo/xbean/trunk/xbean-finder/src/test/java/org/acme/foo/Halloween.java Wed Oct 25 20:14:43 2006
@@ -0,0 +1,13 @@
+/* =====================================================================
+ *
+ * Copyright (c) 2003 David Blevins.  All rights reserved.
+ *
+ * =====================================================================
+ */
+package org.acme.foo;
+
+/**
+ * @version $Revision$ $Date$
+ */
+
+@Holiday public class Halloween {}

Added: geronimo/xbean/trunk/xbean-finder/src/test/java/org/acme/foo/Holiday.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-finder/src/test/java/org/acme/foo/Holiday.java?view=auto&rev=467848
==============================================================================
--- geronimo/xbean/trunk/xbean-finder/src/test/java/org/acme/foo/Holiday.java (added)
+++ geronimo/xbean/trunk/xbean-finder/src/test/java/org/acme/foo/Holiday.java Wed Oct 25 20:14:43 2006
@@ -0,0 +1,9 @@
+package org.acme.foo;
+
+/**
+ * @version $Revision$ $Date$
+ */
+@java.lang.annotation.Target(value = {java.lang.annotation.ElementType.TYPE})
+@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
+public @interface Holiday {
+}

Added: geronimo/xbean/trunk/xbean-finder/src/test/java/org/acme/foo/Primary.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-finder/src/test/java/org/acme/foo/Primary.java?view=auto&rev=467848
==============================================================================
--- geronimo/xbean/trunk/xbean-finder/src/test/java/org/acme/foo/Primary.java (added)
+++ geronimo/xbean/trunk/xbean-finder/src/test/java/org/acme/foo/Primary.java Wed Oct 25 20:14:43 2006
@@ -0,0 +1,12 @@
+/* =====================================================================
+ *
+ * Copyright (c) 2003 David Blevins.  All rights reserved.
+ *
+ * =====================================================================
+ */
+package org.acme.foo;
+
+/**
+ * @version $Revision$ $Date$
+ */
+public interface Primary {}

Added: geronimo/xbean/trunk/xbean-finder/src/test/java/org/acme/foo/Red.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-finder/src/test/java/org/acme/foo/Red.java?view=auto&rev=467848
==============================================================================
--- geronimo/xbean/trunk/xbean-finder/src/test/java/org/acme/foo/Red.java (added)
+++ geronimo/xbean/trunk/xbean-finder/src/test/java/org/acme/foo/Red.java Wed Oct 25 20:14:43 2006
@@ -0,0 +1,15 @@
+/* =====================================================================
+ *
+ * Copyright (c) 2003 David Blevins.  All rights reserved.
+ *
+ * =====================================================================
+ */
+package org.acme.foo;
+
+/**
+ * @version $Revision$ $Date$
+ */
+@Color public class Red implements Primary {
+    @Color public static class CandyApple{}
+    @Color public static class Pink{}
+}

Added: geronimo/xbean/trunk/xbean-finder/src/test/java/org/acme/foo/Thanksgiving.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-finder/src/test/java/org/acme/foo/Thanksgiving.java?view=auto&rev=467848
==============================================================================
--- geronimo/xbean/trunk/xbean-finder/src/test/java/org/acme/foo/Thanksgiving.java (added)
+++ geronimo/xbean/trunk/xbean-finder/src/test/java/org/acme/foo/Thanksgiving.java Wed Oct 25 20:14:43 2006
@@ -0,0 +1,12 @@
+/* =====================================================================
+ *
+ * Copyright (c) 2003 David Blevins.  All rights reserved.
+ *
+ * =====================================================================
+ */
+package org.acme.foo;
+
+/**
+ * @version $Revision$ $Date$
+ */
+@Holiday public class Thanksgiving {}

Added: geronimo/xbean/trunk/xbean-finder/src/test/java/org/acme/foo/ValentinesDay.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-finder/src/test/java/org/acme/foo/ValentinesDay.java?view=auto&rev=467848
==============================================================================
--- geronimo/xbean/trunk/xbean-finder/src/test/java/org/acme/foo/ValentinesDay.java (added)
+++ geronimo/xbean/trunk/xbean-finder/src/test/java/org/acme/foo/ValentinesDay.java Wed Oct 25 20:14:43 2006
@@ -0,0 +1,12 @@
+/* =====================================================================
+ *
+ * Copyright (c) 2003 David Blevins.  All rights reserved.
+ *
+ * =====================================================================
+ */
+package org.acme.foo;
+
+/**
+ * @version $Revision$ $Date$
+ */
+@Holiday public class ValentinesDay {}

Added: geronimo/xbean/trunk/xbean-finder/src/test/java/org/apache/xbean/finder/ClassFinderTest.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-finder/src/test/java/org/apache/xbean/finder/ClassFinderTest.java?view=auto&rev=467848
==============================================================================
--- geronimo/xbean/trunk/xbean-finder/src/test/java/org/apache/xbean/finder/ClassFinderTest.java (added)
+++ geronimo/xbean/trunk/xbean-finder/src/test/java/org/apache/xbean/finder/ClassFinderTest.java Wed Oct 25 20:14:43 2006
@@ -0,0 +1,51 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.xbean.finder;
+
+import junit.framework.TestCase;
+
+import java.util.List;
+import java.util.Map;
+import java.lang.annotation.Annotation;
+
+import org.acme.foo.Holiday;
+import org.acme.foo.Color;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class ClassFinderTest extends TestCase {
+
+    public void testFindAnnotatedClasses() throws Exception {
+        ClassFinder classFinder = new ClassFinder(Thread.currentThread().getContextClassLoader());
+        List<Class> classes = classFinder.findAnnotatedClasses(Holiday.class);
+        assertNotNull("classes", classes);
+        assertEquals("classes.size", 3, classes.size());
+    }
+
+    public void testMapAnnotatedClasses() throws Exception {
+        ClassFinder classFinder = new ClassFinder(Thread.currentThread().getContextClassLoader());
+        Map<Class<? extends Annotation>, List<Class>> map = classFinder.mapAnnotatedClasses();
+        List<Class> classes = map.get(Holiday.class);
+        assertNotNull("classes", classes);
+        assertEquals("classes.size", 3, classes.size());
+
+        classes = map.get(Color.class);
+        assertNotNull("classes", classes);
+        assertEquals("classes.size", 8, classes.size());
+    }
+}



Re: svn commit: r467848 - in /geronimo/xbean/trunk/xbean-finder/src: main/java/org/apache/xbean/finder/ test/java/org/acme/foo/ test/java/org/apache/xbean/finder/

Posted by Jason Dillon <ja...@planet57.com>.
G currently depends on 2.7-SNAPSHOT of some xbean bits, so I roll'd  
my xbean workspace back right before the cut of 2.7 and am pushing  
out 2.7-SNAPSHOTS now.

Perms are still whack on the repo, needs to be group apcvs (though  
something is on on mino weird, as it does not look like I am in apcvs  
from groups or id, though it looks like I'm there in /etc/group).

--jason


On Oct 26, 2006, at 3:34 AM, Guillaume Nodet wrote:

> Unfortunately, xbean-2.7 has been lost this weekend.
> If still have the full xbean repo on my computer so I will
> upload it as soon as permissions are fixed.
>
> And afaik, there were no xbean-2.8 snapshots uploaded
> (at least, not by me).
>
> On 10/26/06, Jacek Laskowski <ja...@laskowski.net.pl> wrote:
>> On 10/26/06, dblevins@apache.org <db...@apache.org> wrote:
>> > Author: dblevins
>> > Date: Wed Oct 25 20:14:43 2006
>> > New Revision: 467848
>> >
>> > URL: http://svn.apache.org/viewvc?view=rev&rev=467848
>> > Log:
>> > Added a finder for locating classes in a classloader that have  
>> an annotation or implement an interface
>>
>> Hi Dave,
>>
>> You seem to beat me ;-) Nice!
>>
>> > + *
>> > + * Copyright (c) 2003 David Blevins.  All rights reserved.
>> > + *
>> > + *
>>
>> Is it intended?
>>
>> Also, I don't see XBean 2.7 and 2.8-SNAPSHOT available in any repo.
>> Should it be deployed again? Guillaume?
>>
>> Jacek
>>
>> --
>> Jacek Laskowski
>> http://www.jaceklaskowski.pl
>>
>
>
> -- 
> Cheers,
> Guillaume Nodet


Re: svn commit: r467848 - in /geronimo/xbean/trunk/xbean-finder/src: main/java/org/apache/xbean/finder/ test/java/org/acme/foo/ test/java/org/apache/xbean/finder/

Posted by Guillaume Nodet <gn...@gmail.com>.
I guess the problem comes from the maven release plugin
that does not support that.  So it failed to update the
plugin version to 2.8-SNAPSHOT.

On 10/26/06, Jason Dillon <ja...@planet57.com> wrote:
> Nope, the problem is that xbean-classloader depends on maven-xbean-
> plugin v2.7 which got lost.  It should depend on ${pom.version} so
> that it picks up the version built in the current build cycle.
>
> --jason
>
>
> On Oct 26, 2006, at 4:14 AM, Guillaume Nodet wrote:
>
> > You can not clean unless you have already build the whole tree.
> > The problems comes from the fact that the maven plugin
> > (which is part of the build) is used in some modules.  It works
> > when you "install", but not when you "clean" from a clean repo.
> >
> > On 10/26/06, Jason Dillon <ja...@planet57.com> wrote:
> >> I'd do it.. but trunk does not build:
> >>
> >> <snip>
> >> [INFO]
> >> ---------------------------------------------------------------------
> >> ---
> >> ----
> >> [INFO] Building XBean :: Classloader
> >> [INFO]    task-segment: [clean, install]
> >> [INFO]
> >> ---------------------------------------------------------------------
> >> ---
> >> ----
> >> Downloading: http://repo1.maven.org/maven2/org/apache/xbean/maven-
> >> xbean-plugin/2.7/maven-xbean-plugin-2.7.pom
> >> [WARNING] Unable to get resource from repository central (http://
> >> repo1.maven.org/maven2)
> >> Downloading: http://repo1.maven.org/maven2/org/apache/xbean/maven-
> >> xbean-plugin/2.7/maven-xbean-plugin-2.7.pom
> >> [WARNING] Unable to get resource from repository central (http://
> >> repo1.maven.org/maven2)
> >> [INFO]
> >> ---------------------------------------------------------------------
> >> ---
> >> [ERROR] BUILD ERROR
> >> [INFO]
> >> ---------------------------------------------------------------------
> >> ---
> >> [INFO] Failed to resolve artifact.
> >>
> >> GroupId: org.apache.xbean
> >> ArtifactId: maven-xbean-plugin
> >> Version: 2.7
> >>
> >> Reason: Unable to download the artifact from any repository
> >>
> >>    org.apache.xbean:maven-xbean-plugin:pom:2.7
> >>
> >> from the specified remote repositories:
> >>    central (http://repo1.maven.org/maven2),
> >>    apache.snapshots (http://people.apache.org/repo/m2-snapshot-
> >> repository),
> >>    apache-snapshots (http://people.apache.org/repo/m2-snapshot-
> >> repository)
> >> </snip>
> >>
> >> --jason
> >>
> >>
> >> On Oct 26, 2006, at 3:39 AM, Jacek Laskowski wrote:
> >>
> >> > On 10/26/06, Guillaume Nodet <gn...@gmail.com> wrote:
> >> >> Unfortunately, xbean-2.7 has been lost this weekend.
> >> >> If still have the full xbean repo on my computer so I will
> >> >> upload it as soon as permissions are fixed.
> >> >>
> >> >> And afaik, there were no xbean-2.8 snapshots uploaded
> >> >> (at least, not by me).
> >> >
> >> > May I ask for 2.8-SNAPSHOT deploy once, for your OpenEJB
> >> fellows? ;-)
> >> >
> >> > Jacek
> >> >
> >> > --
> >> > Jacek Laskowski
> >> > http://www.jaceklaskowski.pl
> >>
> >>
> >
> >
> > --
> > Cheers,
> > Guillaume Nodet
>
>


-- 
Cheers,
Guillaume Nodet

Re: svn commit: r467848 - in /geronimo/xbean/trunk/xbean-finder/src: main/java/org/apache/xbean/finder/ test/java/org/acme/foo/ test/java/org/apache/xbean/finder/

Posted by Jason Dillon <ja...@planet57.com>.
Nope, the problem is that xbean-classloader depends on maven-xbean- 
plugin v2.7 which got lost.  It should depend on ${pom.version} so  
that it picks up the version built in the current build cycle.

--jason


On Oct 26, 2006, at 4:14 AM, Guillaume Nodet wrote:

> You can not clean unless you have already build the whole tree.
> The problems comes from the fact that the maven plugin
> (which is part of the build) is used in some modules.  It works
> when you "install", but not when you "clean" from a clean repo.
>
> On 10/26/06, Jason Dillon <ja...@planet57.com> wrote:
>> I'd do it.. but trunk does not build:
>>
>> <snip>
>> [INFO]
>> --------------------------------------------------------------------- 
>> ---
>> ----
>> [INFO] Building XBean :: Classloader
>> [INFO]    task-segment: [clean, install]
>> [INFO]
>> --------------------------------------------------------------------- 
>> ---
>> ----
>> Downloading: http://repo1.maven.org/maven2/org/apache/xbean/maven-
>> xbean-plugin/2.7/maven-xbean-plugin-2.7.pom
>> [WARNING] Unable to get resource from repository central (http://
>> repo1.maven.org/maven2)
>> Downloading: http://repo1.maven.org/maven2/org/apache/xbean/maven-
>> xbean-plugin/2.7/maven-xbean-plugin-2.7.pom
>> [WARNING] Unable to get resource from repository central (http://
>> repo1.maven.org/maven2)
>> [INFO]
>> --------------------------------------------------------------------- 
>> ---
>> [ERROR] BUILD ERROR
>> [INFO]
>> --------------------------------------------------------------------- 
>> ---
>> [INFO] Failed to resolve artifact.
>>
>> GroupId: org.apache.xbean
>> ArtifactId: maven-xbean-plugin
>> Version: 2.7
>>
>> Reason: Unable to download the artifact from any repository
>>
>>    org.apache.xbean:maven-xbean-plugin:pom:2.7
>>
>> from the specified remote repositories:
>>    central (http://repo1.maven.org/maven2),
>>    apache.snapshots (http://people.apache.org/repo/m2-snapshot-
>> repository),
>>    apache-snapshots (http://people.apache.org/repo/m2-snapshot-
>> repository)
>> </snip>
>>
>> --jason
>>
>>
>> On Oct 26, 2006, at 3:39 AM, Jacek Laskowski wrote:
>>
>> > On 10/26/06, Guillaume Nodet <gn...@gmail.com> wrote:
>> >> Unfortunately, xbean-2.7 has been lost this weekend.
>> >> If still have the full xbean repo on my computer so I will
>> >> upload it as soon as permissions are fixed.
>> >>
>> >> And afaik, there were no xbean-2.8 snapshots uploaded
>> >> (at least, not by me).
>> >
>> > May I ask for 2.8-SNAPSHOT deploy once, for your OpenEJB  
>> fellows? ;-)
>> >
>> > Jacek
>> >
>> > --
>> > Jacek Laskowski
>> > http://www.jaceklaskowski.pl
>>
>>
>
>
> -- 
> Cheers,
> Guillaume Nodet


Re: svn commit: r467848 - in /geronimo/xbean/trunk/xbean-finder/src: main/java/org/apache/xbean/finder/ test/java/org/acme/foo/ test/java/org/apache/xbean/finder/

Posted by Guillaume Nodet <gn...@gmail.com>.
You can not clean unless you have already build the whole tree.
The problems comes from the fact that the maven plugin
(which is part of the build) is used in some modules.  It works
when you "install", but not when you "clean" from a clean repo.

On 10/26/06, Jason Dillon <ja...@planet57.com> wrote:
> I'd do it.. but trunk does not build:
>
> <snip>
> [INFO]
> ------------------------------------------------------------------------
> ----
> [INFO] Building XBean :: Classloader
> [INFO]    task-segment: [clean, install]
> [INFO]
> ------------------------------------------------------------------------
> ----
> Downloading: http://repo1.maven.org/maven2/org/apache/xbean/maven-
> xbean-plugin/2.7/maven-xbean-plugin-2.7.pom
> [WARNING] Unable to get resource from repository central (http://
> repo1.maven.org/maven2)
> Downloading: http://repo1.maven.org/maven2/org/apache/xbean/maven-
> xbean-plugin/2.7/maven-xbean-plugin-2.7.pom
> [WARNING] Unable to get resource from repository central (http://
> repo1.maven.org/maven2)
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Failed to resolve artifact.
>
> GroupId: org.apache.xbean
> ArtifactId: maven-xbean-plugin
> Version: 2.7
>
> Reason: Unable to download the artifact from any repository
>
>    org.apache.xbean:maven-xbean-plugin:pom:2.7
>
> from the specified remote repositories:
>    central (http://repo1.maven.org/maven2),
>    apache.snapshots (http://people.apache.org/repo/m2-snapshot-
> repository),
>    apache-snapshots (http://people.apache.org/repo/m2-snapshot-
> repository)
> </snip>
>
> --jason
>
>
> On Oct 26, 2006, at 3:39 AM, Jacek Laskowski wrote:
>
> > On 10/26/06, Guillaume Nodet <gn...@gmail.com> wrote:
> >> Unfortunately, xbean-2.7 has been lost this weekend.
> >> If still have the full xbean repo on my computer so I will
> >> upload it as soon as permissions are fixed.
> >>
> >> And afaik, there were no xbean-2.8 snapshots uploaded
> >> (at least, not by me).
> >
> > May I ask for 2.8-SNAPSHOT deploy once, for your OpenEJB fellows? ;-)
> >
> > Jacek
> >
> > --
> > Jacek Laskowski
> > http://www.jaceklaskowski.pl
>
>


-- 
Cheers,
Guillaume Nodet

Re: svn commit: r467848 - in /geronimo/xbean/trunk/xbean-finder/src: main/java/org/apache/xbean/finder/ test/java/org/acme/foo/ test/java/org/apache/xbean/finder/

Posted by Jason Dillon <ja...@planet57.com>.
But trunk (2.8-SNAPSHOT) should probably use plugin versions from 2.8- 
SNAPSHOT, not 2.7...

--jason


On Oct 26, 2006, at 4:04 AM, Jacek Laskowski wrote:

> On 10/26/06, Jason Dillon <ja...@planet57.com> wrote:
>> I'd do it.. but trunk does not build:
>
> I've just built it fine. Don't know what might be wrong for you
> (knowing you're a m2 guru I don't even attempt to guess what might
> cause it as these obvious things I could come up with may've already
> been tested out a couple of times ;-))
>
> Jacek
>
> -- 
> Jacek Laskowski
> http://www.jaceklaskowski.pl


Re: svn commit: r467848 - in /geronimo/xbean/trunk/xbean-finder/src: main/java/org/apache/xbean/finder/ test/java/org/acme/foo/ test/java/org/apache/xbean/finder/

Posted by Jason Dillon <ja...@planet57.com>.
You probably already have 2.7 artifacts in your local repo.

--jason


On Oct 26, 2006, at 4:04 AM, Jacek Laskowski wrote:

> On 10/26/06, Jason Dillon <ja...@planet57.com> wrote:
>> I'd do it.. but trunk does not build:
>
> I've just built it fine. Don't know what might be wrong for you
> (knowing you're a m2 guru I don't even attempt to guess what might
> cause it as these obvious things I could come up with may've already
> been tested out a couple of times ;-))
>
> Jacek
>
> -- 
> Jacek Laskowski
> http://www.jaceklaskowski.pl


Re: svn commit: r467848 - in /geronimo/xbean/trunk/xbean-finder/src: main/java/org/apache/xbean/finder/ test/java/org/acme/foo/ test/java/org/apache/xbean/finder/

Posted by Jacek Laskowski <ja...@laskowski.net.pl>.
On 10/26/06, Jason Dillon <ja...@planet57.com> wrote:
> I'd do it.. but trunk does not build:

I've just built it fine. Don't know what might be wrong for you
(knowing you're a m2 guru I don't even attempt to guess what might
cause it as these obvious things I could come up with may've already
been tested out a couple of times ;-))

Jacek

-- 
Jacek Laskowski
http://www.jaceklaskowski.pl

Re: svn commit: r467848 - in /geronimo/xbean/trunk/xbean-finder/src: main/java/org/apache/xbean/finder/ test/java/org/acme/foo/ test/java/org/apache/xbean/finder/

Posted by Jason Dillon <ja...@planet57.com>.
I'd do it.. but trunk does not build:

<snip>
[INFO]  
------------------------------------------------------------------------ 
----
[INFO] Building XBean :: Classloader
[INFO]    task-segment: [clean, install]
[INFO]  
------------------------------------------------------------------------ 
----
Downloading: http://repo1.maven.org/maven2/org/apache/xbean/maven- 
xbean-plugin/2.7/maven-xbean-plugin-2.7.pom
[WARNING] Unable to get resource from repository central (http:// 
repo1.maven.org/maven2)
Downloading: http://repo1.maven.org/maven2/org/apache/xbean/maven- 
xbean-plugin/2.7/maven-xbean-plugin-2.7.pom
[WARNING] Unable to get resource from repository central (http:// 
repo1.maven.org/maven2)
[INFO]  
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]  
------------------------------------------------------------------------
[INFO] Failed to resolve artifact.

GroupId: org.apache.xbean
ArtifactId: maven-xbean-plugin
Version: 2.7

Reason: Unable to download the artifact from any repository

   org.apache.xbean:maven-xbean-plugin:pom:2.7

from the specified remote repositories:
   central (http://repo1.maven.org/maven2),
   apache.snapshots (http://people.apache.org/repo/m2-snapshot- 
repository),
   apache-snapshots (http://people.apache.org/repo/m2-snapshot- 
repository)
</snip>

--jason


On Oct 26, 2006, at 3:39 AM, Jacek Laskowski wrote:

> On 10/26/06, Guillaume Nodet <gn...@gmail.com> wrote:
>> Unfortunately, xbean-2.7 has been lost this weekend.
>> If still have the full xbean repo on my computer so I will
>> upload it as soon as permissions are fixed.
>>
>> And afaik, there were no xbean-2.8 snapshots uploaded
>> (at least, not by me).
>
> May I ask for 2.8-SNAPSHOT deploy once, for your OpenEJB fellows? ;-)
>
> Jacek
>
> -- 
> Jacek Laskowski
> http://www.jaceklaskowski.pl


Re: svn commit: r467848 - in /geronimo/xbean/trunk/xbean-finder/src: main/java/org/apache/xbean/finder/ test/java/org/acme/foo/ test/java/org/apache/xbean/finder/

Posted by Jacek Laskowski <ja...@laskowski.net.pl>.
On 10/26/06, Guillaume Nodet <gn...@gmail.com> wrote:
> Unfortunately, xbean-2.7 has been lost this weekend.
> If still have the full xbean repo on my computer so I will
> upload it as soon as permissions are fixed.
>
> And afaik, there were no xbean-2.8 snapshots uploaded
> (at least, not by me).

May I ask for 2.8-SNAPSHOT deploy once, for your OpenEJB fellows? ;-)

Jacek

-- 
Jacek Laskowski
http://www.jaceklaskowski.pl

Re: svn commit: r467848 - in /geronimo/xbean/trunk/xbean-finder/src: main/java/org/apache/xbean/finder/ test/java/org/acme/foo/ test/java/org/apache/xbean/finder/

Posted by Guillaume Nodet <gn...@gmail.com>.
Unfortunately, xbean-2.7 has been lost this weekend.
If still have the full xbean repo on my computer so I will
upload it as soon as permissions are fixed.

And afaik, there were no xbean-2.8 snapshots uploaded
(at least, not by me).

On 10/26/06, Jacek Laskowski <ja...@laskowski.net.pl> wrote:
> On 10/26/06, dblevins@apache.org <db...@apache.org> wrote:
> > Author: dblevins
> > Date: Wed Oct 25 20:14:43 2006
> > New Revision: 467848
> >
> > URL: http://svn.apache.org/viewvc?view=rev&rev=467848
> > Log:
> > Added a finder for locating classes in a classloader that have an annotation or implement an interface
>
> Hi Dave,
>
> You seem to beat me ;-) Nice!
>
> > + *
> > + * Copyright (c) 2003 David Blevins.  All rights reserved.
> > + *
> > + *
>
> Is it intended?
>
> Also, I don't see XBean 2.7 and 2.8-SNAPSHOT available in any repo.
> Should it be deployed again? Guillaume?
>
> Jacek
>
> --
> Jacek Laskowski
> http://www.jaceklaskowski.pl
>


-- 
Cheers,
Guillaume Nodet

Re: svn commit: r467848 - in /geronimo/xbean/trunk/xbean-finder/src: main/java/org/apache/xbean/finder/ test/java/org/acme/foo/ test/java/org/apache/xbean/finder/

Posted by Jacek Laskowski <ja...@laskowski.net.pl>.
On 10/26/06, dblevins@apache.org <db...@apache.org> wrote:
> Author: dblevins
> Date: Wed Oct 25 20:14:43 2006
> New Revision: 467848
>
> URL: http://svn.apache.org/viewvc?view=rev&rev=467848
> Log:
> Added a finder for locating classes in a classloader that have an annotation or implement an interface

Hi Dave,

You seem to beat me ;-) Nice!

> + *
> + * Copyright (c) 2003 David Blevins.  All rights reserved.
> + *
> + *

Is it intended?

Also, I don't see XBean 2.7 and 2.8-SNAPSHOT available in any repo.
Should it be deployed again? Guillaume?

Jacek

-- 
Jacek Laskowski
http://www.jaceklaskowski.pl