cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject svn commit: r566908 - in /incubator/cxf/trunk: maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/Java2WSDLMojo.java tools/javato/core/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessor.java
Date Fri, 17 Aug 2007 02:38:43 GMT
Author: mmao
Date: Thu Aug 16 19:38:42 2007
New Revision: 566908

URL: http://svn.apache.org/viewvc?view=rev&rev=566908
Log:
CXF-911, CXF-910

* Java2Wsdl Maven plugin improvement


Modified:
    incubator/cxf/trunk/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/Java2WSDLMojo.java
    incubator/cxf/trunk/tools/javato/core/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessor.java

Modified: incubator/cxf/trunk/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/Java2WSDLMojo.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/Java2WSDLMojo.java?view=diff&rev=566908&r1=566907&r2=566908
==============================================================================
--- incubator/cxf/trunk/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/Java2WSDLMojo.java
(original)
+++ incubator/cxf/trunk/maven-plugins/codegen-plugin/src/main/java/org/apache/cxf/maven_plugin/Java2WSDLMojo.java
Thu Aug 16 19:38:42 2007
@@ -22,6 +22,7 @@
 import java.io.File;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.StringTokenizer;
 
 import org.apache.cxf.helpers.FileUtils;
 import org.apache.cxf.tools.java2wsdl.JavaToWSDL;
@@ -90,6 +91,11 @@
      */
     MavenProject project;
 
+    /**
+     * @parameter
+     */
+    String argline;
+
     public void execute() throws MojoExecutionException {
         File classesDir = new File(classpath);
         FileUtils.mkDir(classesDir);
@@ -100,7 +106,6 @@
             buf.append(File.pathSeparatorChar);
         }
         String newCp = buf.toString();
-
         String cp = System.getProperty("java.class.path");
         SecurityManager oldSm = System.getSecurityManager();
         try {
@@ -179,18 +184,31 @@
             args.add("-quiet");
         }
 
+        if (argline != null) {
+            StringTokenizer stoken = new StringTokenizer(argline, " ");
+            while (stoken.hasMoreTokens()) {
+                args.add(stoken.nextToken());
+            }
+        }
+
         // classname arg
         args.add(className);
 
-        String exitOnFinish = System.getProperty("exitOnFinish", "");
         try {
-            JavaToWSDL.main(args.toArray(new String[args.size()]));
-        } catch (ExitException e) {
-            if (e.getStatus() != 0) {
-                throw e;
+            String exitOnFinish = System.getProperty("exitOnFinish", "");
+            try {
+                System.setProperty("exitOnFinish", "YES");
+                JavaToWSDL.main(args.toArray(new String[args.size()]));
+            } catch (ExitException e) {
+                if (e.getStatus() != 0) {
+                    throw e;
+                }
+            } finally {
+                System.setProperty("exitOnFinish", exitOnFinish);
             }
-        } finally {
-            System.setProperty("exitOnFinish", exitOnFinish);
+        } catch (Throwable e) {
+            getLog().debug(e);
+            throw new MojoExecutionException(e.getMessage(), e);
         }
     }
 }

Modified: incubator/cxf/trunk/tools/javato/core/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/core/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessor.java?view=diff&rev=566908&r1=566907&r2=566908
==============================================================================
--- incubator/cxf/trunk/tools/javato/core/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessor.java
(original)
+++ incubator/cxf/trunk/tools/javato/core/src/main/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessor.java
Thu Aug 16 19:38:42 2007
@@ -78,8 +78,9 @@
         String oldClassPath = System.getProperty(JAVA_CLASS_PATH);
         LOG.log(Level.INFO, "OLD_CP", oldClassPath);
         if (context.get(ToolConstants.CFG_CLASSPATH) != null) {
-            String newCp = (String)context.get(ToolConstants.CFG_CLASSPATH);
-            System.setProperty(JAVA_CLASS_PATH, newCp + File.pathSeparator + oldClassPath);
+            String newCp = (String)context.get(ToolConstants.CFG_CLASSPATH) 
+                + File.pathSeparator + oldClassPath;
+            System.setProperty(JAVA_CLASS_PATH, newCp);
             LOG.log(Level.INFO, "NEW_CP", newCp);
         }
 



Mime
View raw message