You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Bernard Lupin <be...@yahoo.fr> on 2008/04/01 15:32:42 UTC
Re: antrun plugin - GWT - add the source directory to the classpath
Hi Nicolas,
We're already using the gwt-maven-plugin (perhaps the issue your talking
about is a "classpath too long problem", comming from my colleague ;-)).
But an important improvement for us would be a plugin launching the GWT
compilation only if there are changes in java source code. Is it planed ? Do
I have to make this suggestion somewhere ?
Kind regards,
Bernard
nicolas de loof-3 wrote:
>
> Can I suggest you to test the Mojo-sandbox gwt-maven-plugin ?
>
> I just upgrade it to fix GWTCompiler issue, and it now comes with a DTO
> generator from JPA entities.
>
> Some dependencies are not yet available in central, but the MAVENUPLOAD
> request is created for them.
>
> Nicolas.
>
> 2008/3/31, Bernard Lupin <be...@yahoo.fr>:
>>
>>
>> Hi all,
>> Using the antrun plugin, I'm trying to call an ant task which is
>> launching
>> the GWT compiler. This ant task is based on the Joachim work at
>> http://braindump.dk/tech/gwt-task-for-ant/.
>>
>> Something specific with GWT is that you must include the java source
>> directory in your classpath before calling the compiler. Unfortunatelly,
>> I
>> can add all the needed jars in my classpath (gwt-user.jar,
>> gwt-dev-windows.jar, my ant-compile.jar ) using dependencies, but I don't
>> know how to add my source directory.
>>
>> I tried to build an ant reference classpath with the
>> maven.plugin.classpath
>> reference and the ${project.build.sourceDirectory} variable, but in all
>> cases my java task tells me "Unable to find
>> 'com/company/gwt/MyModule.gwt.xml'.
>>
>> I also tried to put all my java source files inside a jar and add the
>> corresponding dependency, in that case the GWT compilation works ! (but
>> it
>> can't be a workarround, you agree ?).
>>
>> So my question is : Does Maven provide a solution to add a directory to
>> the
>> maven.plugin.classpath ?
>>
>> Below is my pom.xml
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <project>
>> <modelVersion>4.0.0</modelVersion>
>> <groupId>com.company.exemple</groupId>
>> <artifactId>gwt-maven</artifactId>
>> <packaging>war</packaging>
>> <name>GWT Maven example</name>
>> <version>1.0-SNAPSHOT</version>
>> <url>http://maven.apache.org</url>
>>
>> <build>
>> <plugins>
>> <plugin>
>> <groupId>org.apache.maven.plugins</groupId>
>> <artifactId>maven-compiler-plugin</artifactId>
>> <configuration>
>> <source>1.5</source>
>> <target>1.5</target>
>> </configuration>
>> </plugin>
>>
>> <plugin>
>> <groupId>org.apache.maven.plugins</groupId>
>> <artifactId>maven-antrun-plugin</artifactId>
>> <dependencies>
>> <dependency>
>> <groupId>com.google.gwt</groupId>
>> <artifactId>gwt-dev-windows</artifactId>
>> <version>1.4.61</version>
>> <scope>compile</scope>
>> </dependency>
>> <dependency>
>> <groupId>com.company.gwt</groupId>
>> <artifactId>ant-compile</artifactId>
>> <version>1.0-SNAPSHOT</version>
>> <scope>compile</scope>
>> </dependency>
>> </dependencies>
>> <executions>
>> <execution>
>> <phase>process-classes</phase>
>> <goals>
>> <goal>run</goal>
>> </goals>
>> <configuration>
>> <tasks>
>> <property name="maven_source_directory"
>> value="${project.build.sourceDirectory}" />
>> <echo message="source
>> directory: ${maven_source_directory}"
>> />
>> <property name="maven_plugin_classpath"
>> refid="maven.plugin.classpath" />
>> <echo message="maven_plugin_classpath:
>> ${maven_plugin_classpath}" />
>> <path id="my.classpath">
>> <pathelement path="${project.build.sourceDirectory}" />
>> <path refid="maven.plugin.classpath" />
>> </path>
>>
>> <taskdef name="gwtcompile"
>>
>> classname="com.francetelecom.clara.tool.gwt.GWTCompileTask"
>> classpathref="my.classpath" />
>> <gwtcompile destdir="c:/tmp" optimize="true"
>> style="obfuscated">
>> <fileset dir="${maven_source_directory}">
>> <include name="**/*.gwt.xml" />
>> </fileset>
>> </gwtcompile>
>> </tasks>
>> </configuration>
>> </execution>
>> </executions>
>> </plugin>
>> </plugins>
>> </build>
>>
>> <dependencies>
>>
>> <!-- GWT Dependencies -->
>> <dependency>
>> <groupId>com.google.gwt</groupId>
>> <artifactId>gwt-user</artifactId>
>> <version>1.4.61</version>
>> <scope>compile</scope>
>> </dependency>
>>
>> <dependency>
>> <groupId>com.google.gwt</groupId>
>> <artifactId>gwt-servlet</artifactId>
>> <version>1.4.61</version>
>> <scope>runtime</scope>
>> </dependency>
>>
>> <!-- GUI Dependencies -->
>> <dependency>
>> <groupId>javax.servlet</groupId>
>> <artifactId>servlet-api</artifactId>
>> <version>2.4</version>
>> <scope>provided</scope>
>> </dependency>
>>
>> <dependency>
>> <groupId>javax.servlet.jsp</groupId>
>> <artifactId>jsp-api</artifactId>
>> <version>2.1</version>
>> <scope>provided</scope>
>> </dependency>
>>
>> </dependencies>
>>
>> </project>
>>
>
--
View this message in context: http://www.nabble.com/antrun-plugin---GWT---add-the-source-directory-to-the-classpath-tp16396056s177p16418428.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: antrun plugin - GWT - add the source directory to the classpath
[resolved]
Posted by Bernard Lupin <be...@yahoo.fr>.
Please excuse me Nicolas, I was certainly speaking about another maven
plugin, I'll try your link asap.
Returning to my initial problem, I've found a solution to add a directory to
the maven dependencies, which could be useful for other purposes.
The key is to use the <systemPath> available inside the <dependency> tag. So
here is my antrun plugin configuration :
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<dependencies>
<!-- ant task for GWT compilation -->
<dependency>
<groupId>
com.company.gwt.tools
</groupId>
<artifactId>ant-compile</artifactId>
<version>1.0</version>
<scope>compile</scope>
</dependency>
<!-- The java sources must be in the classpath -->
<!-- Group id and artifact id are not important -->
<!-- ${project.build.sourceDirectory} is unknown here -->
<dependency>
<groupId>com.company.project</groupId>
<artifactId>gwt-exemple</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>src/main/java</systemPath>
</dependency>
</dependencies>
<executions>
<execution>
<phase>process-classes</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<taskdef name="gwtcompile"
classname="dk.contix.ant.gwt.GWTCompileTask" />
<echo
message="Launching GWT compilation for ${project.name}" />
<gwtcompile
destdir="src/main/webapp"
optimize="true" verbose="false" style="obfuscated">
<fileset
dir="${project.build.sourceDirectory}">
<include name="**/*.gwt.xml" />
</fileset>
</gwtcompile>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
nicolas de loof-3 wrote:
>
> Such a suggestion should be made to GWT development team !
>
> As the GWT compilation process is complex (read modules XML, find client
> code and referenced objets...), there is no simple way to know some
> modified
> java source file requires a GWT recompilation...
>
> The javac compiler is also executed on every build but is fine enough not
> to
> recompile up-to-date classes.
>
>
> The issue I was talking about is that the initial GWT Mojo did not avoid
> the
> GWTCompiler to System.exit() during the build. Do you speak from
> http://mojo.codehaus.org/gwt-maven-plugin/ ? I didn't notice this
> classpath
> error, could you report an issue with a test project ?
>
> Nicolas.
>
>
> 2008/4/1, Bernard Lupin <be...@yahoo.fr>:
>>
>>
>> Hi Nicolas,
>> We're already using the gwt-maven-plugin (perhaps the issue your talking
>> about is a "classpath too long problem", comming from my colleague ;-)).
>>
>> But an important improvement for us would be a plugin launching the GWT
>> compilation only if there are changes in java source code. Is it planed ?
>> Do
>> I have to make this suggestion somewhere ?
>> Kind regards,
>> Bernard
>>
>>
>>
>>
>> nicolas de loof-3 wrote:
>> >
>> > Can I suggest you to test the Mojo-sandbox gwt-maven-plugin ?
>> >
>> > I just upgrade it to fix GWTCompiler issue, and it now comes with a DTO
>> > generator from JPA entities.
>> >
>> > Some dependencies are not yet available in central, but the MAVENUPLOAD
>> > request is created for them.
>> >
>> > Nicolas.
>> >
>> > 2008/3/31, Bernard Lupin <be...@yahoo.fr>:
>> >>
>> >>
>> >> Hi all,
>> >> Using the antrun plugin, I'm trying to call an ant task which is
>> >> launching
>> >> the GWT compiler. This ant task is based on the Joachim work at
>> >> http://braindump.dk/tech/gwt-task-for-ant/.
>> >>
>> >> Something specific with GWT is that you must include the java source
>> >> directory in your classpath before calling the compiler.
>> Unfortunatelly,
>> >> I
>> >> can add all the needed jars in my classpath (gwt-user.jar,
>> >> gwt-dev-windows.jar, my ant-compile.jar ) using dependencies, but I
>> don't
>> >> know how to add my source directory.
>> >>
>> >> I tried to build an ant reference classpath with the
>> >> maven.plugin.classpath
>> >> reference and the ${project.build.sourceDirectory} variable, but in
>> all
>> >> cases my java task tells me "Unable to find
>> >> 'com/company/gwt/MyModule.gwt.xml'.
>> >>
>> >> I also tried to put all my java source files inside a jar and add the
>> >> corresponding dependency, in that case the GWT compilation works !
>> (but
>> >> it
>> >> can't be a workarround, you agree ?).
>> >>
>> >> So my question is : Does Maven provide a solution to add a directory
>> to
>> >> the
>> >> maven.plugin.classpath ?
>> >>
>> >> Below is my pom.xml
>> >>
>> >> <?xml version="1.0" encoding="UTF-8"?>
>> >> <project>
>> >> <modelVersion>4.0.0</modelVersion>
>> >> <groupId>com.company.exemple</groupId>
>> >> <artifactId>gwt-maven</artifactId>
>> >> <packaging>war</packaging>
>> >> <name>GWT Maven example</name>
>> >> <version>1.0-SNAPSHOT</version>
>> >> <url>http://maven.apache.org</url>
>> >>
>> >> <build>
>> >> <plugins>
>> >> <plugin>
>> >> <groupId>org.apache.maven.plugins</groupId>
>> >> <artifactId>maven-compiler-plugin</artifactId>
>> >> <configuration>
>> >> <source>1.5</source>
>> >> <target>1.5</target>
>> >> </configuration>
>> >> </plugin>
>> >>
>> >> <plugin>
>> >> <groupId>org.apache.maven.plugins</groupId>
>> >> <artifactId>maven-antrun-plugin</artifactId>
>> >> <dependencies>
>> >> <dependency>
>> >> <groupId>com.google.gwt</groupId>
>> >> <artifactId>gwt-dev-windows</artifactId>
>> >> <version>1.4.61</version>
>> >> <scope>compile</scope>
>> >> </dependency>
>> >> <dependency>
>> >> <groupId>com.company.gwt</groupId>
>> >> <artifactId>ant-compile</artifactId>
>> >> <version>1.0-SNAPSHOT</version>
>> >> <scope>compile</scope>
>> >> </dependency>
>> >> </dependencies>
>> >> <executions>
>> >> <execution>
>> >> <phase>process-classes</phase>
>> >> <goals>
>> >> <goal>run</goal>
>> >> </goals>
>> >> <configuration>
>> >> <tasks>
>> >> <property name="maven_source_directory"
>> >> value="${project.build.sourceDirectory}" />
>> >> <echo message="source
>> >> directory: ${maven_source_directory}"
>> >> />
>> >> <property name="maven_plugin_classpath"
>> >> refid="maven.plugin.classpath" />
>> >> <echo message="maven_plugin_classpath:
>> >> ${maven_plugin_classpath}" />
>> >> <path id="my.classpath">
>> >> <pathelement path="${project.build.sourceDirectory}"
>> />
>> >> <path refid="maven.plugin.classpath" />
>> >> </path>
>> >>
>> >> <taskdef name="gwtcompile"
>> >>
>> >> classname="com.francetelecom.clara.tool.gwt.GWTCompileTask"
>> >> classpathref="my.classpath" />
>> >> <gwtcompile destdir="c:/tmp" optimize="true"
>> >> style="obfuscated">
>> >> <fileset dir="${maven_source_directory}">
>> >> <include name="**/*.gwt.xml" />
>> >> </fileset>
>> >> </gwtcompile>
>> >> </tasks>
>> >> </configuration>
>> >> </execution>
>> >> </executions>
>> >> </plugin>
>> >> </plugins>
>> >> </build>
>> >>
>> >> <dependencies>
>> >>
>> >> <!-- GWT Dependencies -->
>> >> <dependency>
>> >> <groupId>com.google.gwt</groupId>
>> >> <artifactId>gwt-user</artifactId>
>> >> <version>1.4.61</version>
>> >> <scope>compile</scope>
>> >> </dependency>
>> >>
>> >> <dependency>
>> >> <groupId>com.google.gwt</groupId>
>> >> <artifactId>gwt-servlet</artifactId>
>> >> <version>1.4.61</version>
>> >> <scope>runtime</scope>
>> >> </dependency>
>> >>
>> >> <!-- GUI Dependencies -->
>> >> <dependency>
>> >> <groupId>javax.servlet</groupId>
>> >> <artifactId>servlet-api</artifactId>
>> >> <version>2.4</version>
>> >> <scope>provided</scope>
>> >> </dependency>
>> >>
>> >> <dependency>
>> >> <groupId>javax.servlet.jsp</groupId>
>> >> <artifactId>jsp-api</artifactId>
>> >> <version>2.1</version>
>> >> <scope>provided</scope>
>> >> </dependency>
>> >>
>> >> </dependencies>
>> >>
>> >> </project>
>> >>
>> >
>>
>> --
>>
>> View this message in context:
>> http://www.nabble.com/antrun-plugin---GWT---add-the-source-directory-to-the-classpath-tp16396056s177p16418428.html
>>
>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>
>
--
View this message in context: http://www.nabble.com/antrun-plugin---GWT---add-the-source-directory-to-the-classpath-tp16396056s177p16445366.html
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: antrun plugin - GWT - add the source directory to the classpath
Posted by nicolas de loof <ni...@apache.org>.
Such a suggestion should be made to GWT development team !
As the GWT compilation process is complex (read modules XML, find client
code and referenced objets...), there is no simple way to know some modified
java source file requires a GWT recompilation...
The javac compiler is also executed on every build but is fine enough not to
recompile up-to-date classes.
The issue I was talking about is that the initial GWT Mojo did not avoid the
GWTCompiler to System.exit() during the build. Do you speak from
http://mojo.codehaus.org/gwt-maven-plugin/ ? I didn't notice this classpath
error, could you report an issue with a test project ?
Nicolas.
2008/4/1, Bernard Lupin <be...@yahoo.fr>:
>
>
> Hi Nicolas,
> We're already using the gwt-maven-plugin (perhaps the issue your talking
> about is a "classpath too long problem", comming from my colleague ;-)).
>
> But an important improvement for us would be a plugin launching the GWT
> compilation only if there are changes in java source code. Is it planed ?
> Do
> I have to make this suggestion somewhere ?
> Kind regards,
> Bernard
>
>
>
>
> nicolas de loof-3 wrote:
> >
> > Can I suggest you to test the Mojo-sandbox gwt-maven-plugin ?
> >
> > I just upgrade it to fix GWTCompiler issue, and it now comes with a DTO
> > generator from JPA entities.
> >
> > Some dependencies are not yet available in central, but the MAVENUPLOAD
> > request is created for them.
> >
> > Nicolas.
> >
> > 2008/3/31, Bernard Lupin <be...@yahoo.fr>:
> >>
> >>
> >> Hi all,
> >> Using the antrun plugin, I'm trying to call an ant task which is
> >> launching
> >> the GWT compiler. This ant task is based on the Joachim work at
> >> http://braindump.dk/tech/gwt-task-for-ant/.
> >>
> >> Something specific with GWT is that you must include the java source
> >> directory in your classpath before calling the compiler.
> Unfortunatelly,
> >> I
> >> can add all the needed jars in my classpath (gwt-user.jar,
> >> gwt-dev-windows.jar, my ant-compile.jar ) using dependencies, but I
> don't
> >> know how to add my source directory.
> >>
> >> I tried to build an ant reference classpath with the
> >> maven.plugin.classpath
> >> reference and the ${project.build.sourceDirectory} variable, but in all
> >> cases my java task tells me "Unable to find
> >> 'com/company/gwt/MyModule.gwt.xml'.
> >>
> >> I also tried to put all my java source files inside a jar and add the
> >> corresponding dependency, in that case the GWT compilation works ! (but
> >> it
> >> can't be a workarround, you agree ?).
> >>
> >> So my question is : Does Maven provide a solution to add a directory to
> >> the
> >> maven.plugin.classpath ?
> >>
> >> Below is my pom.xml
> >>
> >> <?xml version="1.0" encoding="UTF-8"?>
> >> <project>
> >> <modelVersion>4.0.0</modelVersion>
> >> <groupId>com.company.exemple</groupId>
> >> <artifactId>gwt-maven</artifactId>
> >> <packaging>war</packaging>
> >> <name>GWT Maven example</name>
> >> <version>1.0-SNAPSHOT</version>
> >> <url>http://maven.apache.org</url>
> >>
> >> <build>
> >> <plugins>
> >> <plugin>
> >> <groupId>org.apache.maven.plugins</groupId>
> >> <artifactId>maven-compiler-plugin</artifactId>
> >> <configuration>
> >> <source>1.5</source>
> >> <target>1.5</target>
> >> </configuration>
> >> </plugin>
> >>
> >> <plugin>
> >> <groupId>org.apache.maven.plugins</groupId>
> >> <artifactId>maven-antrun-plugin</artifactId>
> >> <dependencies>
> >> <dependency>
> >> <groupId>com.google.gwt</groupId>
> >> <artifactId>gwt-dev-windows</artifactId>
> >> <version>1.4.61</version>
> >> <scope>compile</scope>
> >> </dependency>
> >> <dependency>
> >> <groupId>com.company.gwt</groupId>
> >> <artifactId>ant-compile</artifactId>
> >> <version>1.0-SNAPSHOT</version>
> >> <scope>compile</scope>
> >> </dependency>
> >> </dependencies>
> >> <executions>
> >> <execution>
> >> <phase>process-classes</phase>
> >> <goals>
> >> <goal>run</goal>
> >> </goals>
> >> <configuration>
> >> <tasks>
> >> <property name="maven_source_directory"
> >> value="${project.build.sourceDirectory}" />
> >> <echo message="source
> >> directory: ${maven_source_directory}"
> >> />
> >> <property name="maven_plugin_classpath"
> >> refid="maven.plugin.classpath" />
> >> <echo message="maven_plugin_classpath:
> >> ${maven_plugin_classpath}" />
> >> <path id="my.classpath">
> >> <pathelement path="${project.build.sourceDirectory}"
> />
> >> <path refid="maven.plugin.classpath" />
> >> </path>
> >>
> >> <taskdef name="gwtcompile"
> >>
> >> classname="com.francetelecom.clara.tool.gwt.GWTCompileTask"
> >> classpathref="my.classpath" />
> >> <gwtcompile destdir="c:/tmp" optimize="true"
> >> style="obfuscated">
> >> <fileset dir="${maven_source_directory}">
> >> <include name="**/*.gwt.xml" />
> >> </fileset>
> >> </gwtcompile>
> >> </tasks>
> >> </configuration>
> >> </execution>
> >> </executions>
> >> </plugin>
> >> </plugins>
> >> </build>
> >>
> >> <dependencies>
> >>
> >> <!-- GWT Dependencies -->
> >> <dependency>
> >> <groupId>com.google.gwt</groupId>
> >> <artifactId>gwt-user</artifactId>
> >> <version>1.4.61</version>
> >> <scope>compile</scope>
> >> </dependency>
> >>
> >> <dependency>
> >> <groupId>com.google.gwt</groupId>
> >> <artifactId>gwt-servlet</artifactId>
> >> <version>1.4.61</version>
> >> <scope>runtime</scope>
> >> </dependency>
> >>
> >> <!-- GUI Dependencies -->
> >> <dependency>
> >> <groupId>javax.servlet</groupId>
> >> <artifactId>servlet-api</artifactId>
> >> <version>2.4</version>
> >> <scope>provided</scope>
> >> </dependency>
> >>
> >> <dependency>
> >> <groupId>javax.servlet.jsp</groupId>
> >> <artifactId>jsp-api</artifactId>
> >> <version>2.1</version>
> >> <scope>provided</scope>
> >> </dependency>
> >>
> >> </dependencies>
> >>
> >> </project>
> >>
> >
>
> --
>
> View this message in context:
> http://www.nabble.com/antrun-plugin---GWT---add-the-source-directory-to-the-classpath-tp16396056s177p16418428.html
>
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>