Giter Site home page Giter Site logo

Comments (4)

tbroyer avatar tbroyer commented on May 25, 2024

Actually, I think it's already possible:

<plugin>
  <groupId>net.ltgt.gwt.maven</groupId>
  <artifactId>gwt-maven-plugin</artifactId>
  <executions>
    <execution>
      <id>default-compile</id>
      <configuration>
        <moduleName>it.test.E2E_dev</moduleName>
      </configuration>
    </execution>
  </executions>
</plugin>

(in a profile)

See http://maven.apache.org/guides/mini/guide-default-execution-ids.html

With a file src/main/resources/it/test/E2E_dev.gwt.xml (or something similar, e.g. a src/main/modules configured as a <resource> with a <targetPath>it/test</targetPath>) like:

<module rename-to='e2e'>
  <inherits name='it.test.E2E' />

  <set-property name='user.agent' value='safari' />
</module>

(you could also use filtering instead of hard-coding the rename-to and name values)

I'll reopen the issue if that doesn't work.

Of course, you could also just have a module in your tree with a <set-property name='user.agent' value='${gwt.user.agent}' />, inherited in your src/main/module.gwt.xml, and use filtering (with your gwt.user.agent property defaulting to, e.g., ie8,ie9,gecko1_8,safari)

…or simply not use generate-module (set <skipModule>true</skipModule> in the plugin's configuration)
…or even use filtering directly on the moduleTemplate (it defaults to src/main/module.gwt.xml but is configurable)

I don't really want to encourage this as it goes against The Maven Way™ of not varying the produced artifact. It should be possible, because alternatives are impractical at best (ideally, you should have a distinct Maven module specific to your user.agent=safari compilation), but it shouldn't be too easy or built-in.

from gwt-maven-plugin.

OliverO2 avatar OliverO2 commented on May 25, 2024

You are right, your default-compile configuration works as you expected.

What actually puzzles me is this:

  • If I set moduleName to the module's real name like "it.test.E2E", the plugin seems to infer that the GWT configuration must be in a file named "module.gwt.xml" (literally). If "module.gwt.xml" doesn't exist, the plugin doesn't complain, but if a module configuration is present in a file named "it.test.E2E.gwt.xml", it is ignored.
  • In contrast, if moduleName is set to something different like "it.test.E2E_draft", that name is used as is, just appended with ".gwt.xml".

Otherwise I agree that having two different profile-dependent artifacts ending up in the same target directory is not the best solution as it requires "mvn clean" when switching configurations.

from gwt-maven-plugin.

tbroyer avatar tbroyer commented on May 25, 2024

The problem is lack of documentation.

moduleName is used in many goals:

  • generate-module-metadata for gwt-lib packaging,

  • compile for gwt-app packaging,

  • and

    • add-super-sources (when relocateSuperSources is set to true),
    • add-test-super-sources (when relocateTestSuperSources is set to true) and
    • generate-module

    for gwt-lib and gwt-app packagings.

generate-module uses moduleName as its output, overwriting any such file that could be present in the project resources.
All other goals use moduleName as their input, looking for a file with the appropriate name or assuming one is present.

from gwt-maven-plugin.

OliverO2 avatar OliverO2 commented on May 25, 2024

Ah, I see, thanks for clarifying.

from gwt-maven-plugin.

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.