Git Product home page Git Product logo

Comments (4)

tbroyer avatar tbroyer commented on May 30, 2024

This is really strange: using mvn package instead of mvn package -Ddraft prior to the cd client && mvn gwt:run -Ddev works, as well as using the _dev module (i.e. changing the gwt-maven-plugin configuration or using mvn gwt:run -Ddev -Ddraft).

In other words: either the *.nocache.js already exists with a user.agent property (mvn package vs. mvn package -Ddraft, or your change to the _dev module used with -Ddraft), or the module used in DevMode does not need the user.agent property (mvn gwt:run -Ddev -Ddraft).
In other cases (the *.nocache.js exists but doesn't contain the user.agent property, or it doesn't exists and the GWT module does not restrict user.agent to a single value), it'll fail with the mentioned exception.

Or did I just totally screw up my test project?

Anyway, the _dev module is supposed compile as fast as possible (for use with the draft profile), so we should not add another permutation.

from gwt-maven-archetypes.

tbroyer avatar tbroyer commented on May 30, 2024

In a clean project, I confirm that mvn gwt:run -Ddev -Ddraft works after a mvn package -Ddraft.

I can also confirm that mvn gwt:run -Ddev works after a mvn package.

In other words, -Ddraft must match between the mvn package and the mvn gwt:run.

Will investigate further what's going on exactly.

from gwt-maven-archetypes.

a14n avatar a14n commented on May 30, 2024

Ok, mvn gwt:run -Ddev -Ddraft works after a mvn package -Ddraft.

I also try some workflows :

  • mvn package and mvn gwt:run -Ddev : OK
  • mvn package and mvn gwt:run -Ddev -Ddraft : OK
  • mvn package -Ddraft and mvn gwt:run -Ddev : not OK
  • mvn package -Ddraft and mvn gwt:run -Ddev -Ddraft : OK

Moreover adding gecko1_8 in App_dev.gwt.xml (<set-property name="user.agent" value="safari,gecko1_8" />) for the above bad case solves the problem.

from gwt-maven-archetypes.

tbroyer avatar tbroyer commented on May 30, 2024

OK.

The issue is that, because the module hasn't changed, DevMode uses the *.nocache.js previously generated by mvn package; when generated with -Ddraft, it won't contain a user.agent property, as it's fixed to a single value; but if the module used in DevMode has several possible values for the property, it'll try to resolve the actual current value by using the property provider that it expects to find in the *.nocache.js.

To fix the issue, you then have to either:

  1. use a module that does not need the user.agent property when launching DevMode (this is why it always works when using mvn gwt:run -Ddev -Ddraft)
  2. make sure the *.nocache.js being used contains a user.agent property provider (this is why it always works when you add a value to the user.agent propertu of the _dev module used in -Ddraft)

There are many ways #.2 above can be achieved:

  • do not use -Ddraft in the initial mvn package
  • run mvn clean compile before mvn gwt:run -Ddev (this will work after c2cec22, otherwise use mvn clean compile -pl client -am on the root module)
  • or actually, simply use mvn package -Dgwt.compiler.skip instead of mvn package -Ddraft.

I'll update the README with that last bit.

I didn't use it initially because I had issues with it in our project, with a similar but not identical layout (we use a jar packaging and then the maven-assembly-plugin to build the WAR, and when we don't gwt:compile, there's absolutely nothing to put in the WAR and it fails; this is not the case here: the maven-war-plugin doesn't fail when it has nothing to put in the WAR, it just creates an “empty except the META-INF/MANIFEST.MF file” WAR)

from gwt-maven-archetypes.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.