On Monday, March 17, 2014 4:50:47 PM UTC+1, Stephen Haberman wrote:
Hi Thomas,
(or rather, it'll work too well, and won't detect that something is
missing in WEB-INF/lib.
I'm attempting to follow along, but classloader semantics are fun, so
apologies if I'm wrong somewhere...
So, to clarify, if I have a dependency, say foo.jar, that isn't GWT, and
isn't Jetty, but my server-side code uses it, with your proposal, would
it now have to be in (say) src/main/webapp/WEB-INF/lib?
Neither one (depending on your build tool though).
Maven (or Gradle) are built on the same rule that src/ is for sources, and
is readonly as far as the build tool is concerned.
Your dependencies coming from Maven will ultimately go to
target/${project.build.finalName}/WEB-INF/lib, and this
(target/$project.build.finalName} is what you should use as your -war
directory.
See
http://web.archive.org/web/20130619170526/https://developers.google.com/eclipse/docs/faq#gwt_with_maven
(don't ask me why it has been removed from the GPE FAQ, I have no idea)
http://stackoverflow.com/q/5719118/116472 is an example of what will happen
if you don't follow that rule.
So your foo.jar will be in target/${project.build.finalName}/WEb-INF/lib,
put there by your build tool.
AFAIK, the gwt-gradle-plugin does the right thing too (but doesn't
integrate with the GPE; or rather, the GPE doesn't integrate with anything
else than Maven).
That's for managed dependencies. For manual dependencies, then yes, I'd
argue you should put them in your WEB-INF/lib.
Or could it still come from the Eclipse classpath like it does today?
Jens proposal is to make it fail in this case.
I don't have a strong opinion though; I'd be fine just using the system
classloader as the parent of the webapp classloader (the end result would
be the same as if you deployed all your code and dependencies to Jetty's
lib/ or lib/ext/ or Tomcat's shared/ ); I wonder though what newbies would
prefer (or rather, what would be best for them, before they can even forge
an opinion, by the principle of least surprise). I wonder whether we should
output warnings when loading things from the classpath rather than
WEB-INF/lib; knowing how things work and knowing what I do, I'd be fine
leaving without warnings, I think newbies would need/prefer warnings.
My two cents is that foo.jar being on the Eclipse classpath is just
fine/what I generally prefer anyway, even if it works too well, as it
means I can skip the make a war or put all jars into WEB-INF/lib
steps while just developing.
That said, you are right that it could lead to false positives, but I
would really hope that developers are not using it works on my machine
in dev mode against my exploded war as their criteria for will work in
production. Perhaps that is too optimistic.
As I said, we're power users, we're used to build tools assembling our
apps, how java webapps are organized with their WEB-INF/classese and
WEB-INF/lib, etc. We can tolerate one behavior or the other, possibly even
having a switch to choose the one we prefer for our environment.
The problem has more to do with newbies, of the kind that download the GPE,
create a sample app, copy/paste some code from StackOverflow, downloading
the needed dependencies manually, and finally publishing their app to
AppEngine; all of that without exiting Eclipse, without any build tool
other than Eclipse and the GPE.
Maybe it's a GPE issue after all (I never tried IntelliJ IDEA for webapps;
I tend to prefer embedded servers these days, rather than wars deployed
into servlet containers).
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors
---
You received this message because you are subscribed to the Google Groups GWT
Contributors group.
To unsubscribe from this group and stop receiving emails from it, send an email
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.