Author: brett
Date: Mon Jan 30 14:42:32 2012
New Revision: 1237687

URL: http://svn.apache.org/viewvc?rev=1237687&view=rev
Log:
[NPANDAY-480] properties must not include the comment header written by 
java.util.Properties#store()

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=1237687&r1=1237686&r2=1237687&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
 Mon Jan 30 14:42:32 2012
@@ -29,6 +29,7 @@ import org.codehaus.plexus.util.IOUtil;
 
 import java.io.File;
 import java.io.FileWriter;
+import java.io.PrintWriter;
 import java.util.List;
 import java.util.Properties;
 import java.util.Set;
@@ -222,11 +223,16 @@ public class CreateCloudServicePackageMo
             }
 
             File rolePropertiesFile = new 
File(project.getBuild().getDirectory(), artifact.getArtifactId() + 
".roleproperties");
-            FileWriter writer = null;
+            PrintWriter writer = null;
             try
             {
-                writer = new FileWriter( rolePropertiesFile );
-                properties.store( writer, "role properties" );
+                writer = new PrintWriter( new FileWriter( rolePropertiesFile ) 
);
+                // can't use properties.store(), it writes a comment that 
CSPACK doesn't understand
+                for ( String property : properties.stringPropertyNames() )
+                {
+                    writer.println( property + "=" + properties.getProperty( 
property ) );
+                }
+
                 commands.add(
                     "/rolePropertiesFile:" + artifact.getArtifactId() + ";" + 
rolePropertiesFile.getAbsolutePath()
                 );


Reply via email to