cxf-codegen-plugin not generating code - web-services

I am attempting to use Maven to generate Java from a WSDL. I'm not that familiar with Maven, so it doesn't surprise me that I'm getting something wrong.
Running mvn generate-sources, I get this output
$ mvn generate-sources
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building data-mgmt-ws 1.0
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.188 s
[INFO] Finished at: 2015-10-27T23:19:20-05:00
[INFO] Final Memory: 5M/92M
[INFO] ------------------------------------------------------------------------
No errors, but no classes either.
This is the relevant part of my POM:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/OM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>mil.army.sddc.ibs.ccr</groupId>
<artifactId>data-mgmt-ws</artifactId>
<version>1.0</version>
<packaging>war</packaging>
<properties>
<cxf.version>3.0.2</cxf.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>${cxf.version}</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<sourceRoot>generated/cxf</sourceRoot>
<wsdlOptions>
<wsdlOption>
<wsdl>src/main/resources/dataMgmt.wsdl</wsdl>
<serviceName>DataMgmtService</serviceName>
</wsdlOption>
</wsdlOptions>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
</plugins>
</build>
</project>
This is my WSDL:
<?xml version="1.0"?>
<wsdl:definitions name="DataMgmtService"
targetNamespace="http://ccr.ibs.sddc.army.mil/DataMgmt.wsdl"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://ccr.ibs.sddc.army.mil/DataMgmt.wsdl"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<message name="SayHelloRequest">
<part name="firstName" type="xsd:string"/>
</message>
<message name="SayHelloResponse">
<part name="greeting" type="xsd:string"/>
</message>
<portType name="DataMgmt_PortType">
<operation name="sayHelloWorld">
<input message="tns:SayHelloRequest"/>
<output message="tns:SayHelloResponse"/>
</operation>
</portType>
<binding name="DataMgmt_Binding" type="tns:DataMgmt_PortType">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="sayHelloWorld">
<soap:operation soapAction="sayHelloWorld"/>
<input>
<soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding"
namespace="mil.army.sddc.ibs.ccr.DataMgmtWebService"
use="encoded"/>
</input>
<output>
<soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding"
namespace="mil.army.sddc.ibs.ccr.DataMgmtWebService"
use="encoded"/>
</output>
</operation>
</binding>
<service name="DataMgmt_Service">
<port binding="tns:DataMgmt_Binding" name="DataMgmt_Port">
<soap:address location="http://ccr.ibs.sddc.army.mil/SayHelloWorld"/>
</port>
</service>
</wsdl:definitions>

In your configuration of cxf-codegen-plugin, you forgot to specify the goal wsdl2java. Thus, the execution of the plugin is not invoked.
Correct configuration:
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>${cxf.version}</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<goals>
<goal>wsdl2java</goal> <!-- goal this execution is bound to -->
</goals>
<configuration>
<sourceRoot>generated/cxf</sourceRoot>
<wsdlOptions>
<wsdlOption>
<wsdl>src/main/resources/dataMgmt.wsdl</wsdl>
<serviceName>DataMgmtService</serviceName>
</wsdlOption>
</wsdlOptions>
</configuration>
</execution>
</executions>
</plugin>

I tried to run mvn clean install and the code generated successully

Related

How to exclude some classes in jacoco:structure

I want to exclude some class files since those files do not want to get considered when calculating code coverage.
My scenario is I'm getting .exec file and class files from Jenkins for multiple projects and trying to create one aggregated report. So I'm using jacoco:merge to create the merged exec file and I'm generating the report using jacoco:report. I want to exclude some classes here. But I can't use <excludes> inside jacoco:structure.
My code attached here.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>wso2</groupId>
<artifactId>code-coverage-report</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<build>
<directory>${project.basedir}/target</directory>
</build>
<profiles>
<profile>
<id>with-tests</id>
<activation>
<property>
<name>!maven.test.skip</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-jacoco-dependencies</id>
<phase>compile</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}</outputDirectory>
<includeTypes>jar</includeTypes>
<includeArtifactIds>org.jacoco.ant</includeArtifactIds>
<stripVersion>true</stripVersion>
</configuration>
</execution>
</executions>
</plugin>
<!-- Ant plugin - Merge Jacoco Reports -->
<!-- Logging and distribution modules are not checked since not relevant -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target xmlns:jacoco="antlib:org.jacoco.ant">
<taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml">
<classpath path="${project.build.directory}"/>
</taskdef>
<jacoco:merge destfile="merged.exec">
<fileset dir="jacoco/exec/" includes="*.exec"/>
</jacoco:merge>
<jacoco:report>
<executiondata>
<file file="merged.exec"/>
</executiondata>
<structure name="Final Coverage Report">
<classfiles>
<fileset dir="jacoco/class/classes/"/>
</classfiles>
<excludes>
**/org/xxx/carbon/dataservices/ui/stub/admin/*,
**/org/xxx/carbon/rest/api/stub/types/aaa/*,
**/org/xxx/carbon/endpoint/stub/types/aaa/*,
</excludes>
</structure>
<html destdir="jacoco/tmp_report"/>
<xml destfile="jacoco/tmp_report/coverage-report.xml"/>
<csv destfile="jacoco/tmp_report/coverage-report.csv"/>
</jacoco:report>
</target>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.jacoco</groupId>
<artifactId>org.jacoco.ant</artifactId>
<version>${jacoco.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<dependencies>
<dependency>
<groupId>org.jacoco</groupId>
<artifactId>org.jacoco.ant</artifactId>
<version>${jacoco.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<properties>
<jacoco.version>0.7.9</jacoco.version>
</properties>
</project>
But it gives the following exception. when I try to run it.
An Ant BuildException has occured: structure doesn't support the nested "excludes" element.
See documentation:
Task report
Element structure
Note that the classfiles and sourcefiles elements accept any Ant resource collection. Therefore also filtering the class file set is possible and allows to narrow the scope of the report, for example:
<classfiles>
<fileset dir="classes">
<include name="org/jacoco/examples/important/**/*.class"/>
</fileset>
</classfiles>
Hence
<classfiles>
<fileset dir="jacoco/class/classes/">
<exclude name="org/xxx/carbon/dataservices/ui/stub/admin/**/*.class"/>
<exclude name="org/xxx/carbon/rest/api/stub/types/aaa/**/*.class"/>
<exclude name="org/xxx/carbon/endpoint/stub/types/aaa/**/*.class"/>
</fileset>
</classfiles>

CXF codegen-plugin not working

I'm trying to get the cxf-codegen-plugin to generate sources from my wsdl file.
But Nothing happens when i execute mvn generate-source with eclipse luna.
It looks like plugin itself not configured properly.
My pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" 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">
<modelVersion>4.0.0</modelVersion>
<groupId>com.webservice</groupId>
<artifactId>wsdlfirstwebservice</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>wsdlfirstwebservice Maven Webapp</name>
<url>http://maven.apache.org</url>
<properties>
<jdk.version>1.8</jdk.version>
<cxf.version>3.0.4</cxf.version>
<jaxb.version>2.2</jaxb.version>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxrs</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>${jaxb.version}</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-xjc</artifactId>
<version>${jaxb.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>3.0.4</version>
</dependency>
</dependencies>
<build>
<finalName>Wrsdlfirstwebservice</finalName>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${jdk.version}</source>
<target>${jdk.version}</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.1</version>
<configuration>
<webXml>src/main/webapp/WEB-INF/web.xml</webXml>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>${cxf.version}</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<sourceRoot>${project.build.directory}/generated/cxf</sourceRoot>
<wsdlOptions>
<wsdlOption>
<wsdl>src/main/resources/CustomerOrders.wsdl</wsdl>
<bindingFiles>
<bindingFile>src/main/resources/wsdl/binding.xml</bindingFile>
</bindingFiles>
</wsdlOption>
</wsdlOptions>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>${jaxb.version}</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-xjc</artifactId>
<version>${jaxb.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
My wsdl
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="CustomerOrdersService"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://www.wsdlfirstwebservice.com/customerorders"
targetNamespace="http://www.wsdlfirstwebservice.com/customerorders">
<!-- Types -->
<wsdl:types>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:tns="http://www.wsdlfirstwebservice.com/customerorders"
targetNamespace="http://www.wsdlfirstwebservice.com/customerorders">
<xs:complexType name="order">
<xs:sequence>
<xs:element name="id" type="xs:integer"/>
<xs:element name="product" type="tns:product" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="product">
<xs:sequence>
<xs:element name="id" type="xs:integer" minOccurs="0"/>
<xs:element name="description" type="xs:string" minOccurs="0"/>
<xs:element name="quantity" type="xs:integer" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="getOrdersRequest">
<xs:sequence>
<xs:element name="customerId" type="xs:integer" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="getOrdersResponse">
<xs:sequence>
<xs:element name="order" type="tns:order" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:element name="getOrdersRequest" type="tns:getOrdersRequest"/>
<xs:element name="getOrdersResponse" type="tns:getOrdersResponse"/>
</xs:schema>
</wsdl:types>
<!-- Messages :
These are analogous to method parameters and return types in java methods
-->
<wsdl:message name="getOrdersRequest">
<wsdl:part name="parameters" element="tns:getOrdersRequest">
</wsdl:part>
</wsdl:message>
<wsdl:message name="getOrdersResponse">
<wsdl:part name="parameters" element="tns:getOrdersResponse">
</wsdl:part>
</wsdl:message>
<!-- Port types
These are analogous to java methods. Port types use message as input and/or output.
-->
<wsdl:portType name="CustomerOrdersPortType">
<wsdl:operation name="getOrders">
<wsdl:input name="getOrdersRequest" message="tns:getOrdersRequest"></wsdl:input>
<wsdl:output name="getOrdersResponse" message="tns:getOrdersResponse"></wsdl:output>
</wsdl:operation>
</wsdl:portType>
<!-- Bindings
This defines the message formats and protocol details for web service
-->
<wsdl:binding name="CustomerOrdersServiceSoapBinding" type="tns:CustomerOrdersPortType">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="getOrders">
<soap:operation soapAction="" style="document"/>
<wsdl:input name="getOrdersRequest">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="getOrdersResponse">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<!-- Service
Tells customer how to consume the service
-->
<wsdl:service name="CustomerOrdersService">
<wsdl:port name="CustomerOrdersPort" binding="tns:CustomerOrdersServiceSoapBinding">
<soap:address location="http://localhost:8080/wsdlfirstwebservice/services/CustomerOrdersService"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Console Output
Apache Maven 3.2.1 (ea8b2b07643dbb1b84b6d16e1f08391b666bc1e9;
2014-02-14T23:07:52+05:30) Maven home:
D:\JSPractice\wsdlfirstwebservice\EMBEDDED Java version: 1.8.0_60,
vendor: Oracle Corporation Java home: C:\Program Files
(x86)\Java\jdk1.8.0_60\jre Default locale: en_IN, platform encoding:
Cp1252 OS name: "windows 7", version: "6.1", arch: "x86", family:
"dos" [INFO] Error stacktraces are turned on. [DEBUG] Reading global
settings from EMBEDDED\conf\settings.xml [DEBUG] Reading user settings
from C:\Users\D.Sama.m2\settings.xml [DEBUG] Using local repository
at C:\Users\D.Sama.m2\repository [DEBUG] Using manager
EnhancedLocalRepositoryManager with priority 10.0 for
C:\Users\D.Sama.m2\repository [INFO] Scanning for projects... [DEBUG]
Extension realms for project
com.webservice:wsdlfirstwebservice:war:0.0.1-SNAPSHOT: (none) [DEBUG]
Looking up lifecyle mappings for packaging war from
ClassRealm[plexus.core, parent: null] [DEBUG] === REACTOR BUILD PLAN
================================================ [DEBUG] Project: com.webservice:wsdlfirstwebservice:war:0.0.1-SNAPSHOT [DEBUG] Tasks:
[generate-sources] [DEBUG] Style: Regular [DEBUG]
======================================================================= [INFO] [INFO] Using the builder
org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder
with a thread count of 1 [INFO]
[INFO]
------------------------------------------------------------------------ [INFO] Building wsdlfirstwebservice Maven Webapp 0.0.1-SNAPSHOT [INFO]
------------------------------------------------------------------------ [DEBUG] Lifecycle default -> [validate, initialize, generate-sources,
process-sources, generate-resources, process-resources, compile,
process-classes, generate-test-sources, process-test-sources,
generate-test-resources, process-test-resources, test-compile,
process-test-classes, test, prepare-package, package,
pre-integration-test, integration-test, post-integration-test, verify,
install, deploy] [DEBUG] Lifecycle clean -> [pre-clean, clean,
post-clean] [DEBUG] Lifecycle site -> [pre-site, site, post-site,
site-deploy] [DEBUG] === PROJECT BUILD PLAN
================================================ [DEBUG] Project: com.webservice:wsdlfirstwebservice:0.0.1-SNAPSHOT [DEBUG] Dependencies
(collect): [] [DEBUG] Dependencies (resolve): [] [DEBUG] Repositories
(dependencies): [central (http://repo.maven.apache.org/maven2,
releases)] [DEBUG] Repositories (plugins) : [central
(http://repo.maven.apache.org/maven2, releases)] [DEBUG]
======================================================================= [INFO]
------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO]
------------------------------------------------------------------------ [INFO] Total time: 0.101 s [INFO] Finished at:
2016-09-11T14:27:19+05:30 [INFO] Final Memory: 4M/15M [INFO]
You need to put cxf-codegen plugin in your build/plugins part, not only in build/pluginManagement/plugins.

Generate Client Web Service With Maven And Axis

I have a problem when Maven is generating the source code for a client web service with Axis.
I need consume the wsdl from url exposed by other company. For example, this is the wsdl content in url http://127.0.0.1:8080/ESBService/Example?wsdl
<wsdl:definitions xmlns:ns0="http://www.davivienda.com/xml/Example" xmlns:wsp200607="http://www.w3.org/2006/07/ws-policy" xmlns:wsp200409="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:soap11="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://www.davivienda.com/xml/Example">
<wsdl:types xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:schema>
<xsd:import schemaLocation="MySchema.xsd1.xsd" namespace="http://www.davivienda.com/xml/Example"/>
<xsd:import schemaLocation="MySchema.xsd2.xsd" namespace="http://www.davivienda.com/xml/Example"/>
</xsd:schema>
</wsdl:types>
<wsdl:message name="Example_in">
<wsdl:part xmlns:xsns="http://www.davivienda.com/xml/Example" name="Example" element="xsns:Example"/>
</wsdl:message>
<wsdl:message name="Example_out">
<wsdl:part xmlns:xsns="http://www.davivienda.com/xml/Example" name="ExampleResponse" element="xsns:ExampleResponse"/>
</wsdl:message>
<wsdl:portType name="ExamplePortType">
<wsdl:operation name="Example">
<wsdl:input name="Example_Input" message="ns0:Example_in"/>
<wsdl:output name="Example_Output" message="ns0:Example_out"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="ExampleExampleSOAP_HTTP_Binding" type="ns0:ExamplePortType">
<soap11:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<wsdl:operation name="Example">
<soap11:operation soapAction="" style="document"/>
<wsdl:input name="Example_Input">
<soap11:body parts="Example" use="literal"/>
</wsdl:input>
<wsdl:output name="Example_Output">
<soap11:body parts="ExampleResponse" use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="ExampleExample_HTTP_Service">
<wsdl:port name="ExampleExample_HTTP_Port" binding="ns0:ExampleExampleSOAP_HTTP_Binding">
<soap11:address location="http://127.0.0.1:8080/ESBService/Example"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
And this is my pom file:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example.axis</groupId>
<artifactId>client</artifactId>
<version>0.0.1</version>
<packaging>jar</packaging>
<name>client</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<repositories>
<repository>
<id>org.codehaus.mojo</id>
<name>org.codehaus.mojo</name>
<url>http://repository.codehaus.org/</url>
<layout>default</layout>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.apache.axis</groupId>
<artifactId>axis</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>javax.xml</groupId>
<artifactId>jaxrpc-api</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4.1</version>
</dependency>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>1.1</version>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.codehaus.mojo</groupId>
<artifactId>axistools-maven-plugin</artifactId>
<versionRange>[1.4,)</versionRange>
<goals>
<goal>wsdl2java</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>axistools-maven-plugin</artifactId>
<version>1.4</version>
<configuration>
<urls>
<url>http://127.0.0.1:8080/ESBService/Example?wsdl</url>
</urls>
<packageSpace>com.example.axis.client</packageSpace>
<outputDirectory>${project.build.directory}/generated-sources/wsdl2java</outputDirectory>
</configuration>
<dependencies>
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4.1</version>
</dependency>
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>1.1</version>
</dependency>
</dependencies>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
When I execute Run As->-generated sources in eclipse, Axis plugin couldn't read the schema from url and throw the following error:
[ERROR] Failed to execute goal org.codehaus.mojo:axistools-maven-plugin:1.4:wsdl2java (default) on project client: Error generating Java code from WSDL. Error running Axis: WSDLException (at /wsdl:definitions/wsdl:types/xsd:schema): faultCode=OTHER_ERROR: An error occurred trying to resolve schema referenced at 'MySchema.xsd1.xsd', relative to 'file:/E:/IDE/sts-bundle/workspaces/java/hermes-webapplet/client/target/axistools/wsdl2java/urlDownloads/http---127.0.0.1-ESBService-Example-wsdl.wsdl'.: This file was not found: file:/E:/IDE/sts-bundle/workspaces/java/hermes-webapplet/client/target/axistools/wsdl2java/urlDownloads/MySchema.xsd1.xsd -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:axistools-maven-plugin:1.4:wsdl2java (default) on project client: Error generating Java code from WSDL.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
Your problem is with the XSD mapping. Try to download the wsdl and XSD to your workspace and generate the Java classes:
<configuration>
<packageSpace>com.xyz</packageSpace>
<sourceDirectory>${basedir}/src/wsdl/rpc</sourceDirectory>
<outputDirectory>${basedir}/src/wsdl/rpc</outputDirectory>
</configuration

Skip unit test but run integartion test with maven

I've a maven project which use surefire plugin for both unit tests and integration tests.
Is there a maven command that I can use just to skip the unit tests but to run integration tests.
I've tried mvn clean install -DskipUnitTests but that is not working
I would say: no.
But I recommend you the failsafe plugin solution. Some refactoring/renaming, and you can test.
See here my answer, it could help you: How can I fire integration tests separately using failsafe-plugin?
run this command:mvn verify -Dtest=!*Test -DfailIfNoTests=false
Below is my pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.aaa</groupId>
<artifactId>IntegrationTestMaven</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>IntegrationTestMaven</name>
<!-- <properties>
Only unit tests are run by default.
<skip.integration.tests>true</skip.integration.tests>
<skip.unit.tests>false</skip.unit.tests>
</properties>
-->
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>add-test-source</id>
<phase>process-resources</phase>
<goals>
<goal>add-test-source</goal>
</goals>
<configuration>
<sources>
<source>src/integrationtest/java</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.15</version>
<configuration>
<!-- Skips unit tests if the value of skip.unit.tests property is true -->
<!-- Excludes integration tests when unit tests are run. -->
<excludes>
<exclude>**/*IT.java</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.15</version>
<executions>
<execution>
<id>integration-test</id>
<goals>
<goal>integration-test</goal>
</goals>
</execution>
<execution>
<id>verify</id>
<goals>
<goal>verify</goal>
</goals>
<configuration>
<!-- Skips integration tests if the value of skip.integration.tests property is true -->
<!-- <skipTests>${skip.integration.tests}</skipTests> -->
<includes>
<include>**/*IT.java</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<!-- <profiles>
<profile>
<id>all-tests</id>
<properties>
<build.profile.id>all-tests</build.profile.id>
All tests are run.
<skip.integration.tests>false</skip.integration.tests>
<skip.unit.tests>false</skip.unit.tests>
</properties>
</profile>
<profile>
<id>dev</id>
</profile>
<profile>
<id>integration-tests</id>
<properties>
Used to locate the profile specific configuration file.
<build.profile.id>integration-test</build.profile.id>
Only integration tests are run.
<skip.integration.tests>false</skip.integration.tests>
<skip.unit.tests>true</skip.unit.tests>
</properties>
</profile>
</profiles>
-->
</project>

maven jax-ws plugin does not generate client classes from wsdl

I have created a web project using maven 2(it will be deployed on tomcat 7.0.35), which should serve as a client for JAX-WS web service. I am trying to generate client classes from wsdl file(I have 1 wsdl and 1 xsd).
After I run "mvn clean install" command, no classes are generated and I don't see any errors in console
This is my pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" 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">
<modelVersion>4.0.0</modelVersion>
<groupId>com.test.ws</groupId>
<artifactId>my_ws</artifactId>
<packaging>war</packaging>
<version>1.0</version>
<name>cs Maven Webapp</name>
<url>http://maven.apache.org</url>
<build>
<finalName>my_ws</finalName>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.8</version>
<configuration>
<projectNameTemplate>
[artifactId]-[version]
</projectNameTemplate>
<wtpmanifest>true</wtpmanifest>
<wtpapplicationxml>true</wtpapplicationxml>
<wtpversion>2.0</wtpversion>
<manifest>
${basedir}/src/main/resources/META-INF/MANIFEST.MF
</manifest>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>wsimport</goal>
</goals>
<configuration>
<wsdlDirectory>${basedir}/src/main/resources/wsdl</wsdlDirectory>
<wsdlFiles>
<wsdlFile>my_ws.wsdl</wsdlFile>
</wsdlFiles>
<packageName>com.test.ws.client</packageName>
<sourceDestDir>${basedir}/target/generated-sources/</sourceDestDir>
<keep>true</keep>
<bindingFiles>
<bindingFile>${basedir}/src/main/resources/wsdl/binding.xml</bindingFile>
<bindingFile>${basedir}/src/main/resources/wsdl/jaxb-binding.xml</bindingFile>
</bindingFiles>
</configuration>
<phase>generate-sources</phase>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
<dependencies>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.9</version>
</dependency>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc</artifactId>
<version>11.2.0.2.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-rt</artifactId>
<version>2.2.8</version>
</dependency>
</dependencies>
</project>
Here is binding.xml
<bindings
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
wsdlLocation="./my_ws.wsdl"
xmlns="http://java.sun.com/xml/ns/jaxws">
<!-- Disable default wrapper style -->
<enableWrapperStyle>false</enableWrapperStyle>
</bindings>
and jaxb-binding.xml
<jaxb:bindings version="2.1" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<jaxb:globalBindings generateElementProperty="false" />
</jaxb:bindings>
When using <pluginManagement> element in a pom file, you don't declare plugins usage, but plugins availability. <pluginManagement> is used in a parent pom to announce available plugins for child pom usage.
Just remove this element, and the plugins should be called.