You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-commits@axis.apache.org by sa...@apache.org on 2012/03/19 07:44:10 UTC

svn commit: r1302297 - in /axis/axis2/java/core/trunk/modules/tool/simple-server-maven-plugin: pom.xml src/main/java/org/apache/axis2/maven2/server/SimpleHttpServerMojo.java

Author: sagara
Date: Mon Mar 19 06:44:09 2012
New Revision: 1302297

URL: http://svn.apache.org/viewvc?rev=1302297&view=rev
Log:
AXIS2-5217
PluginDescriptor#getClassRealm() return type is not compatible among Maven2 and Maven3. Due to above issue this plug-in not work in Maven3. I have modified code to use Maven3 API hence will not work with Maven 2. 

We need to define Maven3 as a pre- requirement for the plug-in or need to find workaround  that works for both Maven versions. 

Modified:
    axis/axis2/java/core/trunk/modules/tool/simple-server-maven-plugin/pom.xml
    axis/axis2/java/core/trunk/modules/tool/simple-server-maven-plugin/src/main/java/org/apache/axis2/maven2/server/SimpleHttpServerMojo.java

Modified: axis/axis2/java/core/trunk/modules/tool/simple-server-maven-plugin/pom.xml
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/tool/simple-server-maven-plugin/pom.xml?rev=1302297&r1=1302296&r2=1302297&view=diff
==============================================================================
--- axis/axis2/java/core/trunk/modules/tool/simple-server-maven-plugin/pom.xml (original)
+++ axis/axis2/java/core/trunk/modules/tool/simple-server-maven-plugin/pom.xml Mon Mar 19 06:44:09 2012
@@ -52,15 +52,20 @@
         <dependency>
             <groupId>org.apache.maven</groupId>
             <artifactId>maven-plugin-api</artifactId>
+            <!--  Need to override version defined by the parent module. -->
+            <version>3.0.4</version>
+            <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.maven</groupId>
             <artifactId>maven-plugin-descriptor</artifactId>
+             <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.codehaus.plexus</groupId>
             <artifactId>plexus-classworlds</artifactId>
-        </dependency>
+             <scope>provided</scope>
+        </dependency>        
         <dependency>
             <groupId>org.apache.axis2</groupId>
             <artifactId>axis2-kernel</artifactId>

Modified: axis/axis2/java/core/trunk/modules/tool/simple-server-maven-plugin/src/main/java/org/apache/axis2/maven2/server/SimpleHttpServerMojo.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/tool/simple-server-maven-plugin/src/main/java/org/apache/axis2/maven2/server/SimpleHttpServerMojo.java?rev=1302297&r1=1302296&r2=1302297&view=diff
==============================================================================
--- axis/axis2/java/core/trunk/modules/tool/simple-server-maven-plugin/src/main/java/org/apache/axis2/maven2/server/SimpleHttpServerMojo.java (original)
+++ axis/axis2/java/core/trunk/modules/tool/simple-server-maven-plugin/src/main/java/org/apache/axis2/maven2/server/SimpleHttpServerMojo.java Mon Mar 19 06:44:09 2012
@@ -25,9 +25,9 @@ import org.apache.axis2.maven2.server.ut
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.descriptor.PluginDescriptor;
-import org.codehaus.classworlds.ClassRealm;
-import org.codehaus.classworlds.ClassWorld;
-import org.codehaus.classworlds.DuplicateRealmException;
+import org.codehaus.plexus.classworlds.ClassWorld;
+import org.codehaus.plexus.classworlds.realm.ClassRealm;
+import org.codehaus.plexus.classworlds.realm.DuplicateRealmException;
 
 /**
  * Run simple Axis 2Server.
@@ -178,8 +178,8 @@ public class SimpleHttpServerMojo extend
                     .currentThread().getContextClassLoader());
         }
         File cls = new File(buildDir + File.separator + Constants.DEFAULT_CLASSES_DIRECTORY);
-        realm.addConstituent(cls.toURL());
-        Thread.currentThread().setContextClassLoader(realm.getClassLoader());
+        realm.addURL(cls.toURI().toURL());
+        Thread.currentThread().setContextClassLoader(realm);
     }
 
     protected void waitForShutdown() {