there is a strange behavior with the cxf-codegen-plugin on maven.
Some informations:
One parent pom (called PARENT) with 3 children: SERVICE, CLIENT1, CLIENT2.
The service generate two wsdl described by two classifiers starting from two classes. The SERVICE pom.xml is:
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-java2ws-plugin</artifactId>
<executions>
<execution>
<id>generate-client-first</id>
<phase>process-classes</phase>
<configuration>
<classifier>first</classifier>
<className>com.CLASS1</className>
<genWsdl>true</genWsdl>
<verbose>true</verbose>
<attachWsdl>true</attachWsdl>
</configuration>
<goals>
<goal>java2ws</goal>
</goals>
</execution>
<execution>
<id>generate-client-second</id>
<phase>process-classes</phase>
<configuration>
<classifier>second</classifier>
<className>com.CLASS2</className>
<genWsdl>true</genWsdl>
<verbose>true</verbose>
<attachWsdl>true</attachWsdl>
</configuration>
<goals>
<goal>java2ws</goal>
</goals>
</execution>
</executions>
</plugin>
CLIENT1 and 2 generate two java client starting from the classified wsdl produced in SERVICE. Thus CLIENT1 pom.xml
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<executions>
<execution>
<id>generate-sources-client1</id>
<phase>generate-sources</phase>
<configuration>
<sourceRoot>${project.build.directory}/generated-sources/cxf</sourceRoot>
<wsdlOptions>
<wsdlOption>
<wsdlArtifact>
<groupId>com.something</groupId>
<artifactId>artifact</artifactId>
<version>${project.version}</version>
<classifier>first</classifier>
</wsdlArtifact>
</wsdlOption>
</wsdlOptions>
<defaultOptions>
<faultSerialVersionUID>FQCN</faultSerialVersionUID>
</defaultOptions>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
</plugin>
CLIENT2 pom.xml
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<executions>
<execution>
<id>generate-sources-client2</id>
<phase>generate-sources</phase>
<configuration>
<sourceRoot>${project.build.directory}/generated-sources/cxf</sourceRoot>
<wsdlOptions>
<wsdlOption>
<wsdlArtifact>
<groupId>com.something</groupId>
<artifactId>artifact</artifactId>
<version>${project.version}</version>
<classifier>second</classifier>
</wsdlArtifact>
</wsdlOption>
</wsdlOptions>
<defaultOptions>
<faultSerialVersionUID>FQCN</faultSerialVersionUID>
</defaultOptions>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
</plugin>
Running just the CLIENT2 pom (mvn -U clean install) everything works properly, as far as running the goal mvn -U generate-sources on the PARENT pom.
The problem occurs running: mvn -U clean install on parent pom, because the second client is not generated: in fact it "resolves" always the first wsdl:
[INFO] ------------------------------------------------------------------------
[INFO] Building client2 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.6.1:clean (default-clean) @ client2 ---
[INFO] Deleting /home/developer/workspace/PARENT/CLIENT2/target
[INFO]
[INFO] --- cxf-codegen-plugin:3.0.4:wsdl2java (generate-sources) @ client2 ---
[INFO] com.something:artifact:wsdl:first:1.0-SNAPSHOT resolved to /home/.../Class1.wsdl
[INFO] Resolved WSDL artifact to file /home/.../Class1.wsdl
The problem is different from this, because in that case there were 2 executions in a single build. Last two info: 1) I have this problem on local while on Jenkins everything works properly. 2) Maven version
Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1; 2014-12-14T18:29:23+01:00)
Maven home: /opt/develop/apache-maven/apache-maven-3.2.5
Java version: 1.8.0_31, vendor: Oracle Corporation
Java home: /usr/java/jdk1.8.0_31/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.13.0-46-generic", arch: "amd64", family: "unix"
Can you help me?
Thanks a lot!