fixed inconsistency between source file location and package name used when ant mojo

git-svn-id: https://svn.apache.org/repos/asf/maven/plugin-tools/trunk@1405262 13f79535-47bb-0310-9956-ffa450edef68
master
Herve Boutemy 2012-11-03 02:32:14 +00:00
parent 92df3b3987
commit 62dca6fbd5
1 changed files with 27 additions and 31 deletions

View File

@ -207,13 +207,12 @@ public class PluginHelpGenerator
*/
private String getImplementation( PluginDescriptor pluginDescriptor )
{
String packageName = helpPackageName;
if ( StringUtils.isEmpty( packageName ) )
if ( StringUtils.isEmpty( helpPackageName ) )
{
packageName = GeneratorUtils.discoverPackageName( pluginDescriptor );
helpPackageName = GeneratorUtils.discoverPackageName( pluginDescriptor );
}
return StringUtils.isEmpty( packageName ) ? HELP_MOJO_CLASS_NAME : packageName + '.' + HELP_MOJO_CLASS_NAME;
return StringUtils.isEmpty( helpPackageName ) ? HELP_MOJO_CLASS_NAME : helpPackageName + '.' + HELP_MOJO_CLASS_NAME;
}
/**
@ -318,8 +317,6 @@ public class PluginHelpGenerator
// rewrite help mojo source
File helpSourceFile = new File( destinationDirectory, HELP_MOJO_CLASS_NAME + ".java" );
if ( helpSourceFile.exists() )
{
File helpSourceFileNew = new File( destinationDirectory, packageAsDirectory + '/' + HELP_MOJO_CLASS_NAME + ".java" );
if ( !helpSourceFileNew.getParentFile().exists() )
{
@ -346,7 +343,6 @@ public class PluginHelpGenerator
}
helpSourceFileNew.setLastModified( helpSourceFile.lastModified() );
helpSourceFile.delete();
}
// rewrite help mojo .class
File rewriteHelpClassFile =