用于 JAX-WS org.codehaus.mojo 的 Eclipse m2e 连接器
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17336344/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Eclipse m2e connector for JAX-WS org.codehaus.mojo
提问by roger_that
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
我正在尝试使用wsimport
在 Maven 构建中声明的目标来使用 Web 服务。但我面临着m2e connectors
. 我的 POM 中有一个错误,上面写着
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.
我一直在尝试安装 m2e 连接器,但即使在市场上也没有得到它们。还有其他 m2e 连接器,但不适用于我需要的 JAX-WS。
I have followed and tried almost each solution mentioned herebut 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 allowingmy 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.
虽然生成资源没有问题。资源是在构建时成功生成的,但是这个 POM 错误不允许我的项目与我的 tomcat 同步,并且每次我都必须手动部署War以测试我所做的微小更改。
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
所有这一切真的很烦人,我需要想办法解决这个问题。我在这使用 eclipse juno。下面是我正在使用的 POM 文件
<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>
回答by Michael Koch
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
.
有一个 M2E jaxws-maven-connector GitHub 项目:https: //github.com/trajano/jaxws-maven-connector。它适用于 Eclipse Kepler 和org.codehaus.mojo:jaxws-maven-plugin:1.12
.
- Choose Install new Softwarefrom the Helpmenu.
- Add the repository
https://raw.github.com/trajano/jaxws-maven-connector/master/jaxws-connector-update-site/
(see project) - Install m2e connector for jaxwsand restart.
- Import the Maven project or update the Eclipse Maven project configuration.
- 从帮助菜单中选择安装新软件。
- 添加存储库
https://raw.github.com/trajano/jaxws-maven-connector/master/jaxws-connector-update-site/
(请参阅项目) - 为 jaxws安装m2e 连接器并重新启动。
- 导入 Maven 项目或更新 Eclipse Maven 项目配置。
回答by Bae
Vote for https://github.com/javaee/metro-jaxws-commons/issues/124and get this fixed in the plugin. Then you don't need a connector.
投票给https://github.com/javaee/metro-jaxws-commons/issues/124并在插件中修复此问题。那么你就不需要连接器了。
In the meantime you can hack this as per Archimedes Trajano's post
同时,您可以按照 Archimedes Trajano 的帖子进行破解
回答by Archimedes Trajano
Though I did keep the jaxws-maven-connectorupdated 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/)
尽管我确实更新了jaxws-maven-connector以使用最新的 M2E 和 jaxws-maven-plugin,但我找到了一个更好的方法(我也发布在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.
您将以下配置文件添加到 pom.xml 文件以消除对不可发现的 M2E 插件的需要。
<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:
至于 jaxws-maven-plugin 配置,尽量保持默认即可:
<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>