Title: [jbehave] [659] trunk: Repackaged maven plugin to use org.jbehave.*
Revision
659
Author
mauro
Date
2007-01-04 09:17:38 -0600 (Thu, 04 Jan 2007)

Log Message

Repackaged maven plugin to use org.jbehave.*

Modified Paths


Added Paths

Removed Paths

Diff

Modified: trunk/plugins/maven/deploy.sh (658 => 659)

--- trunk/plugins/maven/deploy.sh	2007-01-04 15:14:07 UTC (rev 658)
+++ trunk/plugins/maven/deploy.sh	2007-01-04 15:17:38 UTC (rev 659)
@@ -1 +1 @@
-mvn -U deploy:deploy-file  -DgroupId=jbehave -DartifactId=jbehave -Dversion=1.0-SNAPSHOT -Dpackaging=jar  -DrepositoryId=codehaus-jbehave-snapshot-repository -Durl=dav:https://dav.codehaus.org/snapshots.dist/jbehave/ -Dfile=../../delete_me/1.0-SNAPSHOT/jbehave.jar
+mvn -U deploy:deploy-file  -DgroupId=org.jbehave -DartifactId=jbehave -Dversion=1.0-SNAPSHOT -Dpackaging=jar  -DrepositoryId=codehaus-jbehave-snapshot-repository -Durl=dav:https://dav.codehaus.org/snapshots.dist/jbehave/ -Dfile=../../delete_me/1.0-SNAPSHOT/dist/1.0-SNAPSHOT/jbehave-1.0-SNAPSHOT.jar   

Modified: trunk/plugins/maven/install.sh (658 => 659)

--- trunk/plugins/maven/install.sh	2007-01-04 15:14:07 UTC (rev 658)
+++ trunk/plugins/maven/install.sh	2007-01-04 15:17:38 UTC (rev 659)
@@ -1 +1 @@
-mvn -U install:install-file -DgroupId=jbehave -DartifactId=jbehave -Dversion=1.0-SNAPSHOT -Dpackaging=jar -Dfile=../../delete_me/1.0-SNAPSHOT/jbehave.jar                                   
+mvn -U install:install-file -DgroupId=org.jbehave -DartifactId=jbehave -Dversion=1.0-SNAPSHOT -Dpackaging=jar -Dfile=../../delete_me/1.0-SNAPSHOT/dist/1.0-SNAPSHOT/jbehave-1.0-SNAPSHOT.jar                                   

Modified: trunk/plugins/maven/pom.xml (658 => 659)

--- trunk/plugins/maven/pom.xml	2007-01-04 15:14:07 UTC (rev 658)
+++ trunk/plugins/maven/pom.xml	2007-01-04 15:17:38 UTC (rev 659)
@@ -3,7 +3,7 @@
 	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
 	<modelVersion>4.0.0</modelVersion>
 	<parent>
-		<groupId>jbehave</groupId>
+		<groupId>org.jbehave</groupId>
 		<artifactId>jbehave-parent</artifactId>
         <version>1.0-SNAPSHOT</version>
 	</parent>

Copied: trunk/plugins/maven/src/it/src/main/java/org/jbehave/it (from rev 637, trunk/plugins/maven/src/it/src/main/java/jbehave/it) ( => )

Deleted: trunk/plugins/maven/src/it/src/main/java/org/jbehave/it/ItBehaviours.java
===================================================================
--- trunk/plugins/maven/src/it/src/main/java/jbehave/it/ItBehaviours.java	2006-12-22 01:07:07 UTC (rev 637)
+++ trunk/plugins/maven/src/it/src/main/java/org/jbehave/it/ItBehaviours.java	2007-01-04 15:17:38 UTC (rev 659)
@@ -1,14 +0,0 @@
-package jbehave.it;
-
-import jbehave.core.behaviour.Behaviours;
-
-public class ItBehaviours implements Behaviours {
-
-    public Class[] getBehaviours() {
-        return new Class[] {
-                jbehave.it.SampleBehaviour.class
-        };
-    }
-}
-
-

Copied: trunk/plugins/maven/src/it/src/main/java/org/jbehave/it/ItBehaviours.java (from rev 654, trunk/plugins/maven/src/it/src/main/java/jbehave/it/ItBehaviours.java) (0 => 659)

--- trunk/plugins/maven/src/it/src/main/java/org/jbehave/it/ItBehaviours.java	                        (rev 0)
+++ trunk/plugins/maven/src/it/src/main/java/org/jbehave/it/ItBehaviours.java	2007-01-04 15:17:38 UTC (rev 659)
@@ -0,0 +1,14 @@
+package org.jbehave.it;
+
+import org.jbehave.core.behaviour.Behaviours;
+
+public class ItBehaviours implements Behaviours {
+
+    public Class[] getBehaviours() {
+        return new Class[] {
+                org.jbehave.it.SampleBehaviour.class
+        };
+    }
+}
+
+

Deleted: trunk/plugins/maven/src/it/src/main/java/org/jbehave/it/SampleBehaviour.java (637 => 659)

--- trunk/plugins/maven/src/it/src/main/java/jbehave/it/SampleBehaviour.java	2006-12-22 01:07:07 UTC (rev 637)
+++ trunk/plugins/maven/src/it/src/main/java/org/jbehave/it/SampleBehaviour.java	2007-01-04 15:17:38 UTC (rev 659)
@@ -1,8 +0,0 @@
-package jbehave.it;
-
-public class SampleBehaviour {
-
-    public void shouldDoSomething() {
-        System.out.println("Done something");
-    }
-}

Copied: trunk/plugins/maven/src/it/src/main/java/org/jbehave/it/SampleBehaviour.java (from rev 654, trunk/plugins/maven/src/it/src/main/java/jbehave/it/SampleBehaviour.java) (0 => 659)

--- trunk/plugins/maven/src/it/src/main/java/org/jbehave/it/SampleBehaviour.java	                        (rev 0)
+++ trunk/plugins/maven/src/it/src/main/java/org/jbehave/it/SampleBehaviour.java	2007-01-04 15:17:38 UTC (rev 659)
@@ -0,0 +1,8 @@
+package org.jbehave.it;
+
+public class SampleBehaviour {
+
+    public void shouldDoSomething() {
+        System.out.println("Done something");
+    }
+}

Copied: trunk/plugins/maven/src/main/java/org/jbehave/mojo (from rev 637, trunk/plugins/maven/src/main/java/jbehave/mojo) ( => )

Deleted: trunk/plugins/maven/src/main/java/org/jbehave/mojo/BehaviourRunnerMojo.java
===================================================================
--- trunk/plugins/maven/src/main/java/jbehave/mojo/BehaviourRunnerMojo.java	2006-12-22 01:07:07 UTC (rev 637)
+++ trunk/plugins/maven/src/main/java/org/jbehave/mojo/BehaviourRunnerMojo.java	2007-01-04 15:17:38 UTC (rev 659)
@@ -1,56 +0,0 @@
-package jbehave.mojo;
-
-import java.net.MalformedURLException;
-import java.util.List;
-
-import jbehave.core.Run;
-import jbehave.core.behaviour.Behaviours;
-
-import org.apache.maven.plugin.AbstractMojo;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
-
-/**
- * Mojo to run Behaviours via Main CLI
- * 
- * @author Mauro Talevi
- * @goal run
- */
-public class BehaviourRunnerMojo  extends AbstractMojo {
-    
-    /**
-     * Compile classpath.
-     *
-     * @parameter _expression_="${project.compileClasspathElements}"
-     * @required
-     * @readonly
-     */
-    List classpathElements;
-    
-    /**
-     * @parameter
-     * @required true
-     */
-    String behavioursClassName;
-    
-    private Run runner = new Run(System.out);
-    
-    public void execute() throws MojoExecutionException, MojoFailureException {
-        try {
-            getLog().debug("Running behaviours "+ behavioursClassName);
-            Behaviours behaviours = loadBehaviours(behavioursClassName);
-            Class[] classes = behaviours.getBehaviours();
-            for (int i = 0; i < classes.length; i++) {
-                runner.verifyBehaviour(classes[i]);
-            }            
-        } catch (Exception e) {
-            throw new MojoExecutionException("Failed to verify behaviours", e);
-        }
-    }
-
-    private Behaviours loadBehaviours(String name) throws MalformedURLException, InstantiationException, IllegalAccessException {        
-        BehavioursClassLoader cl = new BehavioursClassLoader(classpathElements);
-        return cl.newBehaviours(name);
-    }
-
-}

Copied: trunk/plugins/maven/src/main/java/org/jbehave/mojo/BehaviourRunnerMojo.java (from rev 654, trunk/plugins/maven/src/main/java/jbehave/mojo/BehaviourRunnerMojo.java) (0 => 659)

--- trunk/plugins/maven/src/main/java/org/jbehave/mojo/BehaviourRunnerMojo.java	                        (rev 0)
+++ trunk/plugins/maven/src/main/java/org/jbehave/mojo/BehaviourRunnerMojo.java	2007-01-04 15:17:38 UTC (rev 659)
@@ -0,0 +1,56 @@
+package org.jbehave.mojo;
+
+import java.net.MalformedURLException;
+import java.util.List;
+
+import org.jbehave.core.Run;
+import org.jbehave.core.behaviour.Behaviours;
+
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+
+/**
+ * Mojo to run Behaviours via Main CLI
+ * 
+ * @author Mauro Talevi
+ * @goal run
+ */
+public class BehaviourRunnerMojo  extends AbstractMojo {
+    
+    /**
+     * Compile classpath.
+     *
+     * @parameter _expression_="${project.compileClasspathElements}"
+     * @required
+     * @readonly
+     */
+    List classpathElements;
+    
+    /**
+     * @parameter
+     * @required true
+     */
+    String behavioursClassName;
+    
+    private Run runner = new Run(System.out);
+    
+    public void execute() throws MojoExecutionException, MojoFailureException {
+        try {
+            getLog().debug("Running behaviours "+ behavioursClassName);
+            Behaviours behaviours = loadBehaviours(behavioursClassName);
+            Class[] classes = behaviours.getBehaviours();
+            for (int i = 0; i < classes.length; i++) {
+                runner.verifyBehaviour(classes[i]);
+            }            
+        } catch (Exception e) {
+            throw new MojoExecutionException("Failed to verify behaviours", e);
+        }
+    }
+
+    private Behaviours loadBehaviours(String name) throws MalformedURLException, InstantiationException, IllegalAccessException {        
+        BehavioursClassLoader cl = new BehavioursClassLoader(classpathElements);
+        return cl.newBehaviours(name);
+    }
+
+}

Deleted: trunk/plugins/maven/src/main/java/org/jbehave/mojo/BehavioursClassLoader.java (637 => 659)

--- trunk/plugins/maven/src/main/java/jbehave/mojo/BehavioursClassLoader.java	2006-12-22 01:07:07 UTC (rev 637)
+++ trunk/plugins/maven/src/main/java/org/jbehave/mojo/BehavioursClassLoader.java	2007-01-04 15:17:38 UTC (rev 659)
@@ -1,69 +0,0 @@
-package jbehave.mojo;
-
-import java.io.File;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
-
-import jbehave.core.behaviour.Behaviours;
-
-/**
- * Extends URLClassLoader to instantiate Behaviours.
- * 
- * @author Mauro Talevi
- */
-public class BehavioursClassLoader extends URLClassLoader {
-
-    public BehavioursClassLoader(List classpathElements)
-            throws MalformedURLException {
-        super(toClasspathURLs(classpathElements), Behaviours.class
-                .getClassLoader());
-    }
-
-    public BehavioursClassLoader(List classpathElements, ClassLoader parent)
-            throws MalformedURLException {
-        super(toClasspathURLs(classpathElements), parent);
-    }
-
-    /**
-     * Loads and instantiates a Behaviours class
-     * 
-     * @param behavioursName the name of the Behaviours
-     * @return A Behaviours instance
-     * @throws IllegalAccessException
-     */
-    public Behaviours newBehaviours(String behavioursName)
-            throws InstantiationException, IllegalAccessException {
-        String behavioursNotFound = "The behaviours " + behavioursName
-                + " was not found in " + Arrays.toString(getURLs());
-        try {
-            Behaviours behavious = (Behaviours) loadClass(behavioursName).newInstance();
-            Thread.currentThread().setContextClassLoader(this);
-            return behavious;
-        } catch (ClassCastException e) {
-            throw new RuntimeException(behavioursName + " is not a "
-                    + Behaviours.class.getName(), e);
-        } catch (ClassNotFoundException e) {
-            throw new RuntimeException(behavioursNotFound, e);
-        } catch (NoClassDefFoundError e) {
-            throw new RuntimeException(behavioursNotFound, e);
-        }
-    }
-
-    protected static URL[] toClasspathURLs(List classpathElements)
-            throws MalformedURLException {
-        List urls = new ArrayList();
-        if (classpathElements != null) {
-            for (Iterator i = classpathElements.iterator(); i.hasNext();) {
-                String classpathElement = (String) i.next();
-                urls.add(new File(classpathElement).toURL());
-            }
-        }
-        return (URL[]) urls.toArray(new URL[urls.size()]);
-    }
-
-}

Copied: trunk/plugins/maven/src/main/java/org/jbehave/mojo/BehavioursClassLoader.java (from rev 654, trunk/plugins/maven/src/main/java/jbehave/mojo/BehavioursClassLoader.java) (0 => 659)

--- trunk/plugins/maven/src/main/java/org/jbehave/mojo/BehavioursClassLoader.java	                        (rev 0)
+++ trunk/plugins/maven/src/main/java/org/jbehave/mojo/BehavioursClassLoader.java	2007-01-04 15:17:38 UTC (rev 659)
@@ -0,0 +1,69 @@
+package org.jbehave.mojo;
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.List;
+
+import org.jbehave.core.behaviour.Behaviours;
+
+/**
+ * Extends URLClassLoader to instantiate Behaviours.
+ * 
+ * @author Mauro Talevi
+ */
+public class BehavioursClassLoader extends URLClassLoader {
+
+    public BehavioursClassLoader(List classpathElements)
+            throws MalformedURLException {
+        super(toClasspathURLs(classpathElements), Behaviours.class
+                .getClassLoader());
+    }
+
+    public BehavioursClassLoader(List classpathElements, ClassLoader parent)
+            throws MalformedURLException {
+        super(toClasspathURLs(classpathElements), parent);
+    }
+
+    /**
+     * Loads and instantiates a Behaviours class
+     * 
+     * @param behavioursName the name of the Behaviours
+     * @return A Behaviours instance
+     * @throws IllegalAccessException
+     */
+    public Behaviours newBehaviours(String behavioursName)
+            throws InstantiationException, IllegalAccessException {
+        String behavioursNotFound = "The behaviours " + behavioursName
+                + " was not found in " + Arrays.toString(getURLs());
+        try {
+            Behaviours behavious = (Behaviours) loadClass(behavioursName).newInstance();
+            Thread.currentThread().setContextClassLoader(this);
+            return behavious;
+        } catch (ClassCastException e) {
+            throw new RuntimeException(behavioursName + " is not a "
+                    + Behaviours.class.getName(), e);
+        } catch (ClassNotFoundException e) {
+            throw new RuntimeException(behavioursNotFound, e);
+        } catch (NoClassDefFoundError e) {
+            throw new RuntimeException(behavioursNotFound, e);
+        }
+    }
+
+    protected static URL[] toClasspathURLs(List classpathElements)
+            throws MalformedURLException {
+        List urls = new ArrayList();
+        if (classpathElements != null) {
+            for (Iterator i = classpathElements.iterator(); i.hasNext();) {
+                String classpathElement = (String) i.next();
+                urls.add(new File(classpathElement).toURL());
+            }
+        }
+        return (URL[]) urls.toArray(new URL[urls.size()]);
+    }
+
+}

Modified: trunk/pom.xml (658 => 659)

--- trunk/pom.xml	2007-01-04 15:14:07 UTC (rev 658)
+++ trunk/pom.xml	2007-01-04 15:17:38 UTC (rev 659)
@@ -2,7 +2,7 @@
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
     <modelVersion>4.0.0</modelVersion>
-    <groupId>jbehave</groupId>
+    <groupId>org.jbehave</groupId>
     <artifactId>jbehave-parent</artifactId>
     <packaging>pom</packaging>
     <version>1.0-SNAPSHOT</version>


To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email

Reply via email to