Maven jaxb2:xjc/jaxws:wsimport to be added in eclipse?

…衆ロ難τιáo~ 提交于 2019-12-13 14:23:01

问题


I have a library I am creating based on some WSDL/XSD definitions. I am having a problem having the compiled classes added in the eclipse project. I can see that with a 'mvn compile' that the .class files are generated, as well as the .java files. The problem is that even though the .class files are generated, eclipse is still showing an error on the import statement "import com.whatever.SomeService_Service" that was generated by one of the plugins. I tried forcing the source to go into the project/src/main/java directory, but when the project is cleaned, it deletes files that I have created. Has anyone run into this before/found a way to get it to recognize that the class files are there? Thanks.


回答1:


The convention with Maven is to generate code in target/generated-sources/<tool>, for example target/generated-sources/jax-ws.

Once generated, run mvn eclipse:eclipse if you are using the maven eclipse plugin or right-click on your project and select Maven > Update Project Configuration if you are using M2Eclipse.




回答2:


Knowing this is a old thread but only for reference, I resolved the problem with the following connector:

http://code.google.com/p/jaxws-maven-connector/



来源:https://stackoverflow.com/questions/2556442/maven-jaxb2xjc-jaxwswsimport-to-be-added-in-eclipse

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!