You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by rf...@apache.org on 2008/02/06 02:12:10 UTC

svn commit: r618848 - /incubator/tuscany/java/sca/tools/maven/maven-web-junit/src/main/java/org/apache/tuscany/tools/sca/web/junit/plugin/WebJUnitGeneratorMojo.java

Author: rfeng
Date: Tue Feb  5 17:12:08 2008
New Revision: 618848

URL: http://svn.apache.org/viewvc?rev=618848&view=rev
Log:
Make sure File.separator is used for the file name

Modified:
    incubator/tuscany/java/sca/tools/maven/maven-web-junit/src/main/java/org/apache/tuscany/tools/sca/web/junit/plugin/WebJUnitGeneratorMojo.java

Modified: incubator/tuscany/java/sca/tools/maven/maven-web-junit/src/main/java/org/apache/tuscany/tools/sca/web/junit/plugin/WebJUnitGeneratorMojo.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tools/maven/maven-web-junit/src/main/java/org/apache/tuscany/tools/sca/web/junit/plugin/WebJUnitGeneratorMojo.java?rev=618848&r1=618847&r2=618848&view=diff
==============================================================================
--- incubator/tuscany/java/sca/tools/maven/maven-web-junit/src/main/java/org/apache/tuscany/tools/sca/web/junit/plugin/WebJUnitGeneratorMojo.java (original)
+++ incubator/tuscany/java/sca/tools/maven/maven-web-junit/src/main/java/org/apache/tuscany/tools/sca/web/junit/plugin/WebJUnitGeneratorMojo.java Tue Feb  5 17:12:08 2008
@@ -98,12 +98,18 @@
     private MavenProject project;
 
     public void execute() throws MojoExecutionException {
-        File webxml =
-            new File(project.getBasedir(), "target/" + project.getArtifactId() + "-" + project.getVersion() + "/WEB-INF/web.xml".replace('/', File.separatorChar));
+        File base =
+            new File(project.getBasedir(), "target" + File.separator
+                + project.getArtifactId()
+                + "-"
+                + project.getVersion()
+                + File.separator
+                + "WEB-INF");
+        base.mkdirs();
+        File webxml = new File(base, "web.xml");
         getLog().info("Generating " + webxml.toString());
         String content = setParameter(WEB_XML, "display.name", project.getName());
         try {
-            webxml.getParentFile().mkdirs();
             FileWriter writer = new FileWriter(webxml);
             writer.append(content);
             writer.close();
@@ -112,9 +118,7 @@
         }
 
         if (geronimo) {
-            File geronimoxml =
-                new File(project.getBasedir(), "target/" + project.getArtifactId() + "-" + project.getVersion() + "/WEB-INF/geronimo-web.xml".replace('/',
-                                                                                                  File.separatorChar));
+            File geronimoxml = new File(base, "geronimo-web.xml");
             getLog().info("Generating " + geronimoxml.toString());
             content = setParameter(GERONIMO_WEB_XML, "groupId", project.getGroupId());
             content = setParameter(content, "artifactId", project.getArtifactId());



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org