Skip to content

Commit

Permalink
[JBWS-4092] version upgrade to dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
rsearls committed Feb 1, 2018
1 parent 5180969 commit e6cfd9d
Show file tree
Hide file tree
Showing 6 changed files with 207 additions and 8 deletions.
199 changes: 199 additions & 0 deletions README.md
@@ -0,0 +1,199 @@
# jaxws-tools-maven-plugin

Maven plugin jaxws-tools-maven-plugin provides supports for wsconsume and wsprovide.

**Note**, prior to version 1.2.0.Final of this plugin the plugin name was maven-jaxws-tools-plugin.

**wsconsume** "consumes" the abstract contract (WSDL file) and produces portable JAX-WS service
and client artifacts.

**wsprovide** generates portable JAX-WS artifacts for a service endpoint implementation. It
can "provide" the abstract contract (WSDL file) for your service as well.



## POM file configuration
The plugin itself does not have an explicit dependency to a JBossWS stack. It is meant for
use with implementations of any supported version of the JBossWS SPI. The user is expected
to set a dependency in his own pom.xml to the desired JBossWS stack version. The plugin
will rely on that for the proper tooling. The user must add a reference to
org.jboss.ws.cxf:jbossws-cxf-client in his maven dependencies.


```xml
<dependencies>
<dependency>
<groupId>org.jboss.ws.cxf</groupId>
<artifactId>jbossws-cxf-client</artifactId>
<version>VERSION_HERE</version>
<scope>provided</scope>
</dependency>
</dependencies>
```


## wsconsume configuration

### wsconsume maven Goals
| goal | comment |
|------|---------|
|wsconsume | triggers the sources generation during __generate-sources__ phase |
|wsconsume-test | triggers the sources generation during __generate-test-sources__ phase |


### wsconsume maven plugin example

In this example the plugin is configured to run in the generate-sources phase.
This plugin consumes the test.wsdl file and generates SEI and wrappers' java sources.
The generated sources are then compiled together with the other project classes.


```xml
<build>
<plugins>
<plugin>
<groupId>org.jboss.ws.plugins</groupId>
<artifactId>jaxws-tools-maven-plugin</artifactId>
<version>1.2.0.Final</version>
<configuration>
<wsdls>
<wsdl>${basedir}/test.wsdl</wsdl>
</wsdls>
</configuration>
<executions>
<execution>
<goals>
<goal>wsconsume</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
```


In this example multiple wsdl files are declared for processing. In addition
it directs the target packaging to use SOAP 1.2 binding. Lastly the plugin is
instructed to be verbose in its processing information.

```xml
<build>
<plugins>
<plugin>
<groupId>org.jboss.ws.plugins</groupId>
<artifactId>jaxws-tools-maven-plugin</artifactId>
<version>1.2.0.Final</version>
<configuration>
<wsdls>
<wsdl>${basedir}/test.wsdl</wsdl>
<wsdl>${basedir}/test2.wsdl</wsdl>
</wsdls>
<targetPackage>foo.bar</targetPackage>
<extension>true</extension>
<verbose>true</verbose>
</configuration>
<executions>
<execution>
<goals>
<goal>wsconsume</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
```

In both examples above changing the goal from wsconsume to wsconsume-test
will result in the wsdl being processed for used in the testsuite only.


### wsconsume plugin parameters
The wsconsume plugin has the following parameters:

| Attribute | Description | Default |
|-----------|-------------|---------|
| bindingFiles | JAXWS or JAXB binding file | true |
| classpathElements | Each classpathElement provides a library file to be added to classpath | ${project.compileClasspathElements} or ${project.testClasspathElements} |
| catalog | Oasis XML Catalog file for entity resolution | none |
| targetPackage | The target Java package for generated code. | generated |
| bindingFiles | One or more JAX-WS or JAXB binding file | none |
| wsdlLocation | Value to use for @WebServiceClient.wsdlLocation | generated |
| outputDirectory | The output directory for generated artifacts. | ${project.build.outputDirectory} or ${project.build.testOutputDirectory} |
| sourceDirectory | The output directory for Java source. | ${project.build.directory}/generated-sources/wsconsume |
| verbose | Enables more informational output about command progress. | false |
| wsdls | The WSDL files or URLs to consume | n/a |
| extension | Enable SOAP 1.2 binding extension. | false |
| encoding | The charset encoding to use for generated sources. | ${project.build.sourceEncoding} |
| argLine | An optional additional argline to be used when running in fork mode; can be used to set endorse dir, enable debugging, etc. Example <argLine>-Djava.endorsed.dirs=...</argLine> | none |
| fork | Whether or not to run the generation task in a separate VM. | false |
| target | A preference for the JAX-WS specification target | Depends on the underlying stack and endorsed dirs if any |

## wsprovide configuration

### wsproduce maven Goals
| goal | comment |
|------|---------|
|wsproduce | triggers the sources generation during __process-classes__ phase |
|wsproduce-test | triggers the sources generation during __process-test-classes__ phase |


### wsprovide maven plugin example

In this example the plugin is configured to run during the generate-sources phase.
It produces the wsdl file and artifact sources for the specified endpoint class,
TestEndpoint. By changing the goal to wsprovide-test the same files will be
generated during the generate-test-sources phase.

```xml
<build>
<plugins>
<plugin>
<groupId>org.jboss.ws.plugins</groupId>
<artifactId>jaxws-tools-maven-plugin</artifactId>
<version>1.2.0.Final</version>
<configuration>
<verbose>true</verbose>
<endpointClass>org.jboss.test.ws.plugins.tools.wsprovide.TestEndpoint</endpointClass>
<generateWsdl>true</generateWsdl>
</configuration>
<executions>
<execution>
<goals>
<goal>wsprovide</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
```


### wsprovide plugin parameters
The wsprovide plugin has the following parameters:

| Attribute | Description | Default |
|-----------|-------------|---------|
| testClasspathElements | Each classpathElement provides a library file to be added to classpath | ${project.compileClasspathElements} or ${project.testClasspathElements} |
| outputDirectory | The output directory for generated artifacts. | ${project.build.outputDirectory} or ${project.build.testOutputDirectory} |
| resourceDirectory | The output directory for resource artifacts (WSDL/XSD). | ${project.build.directory}/wsprovide/resources |
| sourceDirectory | The output directory for Java source. | ${project.build.directory}/wsprovide/java |
| extension | Enable SOAP 1.2 binding extension. | false |
| generateWsdl | Whether or not to generate WSDL. | false |
| verbose | Enables more informational output about command progress. | false |
| portSoapAddress | The generated port soap:address in the WSDL | default |
| endpointClass | Service Endpoint Implementation. | default |


## Special note
Be careful when using this plugin with the Maven War Plugin. The War plugin
includes project dependency archives in the generated application war. It
is undesirable for org.jboss.ws.cxf:jbossws-cxf-client to be included
in the war file. To avoid this declare the jbossws-cxf-client dependency
scope as provided, (e.g. ``` <scope>provided</scope>```).




2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -25,7 +25,7 @@

<!-- Properties -->
<properties>
<jbossws.common.tools.version>1.2.1.Final</jbossws.common.tools.version>
<jbossws.common.tools.version>1.2.4.Final</jbossws.common.tools.version>
<getopt.version>1.0.13</getopt.version>
<log4j.version>1.2.14</log4j.version>
<maven.project.version>2.2.1</maven.project.version>
Expand Down
6 changes: 3 additions & 3 deletions src/test/resources/test-embedded/testEndorse/pom-cxf.xml
Expand Up @@ -120,17 +120,17 @@
<dependency>
<groupId>org.jboss.ws.cxf</groupId>
<artifactId>jbossws-cxf-client</artifactId>
<version>5.0.0.Final</version>
<version>5.1.9.Final</version>
</dependency>
<dependency>
<groupId>org.jboss.ws.cxf</groupId>
<artifactId>jbossws-cxf-factories</artifactId>
<version>5.0.0.Final</version>
<version>5.1.9.Final</version>
</dependency>
<dependency>
<groupId>org.jboss.spec.javax.xml.ws</groupId>
<artifactId>jboss-jaxws-api_2.2_spec</artifactId>
<version>2.0.1.Final</version>
<version>2.0.4.Final</version>
</dependency>
</dependencies>
</project>
Expand Up @@ -88,13 +88,13 @@
<dependency>
<groupId>org.jboss.ws.cxf</groupId>
<artifactId>jbossws-cxf-client</artifactId>
<version>5.0.0.Final</version>
<version>5.1.9.Final</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.spec.javax.xml.ws</groupId>
<artifactId>jboss-jaxws-api_2.2_spec</artifactId>
<version>2.0.1.Final</version>
<version>2.0.4.Final</version>
<scope>provided</scope>
</dependency>
</dependencies>
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/test-embedded/testWsConsume/pom-cxf.xml
Expand Up @@ -95,7 +95,7 @@
<dependency>
<groupId>org.jboss.ws.cxf</groupId>
<artifactId>jbossws-cxf-client</artifactId>
<version>5.0.0.Final</version>
<version>5.1.9.Final</version>
</dependency>
</dependencies>
</project>
2 changes: 1 addition & 1 deletion src/test/resources/test-embedded/testWsProvide/pom-cxf.xml
Expand Up @@ -94,7 +94,7 @@
<dependency>
<groupId>org.jboss.ws.cxf</groupId>
<artifactId>jbossws-cxf-client</artifactId>
<version>5.0.0.Final</version>
<version>5.1.9.Final</version>
</dependency>
</dependencies>
</project>

0 comments on commit e6cfd9d

Please sign in to comment.