开发者

How to make XmlBeans play nicely with eclipse (and the maven-eclipse-plugin)

开发者 https://www.devze.com 2023-01-19 20:18 出处:网络
The XmlBeans Eclipse plugin seems moribund, last released a long time ago. Meanwhile, when you run XmlBeans on an XSD, what comes out is not just Java source code, but also binary classes. I can\'t f

The XmlBeans Eclipse plugin seems moribund, last released a long time ago.

Meanwhile, when you run XmlBeans on an XSD, what comes out is not just Java source code, but also binary classes. I can't figure out how to get Eclipse to include those classes in the classpath when running code that uses the resulting API, and the result is class not found errors.

of course, if I just put a jar containing the results into the classpath, that works, but that's not desirable, since the maven-eclipse-plugin likes to pull the xmlbean-bearing class into the workspace along with everything else.开发者_JAVA百科

Is there a recipe for configuring Eclipse (or XMLBeans) to get around this?


You can include plain .class files in Eclipse classpath like this:

Project properties -> Java Build Path -> Libraries -> [Add Class Folder...]

Unfortunately, AFAIK, maven-eclipse-plugin does not support adding this option and you will lose the change when you re-generate the .classpath file.

If you feel like adding this feature to the plugin, MECLIPSE-164 seems like a good starting point. ;-)

0

精彩评论

暂无评论...
验证码 换一张
取 消