roger_that
roger_that

Reputation: 9791

Eclipse m2e connector for JAX-WS org.codehaus.mojo

I am trying to consume a webservice using wsimport goal declared at maven build. But I am facing the problem with m2e connectors. There is an error in my POM which says

Plugin execution not covered by lifecycle configuration: org.codehaus.mojo:jaxws-maven-
          plugin:1.10:wsimport (execution: default, phase: generate-sources)

I have been trying to install m2e connectors but not getting them even in marketplace. There are other m2e connectors but not for JAX-WS which i need.

I have followed and tried almost each solution mentioned here but all in vain.

Although there is no problem in generating the resources. The resources are generated at build time successfully but this POM error is not allowing my project to get sync with my tomcat and each time I have to deploy the war manually to test even the little changes i make.

All this is really annoying and I need to figure out a solution to this. I am using eclipse juno in this. Below is the POM file I am using

<build>
    <finalName>home</finalName>
    <plugins>       
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>jaxws-maven-plugin</artifactId>
            <version>1.10</version>
            <executions>
                <execution>
                    <phase>post-clean</phase>
                    <goals>
                        <goal>wsimport</goal>
                    </goals>
                </execution>
            </executions>
            <!-- -->
            <configuration>
                <wsdlUrls>
                    <wsdlUrl>http://localhost:8080/email-service/services/EmailService?wsdl</wsdlUrl>
                </wsdlUrls>
                <sourceDestDir>${project.build.directory}/generated</sourceDestDir>
                <verbose>true</verbose>
            </configuration>
        </plugin>
        <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>2.3.2</version>
            <configuration>
                <source>1.6</source>
                <target>1.6</target>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>2.3.1</version>
            <configuration>
                <source>1.6</source>
                <target>1.6</target>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-resources-plugin</artifactId>
            <version>2.6</version>
            <executions>
                <execution>
                    <id>additional-resources</id>
                    <phase>process-resources</phase>
                    <goals>
                        <goal>copy-resources</goal>
                    </goals>
                    <configuration>
                        <outputDirectory>${project.build.directory}/home/WEB-INF/classes</outputDirectory>
                        <resources>
                            <resource>
                                <directory>${project.basedir}/src/main/webapp/resources/props</directory>
                            </resource>
                        </resources>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

Upvotes: 3

Views: 10384

Answers (3)

Bae
Bae

Reputation: 7624

Vote for https://github.com/javaee/metro-jaxws-commons/issues/124 and get this fixed in the plugin. Then you don't need a connector.

In the meantime you can hack this as per Archimedes Trajano's post

Upvotes: 5

Archimedes Trajano
Archimedes Trajano

Reputation: 41480

Though I did keep the jaxws-maven-connector updated to work with the latest M2E and jaxws-maven-plugin, I found a better way (which I also posted on http://www.trajano.net/2013/12/jaxws-maven-plugin-and-m2e/)

You add the following profile to your pom.xml file to remove the need for a non-discoverable M2E plugin.

    <profile>
        <id>m2e</id>
        <activation>
            <property>
                <name>m2e.version</name>
            </property>
        </activation>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>build-helper-maven-plugin</artifactId>
                    <version>1.8</version>
                    <executions>
                        <execution>
                            <id>attach-wsimport-sources</id>
                            <phase>generate-sources</phase>
                            <goals>
                                <goal>add-source</goal>
                            </goals>
                            <configuration>
                                <sources>
                                    <source>${basedir}/target/generated-sources/wsimport</source>
                                </sources>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
            <pluginManagement>
                <plugins>
                    <plugin>
                        <groupId>org.eclipse.m2e</groupId>
                        <artifactId>lifecycle-mapping</artifactId>
                        <version>1.0.0</version>
                        <configuration>
                            <lifecycleMappingMetadata>
                                <pluginExecutions>
                                    <pluginExecution>
                                        <pluginExecutionFilter>
                                            <groupId>
                                                org.jvnet.jax-ws-commons
                                            </groupId>
                                            <artifactId>
                                                jaxws-maven-plugin
                                            </artifactId>
                                            <versionRange>
                                                [2.3.1-b03,)
                                            </versionRange>
                                            <goals>
                                                <goal>wsimport</goal>
                                            </goals>
                                        </pluginExecutionFilter>
                                        <action>
                                            <execute />
                                        </action>
                                    </pluginExecution>
                                </pluginExecutions>
                            </lifecycleMappingMetadata>
                        </configuration>
                    </plugin>
                </plugins>
            </pluginManagement>
        </build>
    </profile>

As for the jaxws-maven-plugin configuration, just keep it to the defaults as much as possible:

<plugin>
            <groupId>org.jvnet.jax-ws-commons</groupId>
            <artifactId>jaxws-maven-plugin</artifactId>
            <version>2.3.1-b03</version>
            <configuration>
                <wsdlUrls>
                    <wsdlUrl>http://www.webservicex.net/ConvertAcceleration.asmx?WSDL</wsdlUrl>
                </wsdlUrls>
            </configuration>
            <executions>
                <execution>
                    <id>wsimport</id>
                    <goals>
                        <goal>wsimport</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

Upvotes: 1

Michael Koch
Michael Koch

Reputation: 1242

There is a M2E jaxws-maven-connector GitHub project: https://github.com/trajano/jaxws-maven-connector . It worked for me with Eclipse Kepler and org.codehaus.mojo:jaxws-maven-plugin:1.12.

  1. Choose Install new Software from the Help menu.
  2. Add the repository https://raw.github.com/trajano/jaxws-maven-connector/master/jaxws-connector-update-site/ (see project)
  3. Install m2e connector for jaxws and restart.
  4. Import the Maven project or update the Eclipse Maven project configuration.

Upvotes: 6

Related Questions