英文:
How best to provide JAXB components in an RCP application
问题
我的RCP应用程序调用了SOAP Web服务,并且一直在使用Java 1.8中的内置JAXB/JEE组件。我已经设置了构建过程,强制使用Java 1.8,这一直运行得很好。
最近,构建停止工作,因为构建器(Tycho)现在有一个仅与较新Java版本配合工作的组件。如果我使用较新版本进行编译,我会遇到数百个与JEE相关的错误,例如找不到JaxbElement
或找不到@WebMethod
等。
在某个时候,我们将不得不摆脱Java 1.8,使用不提供那些JEE组件的Java版本,因此强制使用1.8只能是一个短期解决方案。
是否有一个Eclipse插件已经提供了这些缺失的组件?(我已经搜索过,但没有找到任何内容)还是我需要创建自己的帮助器插件,其中包含必要的库?也许有一种可以用于SOAP调用的JAXB替代方案吗?
英文:
My RCP application makes calls to SOAP web services and has been using the built-in JAXB/JEE components in Java 1.8. I have set up the build process to force the use of Java 1.8 and this had been working well.
Recently, the build stopped working because the builder (Tycho) now has a component which only works with later Java versions. If I compile with the later version I get 100's of JEE-related errors such as JaxbElement not found
or @WebMethod not found
.
At some point we will have to move away from Java 1.8 and use a Java version which does not provide those JEE components, so forcing the use of 1.8 can only be a short-term solution.
Is there an eclipse plugin which already provides those missing components? (I have searched but not found anything) Or do I need to create my own helper plugin which contains the necessary libraries? Is there perhaps a JAXB alternative which I could use for the SOAP calls?
答案1
得分: 2
JAXB插件/捆绑包可在Eclipse Orbit上获取:以javax.
开头的插件/捆绑包。
在需要它们的插件/捆绑包中,通过MANIFEST.MF
文件的Import-Package
添加依赖项(使用Require-Bundle
将要求即使在使用Java 8时也可用这些插件/捆绑包)。
另请参见此答案。
英文:
The JAXB plugins/bundles are available on Eclipse Orbit: the plugins/bundles starting with javax.
.
In the plugins/bundles where they are needed, add the dependency in the MANIFEST.MF
file via Import-Package
(using Require-Bundle
would require that these plugins/bundles are available even when using Java 8).
See also this answer.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论