cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r613498 - in /incubator/cxf/trunk: ./ common/common/src/main/java/org/apache/cxf/common/util/ common/common/src/main/java/org/apache/cxf/helpers/ maven-plugins/archetypes/cxf-http-basic/ parent/ rt/databinding/jaxb/ rt/databinding/jaxb/src/...
Date Sun, 20 Jan 2008 02:12:09 GMT
Author: dkulp
Date: Sat Jan 19 18:12:08 2008
New Revision: 613498

URL: http://svn.apache.org/viewvc?rev=613498&view=rev
Log:
upgrade the version of several plugins to the latest versions
upgrade the JAXB version to the latest in hopes it might fix some of the issues Benson keeps
running into. :-)


Added:
    incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/Compiler.java
      - copied, changed from r613258, incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/Compiler.java
    incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/StreamPrinter.java
      - copied, changed from r613258, incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/StreamPrinter.java
Removed:
    incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/Compiler.java
    incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/StreamPrinter.java
Modified:
    incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/FileUtils.java
    incubator/cxf/trunk/maven-plugins/archetypes/cxf-http-basic/pom.xml
    incubator/cxf/trunk/parent/pom.xml
    incubator/cxf/trunk/pom.xml
    incubator/cxf/trunk/rt/databinding/jaxb/pom.xml
    incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java
    incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBEncoderDecoder.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/resources/META-INF/cxf/cxf-extension-jaxws.xml
    incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ClassUtils.java
    incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ProcessorTestBase.java
    incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/BeanGenerator.java
    incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2ws/JavaToWSTest.java

Copied: incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/Compiler.java
(from r613258, incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/Compiler.java)
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/Compiler.java?p2=incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/Compiler.java&p1=incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/Compiler.java&r1=613258&r2=613498&rev=613498&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/Compiler.java
(original)
+++ incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/Compiler.java
Sat Jan 19 18:12:08 2008
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.cxf.tools.util;
+package org.apache.cxf.common.util;
 
 import java.io.File;
 import java.io.FileWriter;

Copied: incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/StreamPrinter.java
(from r613258, incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/StreamPrinter.java)
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/StreamPrinter.java?p2=incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/StreamPrinter.java&p1=incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/StreamPrinter.java&r1=613258&r2=613498&rev=613498&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/StreamPrinter.java
(original)
+++ incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/common/util/StreamPrinter.java
Sat Jan 19 18:12:08 2008
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.cxf.tools.util;
+package org.apache.cxf.common.util;
 
 import java.io.BufferedReader;
 import java.io.IOException;
@@ -26,8 +26,6 @@
 import java.io.OutputStream;
 import java.io.PrintWriter;
 
-import org.apache.cxf.tools.common.ToolException;
-
 public class StreamPrinter extends Thread {
     InputStream is;
     String msg;
@@ -62,7 +60,7 @@
                 pw.flush();
             }
         } catch (IOException ioe) {
-            throw new ToolException(ioe);
+            throw new RuntimeException(ioe);
         }
     }
 }

Modified: incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/FileUtils.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/FileUtils.java?rev=613498&r1=613497&r2=613498&view=diff
==============================================================================
--- incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/FileUtils.java
(original)
+++ incubator/cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/FileUtils.java
Sat Jan 19 18:12:08 2008
@@ -23,13 +23,14 @@
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileReader;
-import java.io.FilenameFilter;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Locale;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
 public final class FileUtils {
     private static final int RETRY_SLEEP_MILLIS = 10;
@@ -245,23 +246,32 @@
     public static List<File> getFiles(File dir, final String pattern) {
         return getFiles(dir, pattern, null);
     }
+    public static List<File> getFilesRecurse(File dir, final String pattern) {
+        return getFilesRecurse(dir, pattern, null);
+    }
 
     public static List<File> getFiles(File dir, final String pattern, File exclude)
{
-        File[] files =  dir.listFiles(new FilenameFilter() {
-                public boolean accept(File dir, String name) {
-                    return name.matches(pattern);
-                }
-            });
-        if (files == null) {
-            return new ArrayList<File>();
-        }
-
-        List<File> fileList = new ArrayList<File>();
-        for (File file : files) {
+        return getFilesRecurse(dir, Pattern.compile(pattern), exclude, false, new ArrayList<File>());
+    }
+    public static List<File> getFilesRecurse(File dir, final String pattern, File exclude)
{
+        return getFilesRecurse(dir, Pattern.compile(pattern), exclude, true, new ArrayList<File>());
   
+    }
+    private static List<File> getFilesRecurse(File dir, 
+                                              Pattern pattern,
+                                              File exclude, boolean rec,
+                                              List<File> fileList) {
+        for (File file : dir.listFiles()) {
             if (file.equals(exclude)) {
                 continue;
             }
-            fileList.add(file);
+            if (file.isDirectory() && rec) {
+                getFilesRecurse(file, pattern, exclude, rec, fileList);
+            } else {
+                Matcher m = pattern.matcher(file.getName());
+                if (m.matches()) {
+                    fileList.add(file);                                
+                }
+            }
         }
         return fileList;
     }

Modified: incubator/cxf/trunk/maven-plugins/archetypes/cxf-http-basic/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/maven-plugins/archetypes/cxf-http-basic/pom.xml?rev=613498&r1=613497&r2=613498&view=diff
==============================================================================
--- incubator/cxf/trunk/maven-plugins/archetypes/cxf-http-basic/pom.xml (original)
+++ incubator/cxf/trunk/maven-plugins/archetypes/cxf-http-basic/pom.xml Sat Jan 19 18:12:08
2008
@@ -32,6 +32,7 @@
     <url>http://cwiki.apache.org/CXF</url>
     <properties>
         <maven.test.skip>true</maven.test.skip>
+        <eclipse.skip>true</eclipse.skip>
     </properties>
     <build>
         <resources>

Modified: incubator/cxf/trunk/parent/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/parent/pom.xml?rev=613498&r1=613497&r2=613498&view=diff
==============================================================================
--- incubator/cxf/trunk/parent/pom.xml (original)
+++ incubator/cxf/trunk/parent/pom.xml Sat Jan 19 18:12:08 2008
@@ -44,8 +44,8 @@
         <saaj.impl.artifactId>saaj-impl</saaj.impl.artifactId>
 
         <jaxb.version>2.1</jaxb.version>
-        <jaxb.impl.version>2.1.4</jaxb.impl.version>
-        <jaxb.xjc.version>2.1.4</jaxb.xjc.version>
+        <jaxb.impl.version>2.1.6</jaxb.impl.version>
+        <jaxb.xjc.version>2.1.6</jaxb.xjc.version>
         <jaxws.version>2.1-1</jaxws.version>
         <jetty.version>6.1.6</jetty.version>
         <saaj.version>1.3</saaj.version>

Modified: incubator/cxf/trunk/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/pom.xml?rev=613498&r1=613497&r2=613498&view=diff
==============================================================================
--- incubator/cxf/trunk/pom.xml (original)
+++ incubator/cxf/trunk/pom.xml Sat Jan 19 18:12:08 2008
@@ -265,7 +265,7 @@
                                         </concat>
                                         <loadfile property="eclipse.code.format" srcFile="${basedir}/etc/eclipse/CXFCodeFormatter.xml"
/>
                                         <loadfile property="eclipse.code.templates" srcFile="${basedir}/etc/eclipse/codetemplates.xml"
/>
-					<loadfile property="eclipse.xml.templates" srcFile="${basedir}/etc/eclipse/xmltemplates.xml"
/>
+                                        <loadfile property="eclipse.xml.templates" srcFile="${basedir}/etc/eclipse/xmltemplates.xml"
/>
                                         <propertyfile file="${full.eclipse.workspace}/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs">
                                             <entry key="formatter_profile" value="_CXF
Java Conventions" />
                                             <entry key="org.eclipse.jdt.ui.formatterprofiles"
value="${eclipse.code.format}" />
@@ -393,7 +393,7 @@
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-surefire-plugin</artifactId>
-                    <version>2.3</version>
+                    <version>2.4</version>
                 </plugin>
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
@@ -414,6 +414,7 @@
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-jar-plugin</artifactId>
+                    <version>2.2</version>
                     <configuration>
                         <archive>
                             <manifestEntries>
@@ -427,7 +428,6 @@
                             </manifestEntries>
                          </archive>
                     </configuration>
-                    <version>2.1</version>
                 </plugin>
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
@@ -448,7 +448,7 @@
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-eclipse-plugin</artifactId>
-                    <version>2.3</version>
+                    <version>2.4</version>
                     <configuration>
                         <buildcommands>
                             <java.lang.String>org.eclipse.jdt.core.javabuilder</java.lang.String>

Modified: incubator/cxf/trunk/rt/databinding/jaxb/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/jaxb/pom.xml?rev=613498&r1=613497&r2=613498&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/databinding/jaxb/pom.xml (original)
+++ incubator/cxf/trunk/rt/databinding/jaxb/pom.xml Sat Jan 19 18:12:08 2008
@@ -124,13 +124,6 @@
        
         <dependency>
             <groupId>org.apache.cxf</groupId>
-            <artifactId>cxf-tools-common</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-
-
-        <dependency>
-            <groupId>org.apache.cxf</groupId>
             <artifactId>cxf-testutils</artifactId>
             <version>${project.version}</version>
             <scope>test</scope>
@@ -164,14 +157,6 @@
 	        <artifactId>jaxws-api</artifactId>
             <scope>test</scope>
         </dependency>
-
-        <!-- Optional dependency so we can dynamically compile the JAXB beans for the
Dynamic Client -->
-        <dependency>
-            <groupId>ant</groupId>
-            <artifactId>ant</artifactId>
-            <optional>true</optional>
-        </dependency>
-
     </dependencies>
 
 

Modified: incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java?rev=613498&r1=613497&r2=613498&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java
(original)
+++ incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java
Sat Jan 19 18:12:08 2008
@@ -22,14 +22,18 @@
 import java.io.FileInputStream;
 import java.io.IOException;
 import java.net.MalformedURLException;
+import java.net.URI;
 import java.net.URISyntaxException;
 import java.net.URL;
 import java.net.URLClassLoader;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Iterator;
+import java.util.List;
 import java.util.Map;
 import java.util.StringTokenizer;
+import java.util.jar.Attributes;
+import java.util.jar.JarFile;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
@@ -69,10 +73,6 @@
 import org.apache.cxf.service.factory.ServiceConstructionException;
 import org.apache.cxf.service.model.SchemaInfo;
 import org.apache.cxf.service.model.ServiceInfo;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.types.DirSet;
-import org.apache.tools.ant.types.FileSet;
-import org.apache.tools.ant.types.Path;
 /**
  * 
  *
@@ -208,16 +208,15 @@
         if (!classes.mkdir()) {
             throw new IllegalStateException("Unable to create working directory " + src.getPath());
         }
-        Project project = new Project();
-        project.setBaseDir(new File(tmpdir));
-        Path classPath = new Path(project);
-        setupClasspath(classPath, classLoader);
-        Path srcPath = new Path(project);
-        FileSet fileSet = new FileSet();
-        fileSet.setDir(src);
-        srcPath.addFileset(fileSet);
+        StringBuilder classPath = new StringBuilder();
+        try {
+            setupClasspath(classPath, classLoader);
+        } catch (Exception ex) {
+            throw new RuntimeException(ex);
+        }
         
-        if (!compileJavaSrc(classPath, srcPath, classes.toString())) {
+        List<File> srcFiles = FileUtils.getFilesRecurse(src, ".+\\.java$"); 
+        if (!compileJavaSrc(classPath.toString(), srcFiles, classes.toString())) {
             LOG.log(Level.SEVERE , new Message("COULD_NOT_COMPILE_SRC", LOG, wsdlUrl).toString());
         }
         FileUtils.removeDir(src);
@@ -339,28 +338,61 @@
         this.simpleBindingEnabled = simpleBindingEnabled;
     }
 
-    static boolean compileJavaSrc(Path classPath, Path srcPath, String dest) {
-        String[] srcList = srcPath.list();        
-        String[] javacCommand = new String[srcList.length + 7];
+    static boolean compileJavaSrc(String classPath, List<File> srcList, String dest)
{
+        String[] javacCommand = new String[srcList.size() + 7];
         
         javacCommand[0] = "javac";
         javacCommand[1] = "-classpath";
-        javacCommand[2] = classPath.toString();        
+        javacCommand[2] = classPath;        
         javacCommand[3] = "-d";
-        javacCommand[4] = dest.toString();
+        javacCommand[4] = dest;
         javacCommand[5] = "-target";
         javacCommand[6] = "1.5";
         
-        for (int i = 0; i < srcList.length; i++) {
-            javacCommand[7 + i] = srcList[i];            
+        int i = 7;
+        for (File f : srcList) {
+            javacCommand[i++] = f.getAbsolutePath();            
         }
-        org.apache.cxf.tools.util.Compiler javaCompiler 
-            = new org.apache.cxf.tools.util.Compiler();
+        org.apache.cxf.common.util.Compiler javaCompiler 
+            = new org.apache.cxf.common.util.Compiler();
         
         return javaCompiler.internalCompile(javacCommand, 7); 
     }
+    
+    static void addClasspathFromManifest(StringBuilder classPath, File file) 
+        throws URISyntaxException, IOException {
+        
+        JarFile jar = new JarFile(file);
+        Attributes attr = jar.getManifest().getMainAttributes();
+        if (attr != null) {
+            String cp = attr.getValue("Class-Path");
+            while (cp != null) {
+                String fileName = cp;
+                int idx = fileName.indexOf(' ');
+                if (idx != -1) {
+                    fileName = fileName.substring(0, idx);
+                    cp =  cp.substring(idx + 1).trim();
+                } else {
+                    cp = null;
+                }
+                URI uri = new URI(fileName);
+                File f2;
+                if (uri.isAbsolute()) {
+                    f2 = new File(uri);
+                } else {
+                    f2 = new File(file, fileName);
+                }
+                if (f2.exists()) {
+                    classPath.append(f2.getAbsolutePath());
+                    classPath.append(System.getProperty("path.separator"));
+                }
+            }
+        }         
+    }
 
-    static void setupClasspath(Path classPath, ClassLoader classLoader) {
+    static void setupClasspath(StringBuilder classPath, ClassLoader classLoader)
+        throws URISyntaxException, IOException {
+        
         ClassLoader scl = ClassLoader.getSystemClassLoader();        
         ClassLoader tcl = classLoader;
         do {
@@ -370,14 +402,14 @@
                     if (url.getProtocol().startsWith("file")) {
                         try {
                             File file = new File(url.toURI().getPath());
-                            if (file.isDirectory()) {
-                                DirSet ds = new DirSet();
-                                ds.setFile(file);
-                                classPath.addDirset(ds);
-                            } else {
-                                FileSet fs = new FileSet();
-                                fs.setFile(file);
-                                classPath.addFileset(fs);
+                            if (file.exists()) {
+                                classPath.append(file.getAbsolutePath())
+                                    .append(System
+                                            .getProperty("path.separator"));            
                   
+                            }
+                               
+                            if (file.getName().endsWith(".jar")) {
+                                addClasspathFromManifest(classPath, file);
                             }
                         } catch (URISyntaxException e) {
                             throw new UncheckedException(e);
@@ -389,7 +421,7 @@
             if (null == tcl) {
                 break;
             }
-        } while(!tcl.equals(scl));
+        } while(!tcl.equals(scl.getParent()));
     }
 
     private URL composeUrl(String s) {

Modified: incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBEncoderDecoder.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBEncoderDecoder.java?rev=613498&r1=613497&r2=613498&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBEncoderDecoder.java
(original)
+++ incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBEncoderDecoder.java
Sat Jan 19 18:12:08 2008
@@ -627,7 +627,7 @@
         } catch (Fault ex) {
             ex.fillInStackTrace();
             throw ex;
-        } catch (Exception ex) {
+        } catch (Throwable ex) {
             if (ex instanceof javax.xml.bind.UnmarshalException) {
                 javax.xml.bind.UnmarshalException unmarshalEx = (javax.xml.bind.UnmarshalException)ex;
                 throw new Fault(new Message("UNMARSHAL_ERROR", BUNDLE, unmarshalEx.getLinkedException()

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/resources/META-INF/cxf/cxf-extension-jaxws.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/resources/META-INF/cxf/cxf-extension-jaxws.xml?rev=613498&r1=613497&r2=613498&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/resources/META-INF/cxf/cxf-extension-jaxws.xml
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/resources/META-INF/cxf/cxf-extension-jaxws.xml
Sat Jan 19 18:12:08 2008
@@ -26,4 +26,6 @@
     
     <bean class="org.apache.cxf.jaxws.context.WebServiceContextResourceResolver" 
 	  id="org.apache.cxf.jaxws.context.WebServiceContextResourceResolver" lazy-init="false"/>
+    <bean class="org.apache.cxf.jaxws.context.WebServiceContextImpl" 
+	  id="org.apache.cxf.jaxws.context.WebServiceContextImpl"/>
 </beans>

Modified: incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ClassUtils.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ClassUtils.java?rev=613498&r1=613497&r2=613498&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ClassUtils.java
(original)
+++ incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ClassUtils.java
Sat Jan 19 18:12:08 2008
@@ -31,9 +31,9 @@
 
 import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.common.util.Compiler;
 import org.apache.cxf.helpers.FileUtils;
 import org.apache.cxf.tools.util.ClassCollector;
-import org.apache.cxf.tools.util.Compiler;
 
 public class ClassUtils {
     

Modified: incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ProcessorTestBase.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ProcessorTestBase.java?rev=613498&r1=613497&r2=613498&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ProcessorTestBase.java
(original)
+++ incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ProcessorTestBase.java
Sat Jan 19 18:12:08 2008
@@ -21,8 +21,10 @@
 
 import java.io.File;
 import java.io.FileInputStream;
+import java.io.IOException;
 import java.io.InputStream;
 
+import java.net.URI;
 import java.net.URISyntaxException;
 import java.net.URL;
 import java.net.URLClassLoader;
@@ -32,6 +34,9 @@
 import java.util.Iterator;
 import java.util.List;
 import java.util.StringTokenizer;
+import java.util.jar.Attributes;
+import java.util.jar.JarFile;
+
 import javax.xml.namespace.QName;
 
 import org.apache.cxf.common.util.StringUtils;
@@ -67,7 +72,7 @@
         env = null;
     }
 
-    protected String getClassPath() throws URISyntaxException {
+    protected String getClassPath() throws URISyntaxException, IOException {
         ClassLoader loader = getClass().getClassLoader();
         StringBuffer classPath = new StringBuffer();
         if (loader instanceof URLClassLoader) {
@@ -79,6 +84,30 @@
                 if (filename.indexOf("junit") == -1) {
                     classPath.append(filename);
                     classPath.append(System.getProperty("path.separator"));
+                }
+                if (filename.indexOf("surefirebooter") != -1) {
+                    //surefire 2.4 uses a MANIFEST classpath that javac doesn't like
+                    JarFile jar = new JarFile(filename);
+                    Attributes attr = jar.getManifest().getMainAttributes();
+                    if (attr != null) {
+                        String cp = attr.getValue("Class-Path");
+                        while (cp != null) {
+                            String fileName = cp;
+                            int idx = fileName.indexOf(' ');
+                            if (idx != -1) {
+                                fileName = fileName.substring(0, idx);
+                                cp =  cp.substring(idx + 1).trim();
+                            } else {
+                                cp = null;
+                            }
+                            URI uri = new URI(fileName);
+                            File f2 = new File(uri);
+                            if (f2.exists()) {
+                                classPath.append(f2.getAbsolutePath());
+                                classPath.append(System.getProperty("path.separator"));
+                            }
+                        }
+                    }
                 }
             }
         }

Modified: incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/BeanGenerator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/BeanGenerator.java?rev=613498&r1=613497&r2=613498&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/BeanGenerator.java
(original)
+++ incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/generator/wsdl11/BeanGenerator.java
Sat Jan 19 18:12:08 2008
@@ -24,11 +24,11 @@
 import java.util.Collection;
 import java.util.List;
 
+import org.apache.cxf.common.util.Compiler;
 import org.apache.cxf.service.model.ServiceInfo;
 import org.apache.cxf.tools.common.VelocityGenerator;
 import org.apache.cxf.tools.common.model.JavaClass;
 import org.apache.cxf.tools.java2wsdl.generator.AbstractGenerator;
-import org.apache.cxf.tools.util.Compiler;
 import org.apache.cxf.tools.util.FileWriterUtil;
 
 public class BeanGenerator extends AbstractGenerator<File> {

Modified: incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2ws/JavaToWSTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2ws/JavaToWSTest.java?rev=613498&r1=613497&r2=613498&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2ws/JavaToWSTest.java
(original)
+++ incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2ws/JavaToWSTest.java
Sat Jan 19 18:12:08 2008
@@ -23,10 +23,10 @@
 import java.net.URL;
 import java.net.URLClassLoader;
 
+import org.apache.cxf.common.util.Compiler;
 import org.apache.cxf.helpers.FileUtils;
 import org.apache.cxf.tools.common.ToolContext;
 import org.apache.cxf.tools.common.ToolTestBase;
-import org.apache.cxf.tools.util.Compiler;
 
 import org.junit.After;
 import org.junit.Before;



Mime
View raw message