run-script-maven-plugin/src/main/java/org/lcsim
diff -u -r1.8 -r1.9
--- RunScriptMavenPluginMojo.java 16 Mar 2009 18:40:35 -0000 1.8
+++ RunScriptMavenPluginMojo.java 16 Mar 2009 23:28:46 -0000 1.9
@@ -89,8 +89,6 @@
if (!binDirFile.exists())
{
binDirFile.mkdirs();
- binDirFile.setExecutable(true);
- binDirFile.setWritable(true);
}
// Full path to the script.
@@ -108,10 +106,22 @@
throw new RuntimeException(x);
}
- // Set run script permissions.
- scriptFile.setExecutable(true);
- scriptFile.setReadable(true);
- scriptFile.setWritable(false);
+ // Set run script permissions if on Linux or Mac OS X.
+ // (No idea about how to do this on Windows with a simple command.)
+ String os = System.getProperty("os.name");
+ if (os.equals("Linux") || os.equals("Mac OS X"))
+ {
+ try
+ {
+ Runtime.getRuntime().exec("chmod 555 " + scriptFile);
+ }
+ catch (IOException x)
+ {
+ throw new RuntimeException(x);
+ }
+ }
+ // Java 1.6 only!
+ //scriptFile.setExecutable(true);
}
/**
@@ -181,9 +191,9 @@
if (!libDirFile.exists())
{
libDirFile.mkdir();
- libDirFile.setExecutable(true);
- libDirFile.setReadable(true);
- libDirFile.setWritable(true);
+ //libDirFile.setExecutable(true);
+ //libDirFile.setReadable(true);
+ //libDirFile.setWritable(true);
}
for (String depPath : classPathEntries)
{