|
|
evenisse 2005/01/06 08:41:58
Modified:
maven-archetype/maven-archetype-core/src/main/java/org/apache/maven/archetype
DefaultArchetype.java
Log:
Fix templates processing for windows.
Revision Changes Path
1.4 +8 -3
maven-components/maven-archetype/maven-archetype-core/src/main/java/org/apache/maven/archetype/DefaultArchetype.java
Index: DefaultArchetype.java
===================================================================
RCS file:
/home/cvs/maven-components/maven-archetype/maven-archetype-core/src/main/java/org/apache/maven/archetype/DefaultArchetype.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- DefaultArchetype.java 6 Jan 2005 13:40:44 -0000 1.3
+++ DefaultArchetype.java 6 Jan 2005 16:41:58 -0000 1.4
@@ -39,6 +39,7 @@
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 @@
{
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 );
}
|
|