Maven 2.x GWT Plugin

Problem with javax servlet of gwt-user in my war

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Won't Fix
  • Affects Version/s: 1.1
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    gwt 1.6.4, maven 2, win XP/linux RH5
  • Number of attachments :
    0

Description

I got a problem discussed here : http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/d4dd93967b8231e7?pli=1

When I compile my GWT application, the javax/servlet java files are compiled and gwt put them in the classes package of the output directory. So the javax/servlet classes are in the war of the project and all the applications servers embedded this library already.
So we got a wonderfull linkage error at runtime.

Could you help me about this ?

I use the gwt-maven-plugin to build, and the javax/servlet directory from the gwt-user library is in my war and that create some linkage error on tomcat/jboss etc...

Bst Rgds,

Activity

Hide
nicolas de loof added a comment -

Please don't use Jira for such questions : repport to the user list

Jira is a tracker for confirmed issues that where allready repoorted on user list

Show
nicolas de loof added a comment - Please don't use Jira for such questions : repport to the user list Jira is a tracker for confirmed issues that where allready repoorted on user list
Hide
nicolas de loof added a comment -

From my understanding (feel free to reopen if I'm wrong) this is a GWT jar packaging issue. We can't change the GWT team artifacts, and you allready reported them the issue. Hope it get fixed in future GWT 1.6+ release

You'll need some dedicated setup on maven-compiler-plugin to get this fixed. It's now documented at http://code.google.com/p/gwtx/wiki/GwtWithMaven

Show
nicolas de loof added a comment - From my understanding (feel free to reopen if I'm wrong) this is a GWT jar packaging issue. We can't change the GWT team artifacts, and you allready reported them the issue. Hope it get fixed in future GWT 1.6+ release You'll need some dedicated setup on maven-compiler-plugin to get this fixed. It's now documented at http://code.google.com/p/gwtx/wiki/GwtWithMaven
Hide
Cyril Lakech added a comment -

I add this to my pom:

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
<excludes>
<exclude>javax/servlet/**</exclude>
</excludes>
</configuration>
</plugin>

But that does stop the javax directory to come in my war...

Any idea ?

Show
Cyril Lakech added a comment - I add this to my pom: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.6</source> <target>1.6</target> <excludes> <exclude>javax/servlet/**</exclude> </excludes> </configuration> </plugin> But that does stop the javax directory to come in my war... Any idea ?
Hide
nicolas de loof added a comment -

I'll add an it test for this case in the plugin, and try to find a global fix.

Show
nicolas de loof added a comment - I'll add an it test for this case in the plugin, and try to find a global fix.
Hide
Cyril Lakech added a comment -

I manage to remove the javax directory from the war with the maven-antrun-plugin and the delete ant task :

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>remove-javax</id>
<phase>compile</phase>
<configuration>
<tasks>
<delete dir="${project.build.directory}/classes/javax" />
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>

A better solution would be welcome...

Show
Cyril Lakech added a comment - I manage to remove the javax directory from the war with the maven-antrun-plugin and the delete ant task : <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-antrun-plugin</artifactId> <executions> <execution> <id>remove-javax</id> <phase>compile</phase> <configuration> <tasks> <delete dir="${project.build.directory}/classes/javax" /> </tasks> </configuration> <goals> <goal>run</goal> </goals> </execution> </executions> </plugin> A better solution would be welcome...
Hide
David Peterson added a comment -

The only solution I've found is to create an alternate 'gwt-user' build, sans 'javax.servlet' files, which I deployed to our internal M2 repo as '1.6.4-fixed'. Then I stick this in my pom.xml:

Define your gwt version:

<properties>
	<gwt.version>1.6.4</gwt.version>
	...
</properties>
<dependency>
	<groupId>com.google.gwt</groupId>
	<artifactId>gwt-user</artifactId>
	<!--  The '-fixed' addition is a hack to fix a bug in the central 1.6.4 deployment. Remove once resolved. -->
	<version>${gwt.version}-fixed</version>
	<scope>provided</scope>
</dependency>

Then add the following into your 'gwt-maven-plugin' <configuration> section:

<gwtVersion>${gwt.version}</gwtVersion>

It should now build happily. Fingers crossed...

Show
David Peterson added a comment - The only solution I've found is to create an alternate 'gwt-user' build, sans 'javax.servlet' files, which I deployed to our internal M2 repo as '1.6.4-fixed'. Then I stick this in my pom.xml: Define your gwt version:
<properties>
	<gwt.version>1.6.4</gwt.version>
	...
</properties>
<dependency>
	<groupId>com.google.gwt</groupId>
	<artifactId>gwt-user</artifactId>
	<!--  The '-fixed' addition is a hack to fix a bug in the central 1.6.4 deployment. Remove once resolved. -->
	<version>${gwt.version}-fixed</version>
	<scope>provided</scope>
</dependency>
Then add the following into your 'gwt-maven-plugin' <configuration> section:
<gwtVersion>${gwt.version}</gwtVersion>
It should now build happily. Fingers crossed...
Hide
nicolas de loof added a comment -

We have no idea where this issue comes from,
I also got it with gwt 1.6.1 but never reproduce since...

Thanks to Cyril lobying on gwt-contributor list, gwt 2.0 will remove those sources classes from the jar

Show
nicolas de loof added a comment - We have no idea where this issue comes from, I also got it with gwt 1.6.1 but never reproduce since... Thanks to Cyril lobying on gwt-contributor list, gwt 2.0 will remove those sources classes from the jar

People

Vote (1)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: