简体   繁体   中英

GWT/Maven Project - Maven dependency order wrong

I use the HtmlUnit (Particular the WebClient class) library in my GWT/Maven App. But for some reason there seems to be a very old version in the GWT Jar, which is used. Under "Java Build Path" in the "Order and Export" Tab, i moved my "Maven Dependencies" to the top. So it should look for the sources here first, right?

Why is then always the old version from the GWT Jar used? How can I prevent that?

It the pom.xml it only is shown once: 在此处输入图片说明

The two classes: 在此处输入图片说明

GWT uses HtmlUnit for GWTTestCase s, and will only be modularized (with declared/managed dependencies) in GWT 3.0 scheduled for Google I/O 2014.

Maven does not support arbitrary classpaths (only compile, test and runtime), so you have no other choice than moving your use of HtmlUnit into another Maven module that wouldn't depend on GWT.

Note that even if GWT were using managed dependencies, it wouldn't solve your problem: GWTTestCase would then break, because the versionyou use (HtmlUnit 2.13) is not backwards compatible with the on bundled in GWT 2.5.1 (HtmlUnit 2.9).
…or as Colin suggested, try GWT 2.6.0-rc1 which uses (bundles) HtmlUnit 2.13.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM