Comments (8)
Did you use the dev
profile (using either -Ddev
or -Pdev
) ? It adds the shared
modules' sources to the client
modules' resources so they're available to GWT.
There might however be a class of changes that require running javac
again and relaunching DevMode / SDM.
from gwt-maven-archetypes.
Yeah, I was using dev profile.
The problem was related to the resources inclusion.
The only way I could get it to work was adding sources instead of resources in the compie phase.
The build-helper-maven-plugin was configured as following:
<phase>compile</phase>
<goals>
<goal>add-resource</goal>
</goals>
<configuration>
<resources>
<!-- Only sources, resources are already in the classpath, by definition -->
<resource>
<directory>${basedir}/../gwtthiago-shared/src/main/java</directory>
</resource>
</resources>
</configuration>
I had to change to:
<phase>compile</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<!-- Only sources, resources are already in the classpath, by definition -->
<source>${basedir}/../gwtthiago-shared/src/main/java</source>
</sources>
</configuration>
Actually, I don't quite understand why it was configured to include the shared sources as 'resources'. Was it supposed to work?
from gwt-maven-archetypes.
You don't want the shared
classes to be compiled into the client
's target/classes
, this is why it was set as add-resource
. Now we could maybe use add-source
in the process-classes
phase? But what we really want is have the sources in the classpath, so add-resource
should work as advertized.
What kind of "breaking change" did you do in the shared
class? Also, with your add-source
setup, did the shared
classes imported this way end up being compiled by the maven-compiler-plugin
as part of the client
build?
from gwt-maven-archetypes.
Ok! Now I clearly understand!
Actually my problem wasn't in the client POM, but in shared.
It happens that I'm using gwt-maven-plugin generateAsync goal, and the sources generated in another folder wasn't being compiled!
Although in the client I was referencing the shared generated folder...
<resource>
<directory>${basedir}/../gwtthiago-shared/target/generated-sources/gwt</directory>
</resource>
... I wasn't including this folder in the shared compilation. So client's compilation couldn't find any compiled classes there, only sources! I solved by adding the generated sources folder in shared compilation with build helper plugin.
Thanks for helping me out!
from gwt-maven-archetypes.
Note: generateAsync
should add its output directory to the project's sources without the need for the build-helper-maven-plugin. It's possible however that the generated code wouldn't be packaged in the sources
JAR.
from gwt-maven-archetypes.
Actually you were right: gwt-maven-plugin purposefully doesn't add resources to the classpath, so add-source
has to be used. Currently working on the fix.
from gwt-maven-archetypes.
Why 'purposefully'?
from gwt-maven-archetypes.
See https://jira.codehaus.org/browse/MGWT-350 (and https://jira.codehaus.org/browse/MGWT-348)
from gwt-maven-archetypes.
Related Issues (20)
- Generate 1.0-SNAPSHOT archetype not working HOT 3
- External modules in super dev mode compilation HOT 6
- Should be updated to use GWT 2.8.0 release instead of 2.8.0-rc1 HOT 1
- modular-webapp artifact does not work with env-dev maven profile HOT 2
- How to add Spring Boot to this GWT project? HOT 2
- generated sources are not available to the gwt compiler HOT 1
- What to enter for package on the command line? HOT 1
- mygwtnew-server cannot be added to tomcat sever ? HOT 1
- dagger-guice-rf-activities archetypes not working HOT 2
- Why is codehaus maven plugin used in archetype for ltgt maven plugin? HOT 11
- [ERROR] Failed to execute goal net.ltgt.gwt.maven:gwt-maven-plugin:1.0-rc-9:generate-module (default-generate-module) on project project-client: Execution default-generate-module of goal net.ltgt.gwt.maven:gwt-maven-plugin:1.0-rc-9:generate-module failed: A required class was missing while executing net.ltgt.gwt.maven:gwt-maven-plugin:1.0-rc-9:generate-module: Lorg/sonatype/plexus/build/incremental/BuildContext; HOT 2
- Fails on mvn clean install HOT 4
- no clear/seamless way or mechanism to shutdown the running jetty and codeserver HOT 1
- Newly created archetype has build failure HOT 1
- mvn jetty:run: Address already in use HOT 4
- Is there any sample to using ltgt plugin for GWTP? HOT 1
- Is 2.9.0 ready?
- ${module.toLowerCase()} isn't replaced but lands somewhere in the source as is HOT 2
- Archetype for gwt-lib HOT 4
- update version of GWT to 2.11.0 HOT 2
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-archetypes.