Comments (4)
This is on-purpose: you're supposed to use a gwt-app
as an overlay in a war
. See also issue #2.
from gwt-maven-plugin.
Thanks for pointing this out. I've done this and observed the following:
- Overlaying the "naked"
gwt-app
works, given that resources are re-located into the dependantwar
module. - As a side effect, transitive dependencies might have to be explicitly re-defined in the dependant
war
module.
Example:
- Given a
gwt-app
which depends ono.a.e:atmosphere-gwt20-client:jar:1.1.0.RC2:compile
, which in turn depends ono.a:atmosphere-jquery:war:1.1.0.RC3:runtime
, thus overlaying the latter onto thegwt-app
. - As the overlay is ignored by the
gwt-maven-plugin
's packaging, the originally transitive dependency onatmosphere-jquery:war:1.1.0.RC3:runtime
would have to be re-introduced as a direct dependendy in thewar
module depending ongwt-app
.
To me this looks like a deviation from what Maven intends regarding transitive dependency resolution. Is this intentional or did I overlook something here?
from gwt-maven-plugin.
GWT has a mechanism for publishing static files: its public source (<public path="…"/>
in the gwt.xml file, defaulting to a public
subfolder).
Ideally a gwt-app
artifact shouldn't be different from vanilla JS and there's no standard in Maven for JS (some use WARs as overlays, like Atmosphere, but then you also lose transitive JS dependencies; others use JARs as Servlet 3 fragments, like Bootstrap-Maven; and then there are Maven Tools for JavaScript developers, JSZip and WebJars).
But it also has its own issues, as a gwt-app
's jar
(gwt-lib
) dependencies shouldn't be inherited transitively (and I don't want to force everyone to use <scope>provided</scope>
on those); we hit a Maven flaw here in that the POM is used as both input and output: it works well for Java projects, not so well otherwise.
Now maybe I'm just missing something… (should we declare that gwt-lib
are not added to the classpath and use a custom javac mojo instead of relying on the maven-compiler-plugin
?)
AFAICT, atmosphere-gwt20-client
expects that you'll add a <script src="jquery/jquery.atmosphere.js"></script>
or similar to your HTML host page, and that page lives in the downstream WAR module, so atmosphere-jquery:war
should rather be a dependency of that WAR module; or alternatively it should be embedded into atmosphere-gwt20-client
as public source in the GWT module.
Note that the way Atmosphere does it, AFAICT, doesn't work well with non-WAR webapps (standalone servers) as WARs are not put into the classpath (it'd actually depends how you package/run your app; e.g. appassembler-maven-plugin
and maven-shade-plugin
don't seem to care, Eclipse won't include it though, and I suspect exec-maven-plugin
would behave the same). WebJars and JSZip work much better here. Atmosphere's WAR approach also bundles jQuery and could conflict with other jQuery dependencies without Maven being given the ability to handle the condlict (this is as bad as ûberjars); again WebJars and JSZip work much better here (the jquery-atmosphere
WebJar simply declares a dependency on the jquery
WebJar).
Please come provide feedback on issue #2, but given the above, I start to think that a WAR overlay is the least bad of our choices here.
from gwt-maven-plugin.
Hmm, I got the impression that the new gwt-maven-plugin
with its generation of inherits
elements is a step towards a Maven-only configuration. So if we stick to the Maven Way, it should be sufficient to place static files in the usual directories for them to be included in a module. Requiring additional publishing configuration in the GWT module file would be a step backwards to me.
I'm not generally opposing configuration. In fact, I think it's better to have configuration than poorly documented or weakly understood conventions which seem to be at the root of many problems people are experiencing with the Maven ecosystem (me included). However, what I'd like to avoid is having configuration spread all over the place. In this case, I'd prefer to configure the module structure in Maven only. Anyway, as a workaround, I appreciate your hint on the publishing mechanism.
In my recent feedback on issue #2, I've already described a different view on what should comprise a gwt-app
artifact, along with views on packaging alternatives. I'm not sure I fully understand all the implications of using gwt-lib
modules since I haven't played around with them yet, so I don't feel sufficiently qualified to comment on that at this time.
Regarding the Atmosphere jQuery dependency, I take your point that it should be declared in the module where the HTML host page lives. On possible dependency conflicts with bundled jQuery instances, I agree that nothing good happens after midnight. It seems that Atmosphere is moving towards jQuery-free implementations though, so I might get some relief for free ;-).
from gwt-maven-plugin.
Related Issues (20)
- Is 2.9.0 ready? HOT 5
- Compile gwt-app to jar instead of war? HOT 1
- Version 1.0.0 do not support GWT 2.1.0 HOT 5
- Lombok not working with codeserver HOT 2
- Custom Linkers? HOT 2
- Source path from Inherited GWT.xml files are not being considered HOT 13
- GWT compilation failing with error, tried upgrading guice to 4.0 from 3.0 HOT 3
- Integration with GWT Eclipse Plugin seems partially broken HOT 6
- GWT 2.9.0 HOT 2
- GWT Multimodule modulename specificaiton HOT 1
- Redirected gwt artifacts cause a NPE when generating modules HOT 4
- Cannot compile GWT project using com.google.gwt:2.10.0-new-groupid-2 HOT 4
- API incompatibility issue with version 1.0.1 HOT 2
- Change default structure? HOT 2
- java process doesn't start. HOT 1
- Critical CVEs detected in transitive jar dependencies. HOT 1
- Validation warning, plugin should declare these Maven artifacts in `provided` scope HOT 1
- Upgrade to GWT 2.10.0 HOT 3
- goal codeserver fails when web app dependencies are managed in a BOM pom HOT 3
- [Question] How can i activate the debug logging ? because i keep getting the error: Hint: Check the inheritance chain from your module; it may not be inheriting a required module or a module may not be adding its source path entries properly HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gwt-maven-plugin.