We also use the Maven sources JAR approach. The .class and .java do
NOT have to be in the same JAR file. The GWT compiler will just need
the sources JAR on the classpath, which you can accomplish via Maven
dependency management, as you have stated.

The only problem I found using the Maven provided scope is that
provided scope is currently not transitive. So if you have project A
depend on project B, which depends on project C, and project C builds
a sources JAR for GWT, then you can't use provided scope if you want
the GWT compile to happen with project A. To work around this, we
simply use excludes to prevent the sources JARs from being included in
the final WAR.

Also note that if you build test JARs, test dependencies are not
transitive. There is a JIRA issue to fix this: 
http://jira.codehaus.org/browse/MNG-1378.

-Richard


On Feb 5, 4:09 pm, Micah <mkwhita...@gmail.com> wrote:
> I acknowledge that the source needs to be available for the gwt
> compiler but I still question if the source needs to be in the same
> jar as the compiled endstates you'd ship to a client.  Is there
> documentation that states the requirements (location/conditions) for
> providing source code to the gwt compiler?  I guess I'm asking in
> general as opposed to specifically using the gwt-maven-plugin.
>
> I'm still testing this out but it seems like it should work as long as
> a jar with the source code is on the classpath.  The approach I'm
> trying to take is to follow themavenstandard of producing a *-sources.jar 
> during the build of the first module.  Then all consuming
> modules will list the standard jar as a compile scoped dependency and
> thesourcesjar as a provided scoped dependency.
>
> If this is going to take me down a road of pain I'd like to know ahead
> of time.
>
> Thanks for your help,
> Micah
>
> On Feb 5, 6:00 am, getaceres <getace...@gmail.com> wrote:
>
>
>
> > Yes, they have to be in the same jar, so you have to include this
> > lines in your pom.xml:
>
> > <build>
> >         .....................................
> >         <resources>
> >             <resource>
> >                 <directory>src/main/java</directory>
> >             </resource>
> >             <resource>
> >                 <directory>src/main/resources</directory>
> >             </resource>
> >         </resources>
> >         .................................
> >     </build>
>
> > On 4 feb, 23:08,Micah<mkwhita...@gmail.com> wrote:
>
> > > I currently have a GWT app that I'm looking to break into separate
> > > modules.  The build system is currently Maven2 and utilizing the gwt-
> > >maven-plugin[1].  When reading over the documentation on how to do
> > > this, I wonder what exactly are the requirements around the source
> > > code for a module being available for packaging another module.  Does
> > > the source (*.java)  have to be in the same jar or does it just have
> > > to be on the classpath?
>
> > >Maven'sgeneral approach is to make source available in a secondary
> > > artifact using themaven-source-jar[2].  This is nice because it
> > > removes bloat from my endstates but also I don't have to worry about
> > > shipping source code to each of my clients.
>
> > > So do I have to have *.java files in my jar or are there other means
> > > of accomplishing this to make the GWT compiler happy?
>
> > > Thanks for your help,
> > >Micah
>
> > > [1] 
> > > -http://mojo.codehaus.org/gwt-maven-plugin/user-guide/multiproject.html
> > > [2] -http://maven.apache.org/plugins/maven-source-plugin/jar-mojo.html

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to