Cannot use gwt:run on a clean project which uses src/main/webapp
----------------------------------------------------------------
Key: MGWT-224
URL: http://jira.codehaus.org/browse/MGWT-224
Project: Maven 2.x GWT Plugin
Issue Type: Improvement
Affects Versions: 1.2
Reporter: Joachim Van der Auwera
Using the standard maven webapp dir src/main/webapp and building in target, the
use of the gwt:run target without a full build does not work.
There seem to be two reasons for this:
- the classes are incorrectly copied to the WEB-INF/classes, the directory
structures are not maintained.
- the files from the webapp directory are not copied to the target directory.
I have been able to fix this by changing the setupExplodedWar() method in
RunMojo java to
{code}
private void setupExplodedWar()
throws MojoExecutionException
{
getLog().info( "create exploded Jetty webapp in " + hostedWebapp );
if ( !hostedWebapp.getAbsolutePath().equals(
getOutputDirectory().getAbsolutePath() ) )
{
getLog().warn( "Need to copy webapp to exploded dir." );
try
{
FileUtils.copyDirectoryStructure( getOutputDirectory(),
hostedWebapp );
}
catch ( IOException e )
{
throw new MojoExecutionException( "Failed to copy webapp files
to " + hostedWebapp , e );
}
}
File classes = new File( hostedWebapp, "WEB-INF/classes" );
classes.mkdirs();
if ( !buildOutputDirectory.getAbsolutePath().equals(
classes.getAbsolutePath() ) )
{
getLog().warn( "Your POM <build><outputdirectory> does not match
your "
+ "hosted webapp WEB-INF/classes folder for GWT
Hosted browser to see your classes." );
try
{
FileUtils.copyDirectoryStructure( buildOutputDirectory, classes
);
}
catch ( IOException e )
{
throw new MojoExecutionException( "Failed to copy classes to "
+ classes , e );
}
}
{code}
Of particular note is the use of copyDirectoryStructure() instead of
copyDirectory().
TO make this work you need to use <inplace>true</inplace> even if that is
counter intuitive.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email