Reputation: 180
Here is my POM File
<build>
<sourceDirectory>target/jaxws/wsimport</sourceDirectory>
<resources>
<resource>
<directory>target/generated/${ebc.name.uppercase}/wsdl</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy templates</id>
<phase>initialize</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>com.corp.ebcbuild</groupId>
<artifactId>ebcbuild-templates-client-wsdl</artifactId>
<version>${ebcbuild.version}</version>
<type>jar</type>
</artifactItem>
<artifactItem>
<groupId>com.ikea.${ebc.name.lowercase}</groupId>
<artifactId>DBI_${ebc.name.lowercase}_Contracts</artifactId>
<type>jar</type>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.ikea.ebcbuild</groupId>
<artifactId>maven-ebcbuild-plugin</artifactId>
<version>${ebcbuild.version}</version>
<executions>
<execution>
<id>codetranslator-generate-client-interface</id>
<phase>generate-sources</phase>
<goals>
<goal>generate-client-interface</goal>
</goals>
<configuration>
<targetDirectory>target/generated/${ebc.name.uppercase}</targetDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jvnet.jax-ws-commons</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<goals>
<goal>wsimport</goal>
</goals>
</execution>
</executions>
<configuration>
<target>2.1</target>
<sourceDestDir>target/jaxws/wsimport</sourceDestDir>
<packageName>com.ikea.${ebc.name.lowercase}.client.ws</packageName>
<wsdlDirectory>target/generated/${ebc.name.uppercase}/wsdl</wsdlDirectory>
</configuration>
</plugin>
</plugins>
</build>
And here is the error trace from Jenkins
[ERROR] Failed to execute goal org.jvnet.jax-ws-commons:jaxws-maven-plugin:2.3:wsimport (default) on project ebcposrix01-interface: Mojo failed - check output -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.jvnet.jax-ws-commons:jaxws-maven-plugin:2.3:wsimport (default) on project ebcposrix01-interface: Mojo failed - check output
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:534)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException: Mojo failed - check output
at org.jvnet.jax_ws_commons.jaxws.AbstractJaxwsMojo.exec(AbstractJaxwsMojo.java:393)
at org.jvnet.jax_ws_commons.jaxws.WsImportMojo.processLocalWsdlFiles(WsImportMojo.java:319)
at org.jvnet.jax_ws_commons.jaxws.WsImportMojo.execute(WsImportMojo.java:283)
at org.jvnet.jax_ws_commons.jaxws.MainWsImportMojo.execute(MainWsImportMojo.java:50)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:107)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
Am not a maven Expert, but what confuses me is why is the same project failing Jenkins where it works fine in Local Environment.
Upvotes: 0
Views: 2693
Reputation: 180
After going through the jaxws-maven-plugin configuration in pom.xml file it follows the documentation: https://jax-ws-commons.java.net/jaxws-maven-plugin/wsimport-mojo.html#wsdlDirectory
Apparently there is a bug in the below dependency
<groupId>org.jvnet.jax-ws-commons</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>2.3</version>
That the mentioned in the pom.xml does not take spaces in the project path. And build server jobs had spaces in them.
Upvotes: 1