Return-Path: Delivered-To: apmail-incubator-cxf-dev-archive@locus.apache.org Received: (qmail 97810 invoked from network); 25 Sep 2007 02:12:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 25 Sep 2007 02:12:59 -0000 Received: (qmail 15328 invoked by uid 500); 25 Sep 2007 02:12:49 -0000 Delivered-To: apmail-incubator-cxf-dev-archive@incubator.apache.org Received: (qmail 15281 invoked by uid 500); 25 Sep 2007 02:12:49 -0000 Mailing-List: contact cxf-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cxf-dev@incubator.apache.org Delivered-To: mailing list cxf-dev@incubator.apache.org Received: (qmail 15272 invoked by uid 99); 25 Sep 2007 02:12:49 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Sep 2007 19:12:49 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jim.ma@iona.com designates 12.170.54.180 as permitted sender) Received: from [12.170.54.180] (HELO amer-mx1.iona.com) (12.170.54.180) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Sep 2007 02:12:45 +0000 X-IronPort-AV: E=Sophos;i="4.20,293,1186372800"; d="scan'208";a="5668047" Received: from amer-ems1.ionaglobal.com ([10.65.6.25]) by amer-mx1.iona.com with ESMTP; 24 Sep 2007 22:12:24 -0400 Received: from [10.129.9.224] ([10.129.9.224]) by amer-ems1.IONAGLOBAL.COM with Microsoft SMTPSVC(6.0.3790.1830); Mon, 24 Sep 2007 22:12:21 -0400 Message-ID: <46F86D69.7050607@iona.com> Date: Tue, 25 Sep 2007 10:07:37 +0800 From: Jim Ma User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 To: cxf-dev@incubator.apache.org Subject: Re: svn commit: r578749 - in /incubator/cxf/trunk: ./ maven-plugins/java2ws-plugin/ maven-plugins/java2ws-plugin/main/ maven-plugins/java2ws-plugin/main/java/ maven-plugins/java2ws-plugin/main/java/org/ maven-plugins/java2ws-plugin/main/java/org/apache/ ma... References: <20070924103132.147701A9832@eris.apache.org> <200709241021.56991.dkulp@apache.org> In-Reply-To: <200709241021.56991.dkulp@apache.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 25 Sep 2007 02:12:21.0863 (UTC) FILETIME=[81B35F70:01C7FF19] X-Virus-Checked: Checked by ClamAV on apache.org Thanks Dan , I will revert this merge for TCK to pass. Jim Daniel Kulp wrote: >> [CXF-1040]Merged -s and -d flag for java2ws >> Added java2ws maven plugin >> > > I think I have to -1 this..... > > For the TCK to pass, I need three output locations: > > 1) location for compiled .class files > 2) location for source .java files > 3) location for wsdl and schema files (and possibly other things like > cxf.xml files, etc...) > > #2 and #3 HAVE to be different directories. > > > Dan > > > On Monday 24 September 2007, ema@apache.org wrote: > >> Author: ema >> Date: Mon Sep 24 03:31:25 2007 >> New Revision: 578749 >> >> URL: http://svn.apache.org/viewvc?rev=578749&view=rev >> Log: >> [CXF-1040]Merged -s and -d flag for java2ws >> Added java2ws maven plugin >> >> Added: >> incubator/cxf/trunk/maven-plugins/java2ws-plugin/ >> incubator/cxf/trunk/maven-plugins/java2ws-plugin/main/ >> incubator/cxf/trunk/maven-plugins/java2ws-plugin/main/java/ >> incubator/cxf/trunk/maven-plugins/java2ws-plugin/main/java/org/ >> >> incubator/cxf/trunk/maven-plugins/java2ws-plugin/main/java/org/apache/ >> incubator/cxf/trunk/maven-plugins/java2ws-plugin/main/java/org/apache/ >> cxf/ >> incubator/cxf/trunk/maven-plugins/java2ws-plugin/main/java/org/apache/ >> cxf/maven_plugin/ >> incubator/cxf/trunk/maven-plugins/java2ws-plugin/main/java/org/apache/ >> cxf/maven_plugin/Java2WSMojo.java >> incubator/cxf/trunk/maven-plugins/java2ws-plugin/pom.xml >> Modified: >> incubator/cxf/trunk/pom.xml >> >> incubator/cxf/trunk/tools/anttask/src/main/java/org/apache/cxf/ant/ext >> ensions/Java2WSTask.java >> incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools >> /java2ws/java2ws.xml >> incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools >> /java2wsdl/processor/JavaToWSDLProcessor.java >> incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools >> /java2wsdl/processor/JavaToProcessorTest.java >> >> Added: >> incubator/cxf/trunk/maven-plugins/java2ws-plugin/main/java/org/apache/ >> cxf/maven_plugin/Java2WSMojo.java URL: >> http://svn.apache.org/viewvc/incubator/cxf/trunk/maven-plugins/java2ws >> -plugin/main/java/org/apache/cxf/maven_plugin/Java2WSMojo.java?rev=5787 >> 49&view=auto >> ====================================================================== >> ======== --- >> incubator/cxf/trunk/maven-plugins/java2ws-plugin/main/java/org/apache/ >> cxf/maven_plugin/Java2WSMojo.java (added) +++ >> incubator/cxf/trunk/maven-plugins/java2ws-plugin/main/java/org/apache/ >> cxf/maven_plugin/Java2WSMojo.java Mon Sep 24 03:31:25 2007 @@ -0,0 >> +1,265 @@ >> +/** >> + * 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.cxf.maven_plugin; >> + >> +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.java2ws.JavaToWS; >> +import org.apache.maven.plugin.AbstractMojo; >> +import org.apache.maven.plugin.MojoExecutionException; >> +import org.apache.maven.project.MavenProject; >> +import org.apache.tools.ant.ExitException; >> +import org.apache.tools.ant.util.optional.NoExitSecurityManager; >> + >> +/** >> + * @goal java2ws >> + * @description CXF Java To Webservice Tool >> + */ >> +public class Java2WSMojo extends AbstractMojo { >> + /** >> + * @parameter >> + * @required >> + */ >> + private String className; >> + >> + /** >> + * @parameter expression="${project.build.outputDirectory}" >> + * @required >> + */ >> + private String classpath; >> + >> + /** >> + * @parameter >> + */ >> + private String outputFile; >> + >> + /** >> + * @parameter >> + */ >> + private Boolean soap12; >> + >> + /** >> + * @parameter >> + */ >> + private String targetNamespace; >> + >> + /** >> + * @parameter >> + */ >> + private String serviceName; >> + >> + /** >> + * @parameter >> + */ >> + private Boolean verbose; >> + >> + /** >> + * @parameter >> + */ >> + private Boolean quiet; >> + >> + /** >> + * @parameter expression="${project.compileClasspathElements}" >> + * @required >> + */ >> + private List classpathElements; >> + >> + /** >> + * @parameter expression="${project}" >> + * @required >> + */ >> + private MavenProject project; >> + >> + /** >> + * @parameter >> + */ >> + private String argline; >> + >> + /** >> + * @parameter >> + */ >> + private String frontend; >> + >> + /** >> + * @parameter >> + */ >> + private String databinding; >> + /** >> + * @parameter default-value="false" >> + */ >> + private Boolean genWsdl; >> + /** >> + * @parameter default-value="false" >> + */ >> + private Boolean genServer; >> + /** >> + * @parameter default-value="false" >> + */ >> + private Boolean genClient; >> + /** >> + * @parameter default-value="false" >> + */ >> + private Boolean genWrapperbean; >> + >> + >> + public void execute() throws MojoExecutionException { >> + StringBuffer buf = new StringBuffer(); >> + for (Object classpathElement : classpathElements) { >> + buf.append(classpathElement.toString()); >> + buf.append(File.pathSeparatorChar); >> + } >> + String newCp = buf.toString(); >> + String cp = System.getProperty("java.class.path"); >> + SecurityManager oldSm = System.getSecurityManager(); >> + try { >> + System.setProperty("java.class.path", newCp); >> + System.setSecurityManager(new NoExitSecurityManager()); >> + processJavaClass(); >> + } finally { >> + System.setSecurityManager(oldSm); >> + System.setProperty("java.class.path", cp); >> + } >> + >> + System.gc(); >> + } >> + >> + private void processJavaClass() throws MojoExecutionException { >> + List args = new ArrayList(); >> + >> + // outputfile arg >> + if (outputFile == null && project != null) { >> + // Put the wsdl in target/generated/wsdl >> + int i = className.lastIndexOf('.'); >> + // Prone to OoBE, but then it's wrong anyway >> + String name = className.substring(i + 1); >> + outputFile = (project.getBuild().getDirectory() + >> "/generated/wsdl/" + name + ".wsdl") + .replace("/", >> File.separator); >> + } >> + if (outputFile != null) { >> + // JavaToWSDL freaks out if the directory of the >> outputfile doesn't exist, so lets + // create it since >> there's no easy way for the user to create it beforehand in maven + >> FileUtils.mkDir(new File(outputFile).getParentFile()); + >> args.add("-o"); >> + args.add(outputFile); >> + >> + /* >> + Contributor's comment: >> + Sometimes JavaToWSDL creates Java code for the >> wrappers. I don't *think* this is + needed by the end >> user. >> + */ >> + >> + // Commiter's comment: >> + // Yes, it's required, it's defined in the JAXWS spec. >> + >> + if (project != null) { >> + project.addCompileSourceRoot(new >> File(outputFile).getParentFile().getAbsolutePath()); + } >> + } >> + >> + if (frontend != null) { >> + args.add("-frontend"); >> + args.add(frontend); >> + } >> + >> + if (databinding != null) { >> + args.add("-databinding"); >> + args.add(databinding); >> + } >> + >> + if (genWrapperbean) { >> + args.add("-wrapperbean"); >> + } >> + >> + if (genWsdl) { >> + args.add("-wsdl"); >> + } >> + >> + if (genServer) { >> + args.add("-server"); >> + } >> + >> + if (genClient) { >> + args.add("-client"); >> + } >> + >> + // classpath arg >> + args.add("-cp"); >> + args.add(classpath); >> + >> + // soap12 arg >> + if (soap12 != null && soap12.booleanValue()) { >> + args.add("-soap12"); >> + } >> + >> + // target namespace arg >> + if (targetNamespace != null) { >> + args.add("-t"); >> + args.add(targetNamespace); >> + } >> + >> + // servicename arg >> + if (serviceName != null) { >> + args.add("-servicename"); >> + args.add(serviceName); >> + } >> + >> + // verbose arg >> + if (verbose != null && verbose.booleanValue()) { >> + args.add("-verbose"); >> + } >> + >> + // quiet arg >> + if (quiet != null && quiet.booleanValue()) { >> + args.add("-quiet"); >> + } >> + >> + if (argline != null) { >> + StringTokenizer stoken = new StringTokenizer(argline, " >> "); + while (stoken.hasMoreTokens()) { >> + args.add(stoken.nextToken()); >> + } >> + } >> + >> + // classname arg >> + args.add(className); >> + >> + try { >> + String exitOnFinish = System.getProperty("exitOnFinish", >> ""); + try { >> + System.setProperty("exitOnFinish", "YES"); >> + JavaToWS.main(args.toArray(new String[args.size()])); >> + } catch (ExitException e) { >> + if (e.getStatus() != 0) { >> + throw e; >> + } >> + } finally { >> + System.setProperty("exitOnFinish", exitOnFinish); >> + } >> + } catch (Throwable e) { >> + getLog().debug(e); >> + throw new MojoExecutionException(e.getMessage(), e); >> + } >> + } >> + >> +} >> \ No newline at end of file >> >> Added: incubator/cxf/trunk/maven-plugins/java2ws-plugin/pom.xml >> URL: >> http://svn.apache.org/viewvc/incubator/cxf/trunk/maven-plugins/java2ws >> -plugin/pom.xml?rev=578749&view=auto >> ====================================================================== >> ======== --- incubator/cxf/trunk/maven-plugins/java2ws-plugin/pom.xml >> (added) +++ incubator/cxf/trunk/maven-plugins/java2ws-plugin/pom.xml >> Mon Sep 24 03:31:25 2007 @@ -0,0 +1,115 @@ >> + >> + >> +> 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"> + >> 4.0.0 >> + org.apache.cxf >> + cxf-java2ws-plugin >> + maven-plugin >> + 2.1-incubator-SNAPSHOT >> + Apache CXF Code Generation Maven2 Plugins >> + http://cwiki.apache.org/CXF >> + >> + >> + >> + org.apache.cxf >> + cxf-parent >> + 2.1-incubator-SNAPSHOT >> + ../../parent/pom.xml >> + >> + >> + >> + >> + junit >> + junit >> + test >> + >> + >> + >> + org.apache.maven >> + maven-plugin-api >> + provided >> + >> + >> + org.apache.maven >> + maven-project >> + provided >> + >> + >> + org.apache.maven >> + maven-artifact >> + provided >> + >> + >> + >> + org.apache.cxf >> + cxf-tools-common >> + ${project.version} >> + >> + >> + >> + org.apache.cxf >> + cxf-common-utilities >> + ${project.version} >> + >> + >> + >> + >> + >> + org.apache.cxf >> + cxf-tools-java2ws >> + ${project.version} >> + >> + >> + >> + ant >> + ant >> + >> + >> + ant >> + ant-nodeps >> + >> + >> + >> + + >> + >> + java.net >> + http://download.java.net/maven/1/ >> + legacy >> + >> + >> + >> + >> + >> scm:svn:http://svn.apache.org/repos/asf/incubator/cxf/trun >> k/maven-plugins/codegen-plugin + >> scm:svn:https://svn.apache.org/repos/asf/incubato >> r/cxf/trunk/maven-plugins/codegen-plugin + >> http://svn.apache.org/viewvc/incubator/cxf/trunk/cxf-parent/cxf-c >> odegen-plugin + >> + >> + >> \ No newline at end of file >> >> Modified: incubator/cxf/trunk/pom.xml >> URL: >> http://svn.apache.org/viewvc/incubator/cxf/trunk/pom.xml?rev=578749&r1 >> =578748&r2=578749&view=diff >> ====================================================================== >> ======== --- incubator/cxf/trunk/pom.xml (original) >> +++ incubator/cxf/trunk/pom.xml Mon Sep 24 03:31:25 2007 >> @@ -136,8 +136,10 @@ >> integration >> systests >> maven-plugins/codegen-plugin >> + maven-plugins/java2ws-plugin >> maven-plugins/archetypes >> maven-plugins/eclipse-plugin-generator >> + >> >> >> >> >> Modified: >> incubator/cxf/trunk/tools/anttask/src/main/java/org/apache/cxf/ant/ext >> ensions/Java2WSTask.java URL: >> http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/anttask/src/mai >> n/java/org/apache/cxf/ant/extensions/Java2WSTask.java?rev=578749&r1=578 >> 748&r2=578749&view=diff >> ====================================================================== >> ======== --- >> incubator/cxf/trunk/tools/anttask/src/main/java/org/apache/cxf/ant/ext >> ensions/Java2WSTask.java (original) +++ >> incubator/cxf/trunk/tools/anttask/src/main/java/org/apache/cxf/ant/ext >> ensions/Java2WSTask.java Mon Sep 24 03:31:25 2007 @@ -48,27 +48,27 @@ >> public void setGenwsdl(boolean gw) { >> genWsdl = gw; >> } >> - >> + >> public void setGenWrapperBean(boolean gwp) { >> genWrapperbean = gwp; >> } >> - >> + >> public void setGenClient(boolean gc) { >> genClient = gc; >> } >> - >> + >> public void setGenServer(boolean gs) { >> genServer = gs; >> } >> - >> + >> public void setFrontend(String ft) { >> frontend = ft; >> } >> - >> + >> public void setDatabinding(String db) { >> databinding = db; >> } >> - >> + >> public Path createClasspath() { >> if (classpath == null) { >> classpath = new Path(getProject()); >> @@ -127,34 +127,34 @@ >> >> cmd.createVmArgument().setLine("-Djava.util.logging.config.file="); >> >> cmd.setClassname(JavaToWS.class.getName()); >> - >> + >> if (!StringUtils.isEmpty(frontend)) { >> cmd.createArgument().setValue("-frontend"); >> cmd.createArgument().setValue(frontend); >> } >> - >> - >> + >> + >> if (!StringUtils.isEmpty(databinding)) { >> cmd.createArgument().setValue("-databinding"); >> cmd.createArgument().setValue(databinding); >> } >> - >> + >> if (genWsdl) { >> cmd.createArgument().setValue("-wsdl"); >> } >> - >> + >> if (genWrapperbean) { >> cmd.createArgument().setValue("-wrapperbean"); >> } >> - >> + >> if (genClient) { >> cmd.createArgument().setValue("-client"); >> } >> - >> + >> if (genServer) { >> cmd.createArgument().setValue("-server"); >> } >> - >> + >> if (classpath != null && !classpath.toString().equals("")) { >> cmd.createArgument().setValue("-cp"); >> cmd.createArgument().setPath(classpath); >> @@ -166,11 +166,7 @@ >> cmd.createArgument().setValue("-classdir"); >> cmd.createArgument().setFile(classesDir); >> } >> - if (null != sourcesDir >> - && !StringUtils.isEmpty(sourcesDir.getName())) { >> - cmd.createArgument().setValue("-s"); >> - cmd.createArgument().setFile(sourcesDir); >> - } >> + >> >> // verbose option >> if (verbose) { >> >> Modified: >> incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools >> /java2ws/java2ws.xml URL: >> http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/ws/src/m >> ain/java/org/apache/cxf/tools/java2ws/java2ws.xml?rev=578749&r1=578748& >> r2=578749&view=diff >> ====================================================================== >> ======== --- >> incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools >> /java2ws/java2ws.xml (original) +++ >> incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools >> /java2ws/java2ws.xml Mon Sep 24 03:31:25 2007 @@ -26,29 +26,31 @@ >> xmlns:ts="http://cxf.apache.org/Xutil/ToolSpecification"> >> >> >> - Examples : >> - java2ws -wsdl org.apache.hello_world_soap_http.Greeter >> - java2ws -cp ./tmp org.apache.hello_world_soap_http.Greeter -wsdl >> - java2ws -o hello.wsdl -wsdl >> org.apache.hello_world_soap_http.Greeter - java2ws -client -server >> org.apache.hello_world_soap_http.Greeter - java2ws -wrapperbean >> org.apache.hello_world_soap_http.Greeter + Examples : >> + java2ws -wsdl org.apache.hello_world_soap_http.Greeter >> + java2ws -cp ./tmp org.apache.hello_world_soap_http.Greeter -wsdl >> + java2ws -wsdl -o hello.wsdl >> org.apache.hello_world_soap_http.Greeter + java2ws -client -server >> org.apache.hello_world_soap_http.Greeter + java2ws -wrapperbean >> org.apache.hello_world_soap_http.Greeter >> >> >> - >> + >> >> >> - >> + >> >> - >> + >> >> - >> + >> >> - >> + >> >> >> >> >> >> >> >> - >> - >> - SEI class name >> - >> - >> + >> + SEI class name >> + >> >> >> >> Modified: >> incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools >> /java2wsdl/processor/JavaToWSDLProcessor.java URL: >> http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/ws/src/m >> ain/java/org/apache/cxf/tools/java2wsdl/processor/JavaToWSDLProcessor.j >> ava?rev=578749&r1=578748&r2=578749&view=diff >> ====================================================================== >> ======== --- >> incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools >> /java2wsdl/processor/JavaToWSDLProcessor.java (original) +++ >> incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools >> /java2wsdl/processor/JavaToWSDLProcessor.java Mon Sep 24 03:31:25 2007 >> @@ -304,7 +304,7 @@ >> } >> >> File getSourceDir() { >> - String dir = (String) >> this.context.get(ToolConstants.CFG_SOURCEDIR); + String dir = >> (String) this.context.get(ToolConstants.CFG_OUTPUTDIR); if >> (StringUtils.isEmpty(dir)) { >> return null; >> } >> >> Modified: >> incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools >> /java2wsdl/processor/JavaToProcessorTest.java URL: >> http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/ws/src/t >> est/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.j >> ava?rev=578749&r1=578748&r2=578749&view=diff >> ====================================================================== >> ======== --- >> incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools >> /java2wsdl/processor/JavaToProcessorTest.java (original) +++ >> incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools >> /java2wsdl/processor/JavaToProcessorTest.java Mon Sep 24 03:31:25 2007 >> @@ -248,7 +248,7 @@ >> env.put(ToolConstants.CFG_CLASSNAME, >> >> "org.apache.cxf.tools.fortest.classnoanno.docwrapped.Calculator"); >> env.put(ToolConstants.CFG_OUTPUTFILE, output.getPath() + >> "/my_stock.wsdl"); - env.put(ToolConstants.CFG_SOURCEDIR, >> output.getPath() + "/beans"); + >> env.put(ToolConstants.CFG_OUTPUTDIR, output.getPath() + "/beans"); >> env.put(ToolConstants.CFG_WRAPPERBEAN, ToolConstants.CFG_WRAPPERBEAN); >> >> processor.setEnvironment(env); >> > > > >