Maven 2.x GWT Plugin

Compiler SHOULD skip modules without entry points when modules are autodetected.

Details

  • Type: Wish Wish
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.1
  • Fix Version/s: 1.2
  • Component/s: None
  • Labels:
    None
  • Number of attachments :
    0

Description

The plugin shouldn't think that all modules must have entry points.
This error is invalid:

[ERROR] Module has no entry points defined

Activity

Hide
nicolas de loof added a comment -

This message is not generated by the plugin but by the compiler.

You certainly try to compile your project but did not specify the set of modules in plugin configuration.

Show
nicolas de loof added a comment - This message is not generated by the plugin but by the compiler. You certainly try to compile your project but did not specify the set of modules in plugin configuration.
Hide
Leszek Gruchala added a comment -

Yeah, you are right, but I think it would be good if there is no defined modules, the compiler should compile only .gwt.xml with entry points.

Thanks!

Show
Leszek Gruchala added a comment - Yeah, you are right, but I think it would be good if there is no defined modules, the compiler should compile only .gwt.xml with entry points. Thanks!
Hide
nicolas de loof added a comment -

Committed revision 10620.

Show
nicolas de loof added a comment - Committed revision 10620.
Hide
Richard Allen added a comment - - edited

This fix prevents a target module from being compiled when the target module extends another with an entry point. We use this scenario to only compile for a single target browser during development. For example, we have a gwt.xml that looks like this:

MyModule.gwt.xml

<module>
  <entry-point class="com.mycompany.MyModule"/>
</module>

Then another gwt.xml that extends the one above that looks like this:

MyModuleFirefox.gwt.xml

<module>
  <inherits name="com.mycompany.MyModule"/>

  <set-property name="user.agent" value="gecko1_8" />
</module>

Previous to gwt-maven-plugin 1.2-SNAPSHOT we were able to point to MyModuleFirefox.gwt.xml and get a successful compile. With 1.2-SNAPSHOT, it skips the compilation because it doesn't find an entry-point in MyModuleFirefox.gwt.xml.

I confirmed this by commenting out the following if block in CompileMojo.compilationRequired().

if ( gwtModule.getEntryPoints().length == 0 )
{
    // No entry-point, this is a secondary module : compiling this one will fail
    // with '[ERROR] Module has no entry points defined'
    return false;
}

The gwt-maven-plugin configuration for this build looks like the following, where the property gwt.module is set to MyModuleFirefox.gwt.xml:

<plugin>
  <groupId>org.codehaus.mojo</groupId>
  <artifactId>gwt-maven-plugin</artifactId>
  <version>${gwt.plugin.version}</version>
  <configuration>
    <modules>
      <module>${gwt.module}</module>
    </modules>
    <webappDirectory>${war.build.dir}</webappDirectory>
    <runTarget>${gwt.run.target}</runTarget>
    <style>PRETTY</style>
    <noServer>${gwt.noserver}</noServer>
    <jvm>${env.JVM_32BIT}</jvm>
    <extraJvmArgs>${gwt.extra.jvm.args}</extraJvmArgs>
    <debugPort>${gwt.debug.port}</debugPort>
    <debugSuspend>${gwt.debug.suspend}</debugSuspend>
    <whitelist>${gwt.run.target}</whitelist>
  </configuration>
</plugin>
Show
Richard Allen added a comment - - edited This fix prevents a target module from being compiled when the target module extends another with an entry point. We use this scenario to only compile for a single target browser during development. For example, we have a gwt.xml that looks like this: MyModule.gwt.xml
<module>
  <entry-point class="com.mycompany.MyModule"/>
</module>
Then another gwt.xml that extends the one above that looks like this: MyModuleFirefox.gwt.xml
<module>
  <inherits name="com.mycompany.MyModule"/>

  <set-property name="user.agent" value="gecko1_8" />
</module>
Previous to gwt-maven-plugin 1.2-SNAPSHOT we were able to point to MyModuleFirefox.gwt.xml and get a successful compile. With 1.2-SNAPSHOT, it skips the compilation because it doesn't find an entry-point in MyModuleFirefox.gwt.xml. I confirmed this by commenting out the following if block in CompileMojo.compilationRequired().
if ( gwtModule.getEntryPoints().length == 0 )
{
    // No entry-point, this is a secondary module : compiling this one will fail
    // with '[ERROR] Module has no entry points defined'
    return false;
}
The gwt-maven-plugin configuration for this build looks like the following, where the property gwt.module is set to MyModuleFirefox.gwt.xml:
<plugin>
  <groupId>org.codehaus.mojo</groupId>
  <artifactId>gwt-maven-plugin</artifactId>
  <version>${gwt.plugin.version}</version>
  <configuration>
    <modules>
      <module>${gwt.module}</module>
    </modules>
    <webappDirectory>${war.build.dir}</webappDirectory>
    <runTarget>${gwt.run.target}</runTarget>
    <style>PRETTY</style>
    <noServer>${gwt.noserver}</noServer>
    <jvm>${env.JVM_32BIT}</jvm>
    <extraJvmArgs>${gwt.extra.jvm.args}</extraJvmArgs>
    <debugPort>${gwt.debug.port}</debugPort>
    <debugSuspend>${gwt.debug.suspend}</debugSuspend>
    <whitelist>${gwt.run.target}</whitelist>
  </configuration>
</plugin>

People

Vote (1)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: