For GWT 2.5, we might be able to use the elemental json implementation, it has both pure JRE and super-source implementations, and simultaneously replaces org.json and the com.google.gwt.json packages.
-Ray On Wed, May 30, 2012 at 2:19 AM, Thomas Broyer <t.bro...@gmail.com> wrote: > Additional note: requestfactory-client.jar is supposed to be used on Android > (not only, but that's one of the advertized goal), so it shouldn't bundle > org.json, as this is already provided by the Android > platform: http://developer.android.com/reference/org/json/package-summary.html > > As for Maven, we could add a > com.google.web.bindery:requestfactory-dependencies artifact, with > packaging=pom > (see http://www.sonatype.com/people/2009/10/maven-tips-and-tricks-grouping-dependencies/), > that requestfactory-client and requestfactory-server could depend on (or > not) > Alternately, given that gwt-user.jar is only used for dev, it's not really > an issue if it's "bloated" (other than the perf issues with GWT Compiler and > DevMode with a large classpath), we could simply add org.json as a > dependency to gwt-user inaddition to javax.validation (we could also instead > add a dependency on the requestfactory-dependencies suggested above ;-) ) > > I still do not understand why javax.validation is not bundled within > gwt-user. There might be some note in the issue tracker, commit log, or code > reviews, but I haven't searched yet. > > On Tuesday, May 29, 2012 10:51:07 AM UTC+2, Thomas Broyer wrote: >> >> Hi all, >> >> it looks like there's an issue in packaging the GWT SDK (and GWT maven >> artifacts): org.json is not bundled gwt-user. That makes it harder to use >> RequestFactory out-of-the-box, as DevMode will have NoClassDefFoundErrors >> when trying to *send* a request to the server. org.json is bundled into >> requestfactory-server.jar and gwt-servlet-deps.jar, which makes it usable >> out-of-the-box on the server-side; it's also bundle into >> requestfactory-client.jar so you can easily run VM client-side code too (in >> unit-tests, an Android app, etc.) To run RF code in DevMode, you'd have to >> add the org.json JAR (downloaded somewhere on the internet) or the >> requestfactory-client.jar (which duplicates a lot of classes from >> gwt-user.jar), or the gwt-servlet-deps.jar (which is supposedly related to >> server-side code only) to your classpath; this is not intuitive. >> >> What's striking is that javax.validation is *not* bundled that way >> (except, as expected, in gwt-servlet-deps.jar), it's instead shipped as a >> separate JAR in the SDK; it's not even bundled into gwt-user.jar. >> >> There's a real discrepancy between org.json and javax.validation wrt >> packaging in the SDK, and none of them is satisfactory. >> >> requestfactory-* JARs contain org.json but not javax.validation >> gwt-user contains none of them >> gwt-servlet-deps is made of only org.json and javax.validation, so why >> ship javax.validation in addition to it? >> >> IMO, both dependencies should receive equal treatment: either ship as >> separate JARs in the SDK (json.jar and validation-api.jar), or be bundled >> where needed (if you ask me, only in gwt-user.jar –similar to what's done >> with javax.servlet– and gwt-servlet-deps.jar; possibly renamed to or >> duplicated as requestfactory-deps.jar, as they are dependencies for both >> requestfactory-client and requestfactory-server). >> >> Now, we have similar issues with Maven artifacts: gwt-user.jar depends on >> javax.validation but not org.json, so the DevMode will fail (whether you >> launch it with "Run As… Web Application" in Eclipse or "mvn gwt:run") unless >> you add a dependency on org.json. org.json is not even referenced/documented >> as an optional dependency (but given that javax.validation is not marked as >> "optional", there's no reason org.json would be marked "optional"). >> We're currently facing this issue in gwt-maven-archetypes and I'm not sure >> what we should do: add a dependency on requestfactory-client (contains >> duplicate classes from gwt-user) or on org.json (weird as we don't directly >> use org.json classes, and org.json is not marked as an optional dependency >> of gwt-user). https://github.com/tbroyer/gwt-maven-archetypes/pull/16 >> >> I'll try to submit a patch to have it fixed in 2.5 but we must first >> settle on the appropriate way to do it (both for the GWT SDK and for Maven >> artifacts), and I'd also like your feedback on what would be the appropriate >> workaround while waiting for 2.5. > > -- > http://groups.google.com/group/Google-Web-Toolkit-Contributors -- http://groups.google.com/group/Google-Web-Toolkit-Contributors