Maven jaxb2:xjc/jaxws:wsimport要添加到eclipse中吗? [英] Maven jaxb2:xjc/jaxws:wsimport to be added in eclipse?

查看:73
本文介绍了Maven jaxb2:xjc/jaxws:wsimport要添加到eclipse中吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个基于某些WSDL/XSD定义创建的库.我在eclipse项目中添加了已编译的类时遇到了问题.我可以看到,通过"mvn编译"可以生成.class文件以及.java文件.问题是,即使生成了.class文件,eclipse仍在由其中一个插件生成的import语句"import com.whatever.SomeService_Service"上显示错误.我试图强制将源代码移至project/src/main/java目录,但是在清理项目时,它会删除我创建的文件.是否有人在此之前/找到了一种方法来识别类文件在其中?谢谢.

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.

推荐答案

与Maven的约定是在target/generated-sources/<tool>中生成代码,例如target/generated-sources/jax-ws.

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

生成后,如果您正在使用maven eclipse插件,请运行mvn eclipse:eclipse,或者在项目上右键单击,如果正在使用,请选择 Maven>更新项目配置. M2Eclipse.

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.

这篇关于Maven jaxb2:xjc/jaxws:wsimport要添加到eclipse中吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆