Fix templates processing for windows.

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@163296 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Emmanuel Venisse 2005-01-06 16:41:58 +00:00
parent 668ecf8165
commit 2ab584b37d
1 changed files with 7 additions and 2 deletions

View File

@ -39,6 +39,7 @@ import org.apache.velocity.VelocityContext;
import org.apache.velocity.context.Context;
import org.codehaus.plexus.util.FileUtils;
import org.codehaus.plexus.util.StringUtils;
import org.codehaus.plexus.velocity.VelocityComponent;
/**
@ -202,13 +203,17 @@ public class DefaultArchetype
{
File f;
template = StringUtils.replace( template, "\\", "/" );
if ( packageInFileName && packageName != null )
{
String templateFileName = StringUtils.replace( template, "/", File.separator );
String path = packageName.replace( '.', '/' );
String filename = FileUtils.filename( template );
String filename = FileUtils.filename( templateFileName );
String dirname = FileUtils.dirname( template );
String dirname = FileUtils.dirname( templateFileName );
f = new File( new File( new File( outputDirectory, dirname ), path ), filename );
}