You are viewing a plain text version of this content. The canonical link for it is here.
Posted to npanday-commits@incubator.apache.org by br...@apache.org on 2013/03/05 06:18:43 UTC

svn commit: r1452676 - /incubator/npanday/trunk/plugins/azure-maven-plugin/src/main/java/npanday/plugin/azure/CreateCloudServicePackageMojo.java

Author: brett
Date: Tue Mar  5 06:18:42 2013
New Revision: 1452676

URL: http://svn.apache.org/r1452676
Log:
[NPANDAY-480] ensure the sitesroot is created

This directory is needed for certain IIS deployments, but it seems CSPack has some odd matching to handle absolute paths

Modified:
    incubator/npanday/trunk/plugins/azure-maven-plugin/src/main/java/npanday/plugin/azure/CreateCloudServicePackageMojo.java

Modified: incubator/npanday/trunk/plugins/azure-maven-plugin/src/main/java/npanday/plugin/azure/CreateCloudServicePackageMojo.java
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/azure-maven-plugin/src/main/java/npanday/plugin/azure/CreateCloudServicePackageMojo.java?rev=1452676&r1=1452675&r2=1452676&view=diff
==============================================================================
--- incubator/npanday/trunk/plugins/azure-maven-plugin/src/main/java/npanday/plugin/azure/CreateCloudServicePackageMojo.java (original)
+++ incubator/npanday/trunk/plugins/azure-maven-plugin/src/main/java/npanday/plugin/azure/CreateCloudServicePackageMojo.java Tue Mar  5 06:18:42 2013
@@ -242,7 +242,7 @@ public class CreateCloudServicePackageMo
 
                 // TODO: 'Web/' is hardcoded here; where to get it from?
                 commands.add(
-                    "/sitePhysicalDirectories:" + artifact.getArtifactId() + ";Web;" + roleRoot.getAbsolutePath()
+                    "/sitePhysicalDirectories:" + artifact.getArtifactId() + ";Web;" + canonical( roleRoot )
                 );
             }
             else if ( isWorkerRole )
@@ -300,4 +300,13 @@ public class CreateCloudServicePackageMo
         return commands;
     }
 
+    private String canonical( File f )
+    {
+        String path = f.getAbsolutePath();
+
+        // CSPack is very fussy - lowercase the drive letter and you get
+        // sitesroot, uppercase and it is omitted (!)
+        // See: http://social.msdn.microsoft.com/Forums/bs-Latn-BA/windowsazuredevelopment/thread/014ce124-5ca6-46ce-b1ea-3d677a092f65
+        return path.substring( 0, 1 ).toLowerCase() + path.substring( 1 );
+    }
 }