You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by jo...@apache.org on 2006/10/29 23:37:22 UTC
svn commit: r469019 - in /webservices/axis2/branches/java/1_1/modules/tool:
axis2-aar-maven-plugin/src/site/ axis2-aar-maven-plugin/src/site/apt/
axis2-wsdl2code-maven-plugin/src/main/java/org/apache/axis2/maven2/wsdl2code/
axis2-wsdl2code-maven-plugin...
Author: jochen
Date: Sun Oct 29 14:37:21 2006
New Revision: 469019
URL: http://svn.apache.org/viewvc?view=rev&rev=469019
Log:
Adding initial documentation for the wsl2code plugin for Maven2.
Added:
webservices/axis2/branches/java/1_1/modules/tool/axis2-wsdl2code-maven-plugin/src/main/java/org/apache/axis2/maven2/wsdl2code/NamespaceURIMapping.java
webservices/axis2/branches/java/1_1/modules/tool/axis2-wsdl2code-maven-plugin/src/site/
webservices/axis2/branches/java/1_1/modules/tool/axis2-wsdl2code-maven-plugin/src/site/apt/
webservices/axis2/branches/java/1_1/modules/tool/axis2-wsdl2code-maven-plugin/src/site/apt/configuration.apt
webservices/axis2/branches/java/1_1/modules/tool/axis2-wsdl2code-maven-plugin/src/site/apt/goals.apt
webservices/axis2/branches/java/1_1/modules/tool/axis2-wsdl2code-maven-plugin/src/site/apt/introduction.apt
webservices/axis2/branches/java/1_1/modules/tool/axis2-wsdl2code-maven-plugin/src/site/site.xml
Removed:
webservices/axis2/branches/java/1_1/modules/tool/axis2-aar-maven-plugin/src/site/apt/introduction.apt
Modified:
webservices/axis2/branches/java/1_1/modules/tool/axis2-aar-maven-plugin/src/site/apt/howto.apt
webservices/axis2/branches/java/1_1/modules/tool/axis2-aar-maven-plugin/src/site/site.xml
webservices/axis2/branches/java/1_1/modules/tool/axis2-wsdl2code-maven-plugin/src/main/java/org/apache/axis2/maven2/wsdl2code/WSDL2CodeMojo.java
webservices/axis2/branches/java/1_1/modules/tool/axis2-wsdl2code-maven-plugin/src/test/test1/pom.xml
Modified: webservices/axis2/branches/java/1_1/modules/tool/axis2-aar-maven-plugin/src/site/apt/howto.apt
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/tool/axis2-aar-maven-plugin/src/site/apt/howto.apt?view=diff&rev=469019&r1=469018&r2=469019
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/tool/axis2-aar-maven-plugin/src/site/apt/howto.apt (original)
+++ webservices/axis2/branches/java/1_1/modules/tool/axis2-aar-maven-plugin/src/site/apt/howto.apt Sun Oct 29 14:37:21 2006
@@ -5,7 +5,7 @@
<jo...@gmail.com>
------
-Introduction
+Goals
The Aar plugin allows the packaging of an Axis 2 service aar in 3 different modes:
Modified: webservices/axis2/branches/java/1_1/modules/tool/axis2-aar-maven-plugin/src/site/site.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/tool/axis2-aar-maven-plugin/src/site/site.xml?view=diff&rev=469019&r1=469018&r2=469019
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/tool/axis2-aar-maven-plugin/src/site/site.xml (original)
+++ webservices/axis2/branches/java/1_1/modules/tool/axis2-aar-maven-plugin/src/site/site.xml Sun Oct 29 14:37:21 2006
@@ -29,8 +29,10 @@
</bannerRight>
<body>
<links>
- <item name="Maven 2" href="http://maven.apache.org/maven2/"/>
+ <item name="Apache" href="http://www.apache.org/"/>
+ <item name="Webservices" href="http://ws.apache.org/"/>
<item name="Axis 2" href="http://ws.apache.org/axis2/"/>
+ <item name="Maven 2" href="http://maven.apache.org/maven2/"/>
</links>
<menu name="Overview">
Added: webservices/axis2/branches/java/1_1/modules/tool/axis2-wsdl2code-maven-plugin/src/main/java/org/apache/axis2/maven2/wsdl2code/NamespaceURIMapping.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/tool/axis2-wsdl2code-maven-plugin/src/main/java/org/apache/axis2/maven2/wsdl2code/NamespaceURIMapping.java?view=auto&rev=469019
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/tool/axis2-wsdl2code-maven-plugin/src/main/java/org/apache/axis2/maven2/wsdl2code/NamespaceURIMapping.java (added)
+++ webservices/axis2/branches/java/1_1/modules/tool/axis2-wsdl2code-maven-plugin/src/main/java/org/apache/axis2/maven2/wsdl2code/NamespaceURIMapping.java Sun Oct 29 14:37:21 2006
@@ -0,0 +1,34 @@
+package org.apache.axis2.maven2.wsdl2code;
+
+/**
+ * Data class for specifying URI->Package mappings.
+ */
+public class NamespaceURIMapping {
+ private String uri, packageName;
+
+ /**
+ * Returns the package name, to which the URI shall be mapped.
+ */
+ public String getPackageName() {
+ return packageName;
+ }
+
+ /**
+ * Sets the package name, to which the URI shall be mapped.
+ */
+ public void setPackageName(String pPackageName) {
+ packageName = pPackageName;
+ }
+
+ /** Returns the URI, which shall be mapped.
+ */
+ public String getUri() {
+ return uri;
+ }
+
+ /** Sets the URI, which shall be mapped.
+ */
+ public void setUri(String pUri) {
+ uri = pUri;
+ }
+}
Modified: webservices/axis2/branches/java/1_1/modules/tool/axis2-wsdl2code-maven-plugin/src/main/java/org/apache/axis2/maven2/wsdl2code/WSDL2CodeMojo.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/tool/axis2-wsdl2code-maven-plugin/src/main/java/org/apache/axis2/maven2/wsdl2code/WSDL2CodeMojo.java?view=diff&rev=469019&r1=469018&r2=469019
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/tool/axis2-wsdl2code-maven-plugin/src/main/java/org/apache/axis2/maven2/wsdl2code/WSDL2CodeMojo.java (original)
+++ webservices/axis2/branches/java/1_1/modules/tool/axis2-wsdl2code-maven-plugin/src/main/java/org/apache/axis2/maven2/wsdl2code/WSDL2CodeMojo.java Sun Oct 29 14:37:21 2006
@@ -141,7 +141,7 @@
* Whether to generate a "services.xml" file.
* @parameter expression="${axis2.wsdl2code.generateServicesXml}" default-value="false"
*/
- private boolean generateServiceXml;
+ private boolean generateServicesXml;
/**
* Whether to generate simply all classes. This is only valid in conjunction with
@@ -163,10 +163,15 @@
private boolean generateServerSideInterface = false;
/**
- * @parameter
+ * @parameter expression="${axis2.wsdl2code.namespaceToPackages}"
*/
private String namespaceToPackages = null;
+ /**
+ * @parameter
+ */
+ private NamespaceURIMapping[] namespaceURIs;
+
private static class InheritedArtifact
{
private final String groupId, artifactId;
@@ -277,7 +282,7 @@
new String[0]));
//services XML generation - effective only when specified as the server side
- if (generateServiceXml) {
+ if (generateServicesXml) {
optionMap.put(
CommandLineOptionConstants.WSDL2JavaConstants
.GENERATE_SERVICE_DESCRIPTION_OPTION,
@@ -340,11 +345,38 @@
CommandLineOptionConstants.WSDL2JavaConstants.NAME_SPACE_TO_PACKAGE_OPTION,
new CommandLineOption(
CommandLineOptionConstants.WSDL2JavaConstants.NAME_SPACE_TO_PACKAGE_OPTION,
- new String[]{namespaceToPackages}));
+ new String[]{getNamespaceToPackagesMap()}));
return optionMap;
}
+ private String getNamespaceToPackagesMap() throws MojoFailureException {
+ StringBuffer sb = new StringBuffer();
+ if (namespaceToPackages != null) {
+ sb.append(namespaceToPackages);
+ }
+ if (namespaceURIs != null) {
+ for (int i = 0; i < namespaceURIs.length; i++) {
+ NamespaceURIMapping mapping = namespaceURIs[i];
+ String uri = mapping.getUri();
+ if (uri == null) {
+ throw new MojoFailureException("A namespace to package mapping requires an uri child element.");
+ }
+ String uriPackageName = mapping.getPackageName();
+ if (uriPackageName != null) {
+ throw new MojoFailureException("A namespace to package mapping requires a packageName child element.");
+ }
+ if(sb.length() > 0) {
+ sb.append(",");
+ }
+ sb.append(uri);
+ sb.append('=');
+ sb.append(uriPackageName);
+ }
+ }
+ return sb.toString();
+ }
+
/**
* Utility method to convert a string into a single item string[]
* @param value
Added: webservices/axis2/branches/java/1_1/modules/tool/axis2-wsdl2code-maven-plugin/src/site/apt/configuration.apt
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/tool/axis2-wsdl2code-maven-plugin/src/site/apt/configuration.apt?view=auto&rev=469019
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/tool/axis2-wsdl2code-maven-plugin/src/site/apt/configuration.apt (added)
+++ webservices/axis2/branches/java/1_1/modules/tool/axis2-wsdl2code-maven-plugin/src/site/apt/configuration.apt Sun Oct 29 14:37:21 2006
@@ -0,0 +1,71 @@
+Configuration
+
+ The WSDL2Code goal takes the following parameters as input. All parameters can be set from the command line by using
+ properties. For example, the parameter "generateServerSide" may be set using the property
+ "axis2.wsdl2code.generateServerSide". If the parameter isn't set via property or in the POM, then a default
+ value applies.
+
+*-----------------------------+------------------------------------------------+------------------------------------------------+
+| Parameter name | Command line property | Description |
+| | Default value | |
+*-----------------------------+------------------------------------------------+------------------------------------------------+
+| databindingName | ${axis2.wsdl2code.databindingName} | Data binding framework, which is being used by |
+| | adb | the generated sources. |
+*-----------------------------+------------------------------------------------+------------------------------------------------+
+| generateAllClasses | ${axis2.wsdl2code.generateAllClasses} | Whether to generate simply all classes. This |
+| | false | is only valid in conjunction with |
+| | | "generateServerSide". |
+*-----------------------------+------------------------------------------------+------------------------------------------------+
+| generateServerSide | ${axis2.wsdl2code.generateServerSide} | Whether server side sources are being |
+| | false | generated. |
+*-----------------------------+------------------------------------------------+------------------------------------------------+
+| generateServerSideInterface | ${axis2.wsdl2code.generateServerSideInterface} | Whether to generate the server side |
+| | false | interface. |
+*-----------------------------+------------------------------------------------+------------------------------------------------+
+| generateServicesXml | ${axis2.wsdl2code.generateServicesXml} | Whether a "services.xml" file is being |
+| | false | generated. |
+*-----------------------------+------------------------------------------------+------------------------------------------------+
+| generateTestcase | ${axis2.wsdl2code.generateTestCase} | Whether a test case is being generated. |
+| | false | |
+*-----------------------------+------------------------------------------------+------------------------------------------------+
+| language | ${axis2.wsdl2code.language} | Programming language of the generated sources. |
+| | java | |
+*-----------------------------+------------------------------------------------+------------------------------------------------+
+| namespaceToPackages | ${axis2.wsdl2code.namespaceToPackages} | Map of namespace URI to packages in the format |
+| | | uri1=package1,uri2=package2,... |
+| | | Using this parameter is discouraged. In |
+| | | general, you should use the |
+| | | namespaceUris parameter. However, the latter |
+| | | cannot be set on the command line. |
+*-----------------------------+------------------------------------------------+------------------------------------------------+
+| namespaceURIs | | Map of namespace URI to packages. Example: |
+| | | \<namespaceURIs\> |
+| | | \<namespaceURI\> |
+| | | \<uri\>uri1\</uri1\> |
+| | | \<package\>package1\</package\> |
+| | | \</namespaceURI\> |
+| | | ... |
+| | | \</namespaceURIs\> |
+*-----------------------------+------------------------------------------------+------------------------------------------------+
+| outputDirectory | ${axis2.wsdl2code.target} | Target directory, where sources are being |
+| | target/generated-sources/axis2/wsdl2code | generated. |
+*-----------------------------+------------------------------------------------+------------------------------------------------+
+| packageName | ${axis2.wsdl2code.package} | Package name of the generated sources. |
+*-----------------------------+------------------------------------------------+------------------------------------------------+
+| portName | ${axis2.wsdl2code.portName} | Port name, for which sources are being |
+| | | generated. By default, sources are generated |
+| | | for all ports. |
+*-----------------------------+------------------------------------------------+------------------------------------------------+
+| serviceName | ${axis2.wsdl2code.serviceName} | Service name, for which sources are being |
+| | | generated. By default, sources are generated |
+| | | for all services. |
+*-----------------------------+------------------------------------------------+------------------------------------------------+
+| syncMode | ${axis2.wsdl2code.syncMode} | Sync mode, for which sources are being |
+| | both | generated; either of "sync", "async", or |
+| | | "both" (default). |
+*-----------------------------+------------------------------------------------+------------------------------------------------+
+| unpackClasses | ${axis2.wsdl2code.unpackClasses} | Whether to unpack classes. |
+*-----------------------------+------------------------------------------------+------------------------------------------------|
+| wsdlFile | ${axis2.wsdl2code.wsdl} | Location of the WSDL file, which is read as |
+| | src/main/axis2/service.wsdl | input. |
+*-----------------------------+------------------------------------------------+------------------------------------------------+
Added: webservices/axis2/branches/java/1_1/modules/tool/axis2-wsdl2code-maven-plugin/src/site/apt/goals.apt
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/tool/axis2-wsdl2code-maven-plugin/src/site/apt/goals.apt?view=auto&rev=469019
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/tool/axis2-wsdl2code-maven-plugin/src/site/apt/goals.apt (added)
+++ webservices/axis2/branches/java/1_1/modules/tool/axis2-wsdl2code-maven-plugin/src/site/apt/goals.apt Sun Oct 29 14:37:21 2006
@@ -0,0 +1,55 @@
+ ------
+ Maven 2 WSDL2Code Plugin: configuration examples
+ ------
+ Jochen Wiedmann
+ <jo...@gmail.com>
+ ------
+
+Goals
+
+ The WSDl2Code offers a single goal:
+
+ * wsdl2code (default): Reads the WSDL and generates code.
+
+ To run the plugin, add the following section to your POM:
+
+------------------------
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.axis2.maven2</groupId>
+ <artifactId>axis2-wsdl2code-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>wsdl2code</goal>
+ </goals>
+ </execution>
+ <configuration>
+ <packageName>com.foo.myservice</packageName>
+ </configuration>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+------------------------
+
+ The plugin will be invoked automatically in the generate-sources
+ phase. You can also invoke it directly from the command line by
+ running the command
+
++--------
+ mvn wsdl2code:wsdl2code
++---------
+
+
+The WSDL2Code Goal
+
+ By default, the plugin reads the file <<<src/main/axis2/service.wsdl>>>.
+ Sources for the Java programming language and the ADB data binding are
+ generated into <<<target/generated-sources/axis2/wsdl2code>>>.
+ Note the configuration element <<<packageName>>> above, which sets
+ the package name, thus a subdirectory.
+
+ See the detailed documentation on {{{configuration.html}properties}} for
+ how to configure the goal.
Added: webservices/axis2/branches/java/1_1/modules/tool/axis2-wsdl2code-maven-plugin/src/site/apt/introduction.apt
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/tool/axis2-wsdl2code-maven-plugin/src/site/apt/introduction.apt?view=auto&rev=469019
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/tool/axis2-wsdl2code-maven-plugin/src/site/apt/introduction.apt (added)
+++ webservices/axis2/branches/java/1_1/modules/tool/axis2-wsdl2code-maven-plugin/src/site/apt/introduction.apt Sun Oct 29 14:37:21 2006
@@ -0,0 +1,14 @@
+ ------
+ Maven 2 WSDL2Code Plugin
+ ------
+ Jochen Wiedmann
+ <jo...@gmail.com>
+ ------
+
+Introduction
+
+ This plugin generates takes as input a WSDL and generates client
+ and server stubs for calling or implementing a web service
+ matching the WSDL.
+
+ The full description of goals is available {{{goals.html}here}}.
Added: webservices/axis2/branches/java/1_1/modules/tool/axis2-wsdl2code-maven-plugin/src/site/site.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/tool/axis2-wsdl2code-maven-plugin/src/site/site.xml?view=auto&rev=469019
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/tool/axis2-wsdl2code-maven-plugin/src/site/site.xml (added)
+++ webservices/axis2/branches/java/1_1/modules/tool/axis2-wsdl2code-maven-plugin/src/site/site.xml Sun Oct 29 14:37:21 2006
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<!--
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+-->
+
+<project name="Maven Axis 2 WSDL2Code Plugin">
+ <bannerLeft>
+ <name>Maven Axis 2 WSDL2Code Plugin</name>
+ <src>http://maven.apache.org/images/apache-maven-project.png</src>
+ <href>http://maven.apache.org/</href>
+ </bannerLeft>
+ <bannerRight>
+ <src>http://maven.apache.org/images/maven-small.gif</src>
+ </bannerRight>
+ <body>
+ <links>
+ <item name="Apache" href="http://www.apache.org/"/>
+ <item name="Webservices" href="http://ws.apache.org/"/>
+ <item name="Axis 2" href="http://ws.apache.org/axis2/"/>
+ <item name="Maven 2" href="http://maven.apache.org/maven2/"/>
+ </links>
+
+ <menu name="Overview">
+ <item name="Introduction" href="introduction.html"/>
+ <item name="How to Use" href="howto.html"/>
+ <item name="Configuration" href="configuration.html"/>
+ </menu>
+ ${reports}
+ </body>
+</project>
Modified: webservices/axis2/branches/java/1_1/modules/tool/axis2-wsdl2code-maven-plugin/src/test/test1/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/tool/axis2-wsdl2code-maven-plugin/src/test/test1/pom.xml?view=diff&rev=469019&r1=469018&r2=469019
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/tool/axis2-wsdl2code-maven-plugin/src/test/test1/pom.xml (original)
+++ webservices/axis2/branches/java/1_1/modules/tool/axis2-wsdl2code-maven-plugin/src/test/test1/pom.xml Sun Oct 29 14:37:21 2006
@@ -15,7 +15,7 @@
<generateServerSide>true</generateServerSide>
<generateServerSideInterface>true</generateServerSideInterface>
<generateAllClasses>true</generateAllClasses>
- <generateServiceXml>true</generateServiceXml>
+ <generateServicesXml>true</generateServicesXml>
<packageName>demo</packageName>
</configuration>
</plugin>
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org