Commits

tludewig committed 043d747 Merge

set versions to 1.0-M7

Comments (0)

Files changed (57)

 3f95f8e9a7c5c46172bc46180a7dab42f25e8ed4 1.0 M3
 c1d88ccebd1747e65ed8946f7272ae8cd1403f68 1.0 M4
 f5939f58f778f8eb78dd7eb418429b8a6c11e88b 1.0 M5
+7ee65d543c6b4f33c6c98b6e892eb91ce55d7d07 1.0 M6
   <parent>
     <groupId>sonia.scm</groupId>
     <artifactId>scm</artifactId>
-    <version>1.0-M6-SNAPSHOT</version>
+    <version>1.0-M7-SNAPSHOT</version>
   </parent>
 
   <groupId>sonia.scm.maven</groupId>
   <artifactId>scm-maven-plugins</artifactId>
   <packaging>pom</packaging>
-  <version>1.0-M6-SNAPSHOT</version>
+  <version>1.0-M7-SNAPSHOT</version>
   <name>scm-maven-plugins</name>
 
   <modules>
     <dependency>
       <groupId>sonia.scm</groupId>
       <artifactId>scm-core</artifactId>
-      <version>1.0-M6-SNAPSHOT</version>
+      <version>1.0-M7-SNAPSHOT</version>
     </dependency>
 
   </dependencies>

maven/scm-plugin-archetype/pom.xml

   <parent>
     <artifactId>scm-maven-plugins</artifactId>
     <groupId>sonia.scm.maven</groupId>
-    <version>1.0-M6-SNAPSHOT</version>
+    <version>1.0-M7-SNAPSHOT</version>
   </parent>
 
   <groupId>sonia.scm.maven</groupId>
   <artifactId>scm-plugin-archetype</artifactId>
-  <version>1.0-M6-SNAPSHOT</version>
+  <version>1.0-M7-SNAPSHOT</version>
   <name>scm-plugin-archetype</name>
 
 </project>

maven/scm-plugin-archetype/src/main/resources/archetype-resources/pom.xml

   <parent>
     <artifactId>scm-plugins</artifactId>
     <groupId>sonia.scm.plugins</groupId>
-    <version>1.0-M6-SNAPSHOT</version>
+    <version>1.0-M7-SNAPSHOT</version>
   </parent>
 
   <groupId>${groupId}</groupId>
     <dependency>
       <groupId>sonia.scm</groupId>
       <artifactId>scm-test</artifactId>
-      <version>1.0-M6-SNAPSHOT</version>
+      <version>1.0-M7-SNAPSHOT</version>
       <scope>test</scope>
     </dependency>
 
   <parent>
     <groupId>sonia.scm</groupId>
     <artifactId>scm</artifactId>
-    <version>1.0-M6-SNAPSHOT</version>
+    <version>1.0-M7-SNAPSHOT</version>
   </parent>
 
   <groupId>sonia.scm.plugins</groupId>
   <artifactId>scm-plugins</artifactId>
   <packaging>pom</packaging>
-  <version>1.0-M6-SNAPSHOT</version>
+  <version>1.0-M7-SNAPSHOT</version>
   <name>scm-plugins</name>
 
   <modules>
     <dependency>
       <groupId>sonia.scm</groupId>
       <artifactId>scm-core</artifactId>
-      <version>1.0-M6-SNAPSHOT</version>
+      <version>1.0-M7-SNAPSHOT</version>
     </dependency>
 
   </dependencies>
     </resources>
   </build>
 
+  <profiles>
+    <profile>
+      <id>release</id>
+      <build>
+        <plugins>
+
+          <plugin>
+            <groupId>sonia.maven</groupId>
+            <artifactId>web-compressor</artifactId>
+            <version>1.0-SNAPSHOT</version>
+            <executions>
+              <execution>
+                <phase>compile</phase>
+                <goals>
+                  <goal>compress-directory</goal>
+                </goals>
+              </execution>
+            </executions>
+            <configuration>
+              <replace>true</replace>
+              <baseDirectory>${project.build.directory}/classes</baseDirectory>
+            </configuration>
+          </plugin>
+
+        </plugins>
+      </build>
+    </profile>
+  </profiles>
+
 </project>

plugins/scm-activedirectory-auth-plugin/pom.xml

   <parent>
     <artifactId>scm-plugins</artifactId>
     <groupId>sonia.scm.plugins</groupId>
-    <version>1.0-M6-SNAPSHOT</version>
+    <version>1.0-M7-SNAPSHOT</version>
   </parent>
 
   <groupId>sonia.scm.plugins</groupId>
   <artifactId>scm-activedirectory-auth-plugin</artifactId>
-  <version>1.0-M6-SNAPSHOT</version>
+  <version>1.0-M7-SNAPSHOT</version>
   <name>scm-activedirectory-auth-plugin</name>
   <url>https://bitbucket.org/sdorra/scm-manager</url>
   <description>
     <dependency>
       <groupId>sonia.scm</groupId>
       <artifactId>scm-core</artifactId>
-      <version>1.0-M6-SNAPSHOT</version>
+      <version>1.0-M7-SNAPSHOT</version>
     </dependency>
     
     <dependency>

plugins/scm-bzr-plugin/pom.xml

   <parent>
     <artifactId>scm-plugins</artifactId>
     <groupId>sonia.scm.plugins</groupId>
-    <version>1.0-M6-SNAPSHOT</version>
+    <version>1.0-M7-SNAPSHOT</version>
   </parent>
 
   <groupId>sonia.scm.plugins</groupId>
   <artifactId>scm-bzr-plugin</artifactId>
-  <version>1.0-M6-SNAPSHOT</version>
+  <version>1.0-M7-SNAPSHOT</version>
   <name>scm-bzr-plugin</name>
   <url>https://bitbucket.org/sdorra/scm-manager</url>
   <description>Plugin for the version control system Bazaar</description>

plugins/scm-git-plugin/pom.xml

   <parent>
     <artifactId>scm-plugins</artifactId>
     <groupId>sonia.scm.plugins</groupId>
-    <version>1.0-M6-SNAPSHOT</version>
+    <version>1.0-M7-SNAPSHOT</version>
   </parent>
 
   <groupId>sonia.scm.plugins</groupId>
   <artifactId>scm-git-plugin</artifactId>
-  <version>1.0-M6-SNAPSHOT</version>
+  <version>1.0-M7-SNAPSHOT</version>
   <name>scm-git-plugin</name>
   <url>https://bitbucket.org/sdorra/scm-manager</url>
   <description>Plugin for the version control system Git</description>
     <dependency>
       <groupId>sonia.scm</groupId>
       <artifactId>scm-test</artifactId>
-      <version>1.0-M6-SNAPSHOT</version>
+      <version>1.0-M7-SNAPSHOT</version>
       <scope>test</scope>
     </dependency>
 

plugins/scm-graph-plugin/pom.xml

   <parent>
     <artifactId>scm-plugins</artifactId>
     <groupId>sonia.scm.plugins</groupId>
-    <version>1.0-M6-SNAPSHOT</version>
+    <version>1.0-M7-SNAPSHOT</version>
   </parent>
 
   <groupId>sonia.scm.plugins</groupId>
   <artifactId>scm-graph-plugin</artifactId>
-  <version>1.0-M6-SNAPSHOT</version>
+  <version>1.0-M7-SNAPSHOT</version>
   <name>scm-graph-plugin</name>
   <description>Creates an Google Guice injection graph</description>
   <url>https://bitbucket.org/sdorra/scm-manager</url>

plugins/scm-hg-plugin/pom.xml

   <parent>
     <groupId>sonia.scm.plugins</groupId>
     <artifactId>scm-plugins</artifactId>
-    <version>1.0-M6-SNAPSHOT</version>
+    <version>1.0-M7-SNAPSHOT</version>
   </parent>
 
   <groupId>sonia.scm.plugins</groupId>
   <artifactId>scm-hg-plugin</artifactId>
-  <version>1.0-M6-SNAPSHOT</version>
+  <version>1.0-M7-SNAPSHOT</version>
   <name>scm-hg-plugin</name>
   <url>https://bitbucket.org/sdorra/scm-manager</url>
   <description>Plugin for the version control system Mercurial</description>
     <dependency>
       <groupId>sonia.scm</groupId>
       <artifactId>scm-test</artifactId>
-      <version>1.0-M6-SNAPSHOT</version>
+      <version>1.0-M7-SNAPSHOT</version>
       <scope>test</scope>
     </dependency>
 

plugins/scm-hg-plugin/src/main/java/sonia/scm/installer/AbstractHgInstaller.java

  *
  */
 
+
+
 package sonia.scm.installer;
 
 //~--- non-JDK imports --------------------------------------------------------
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import sonia.scm.io.Command;
-import sonia.scm.io.CommandResult;
-import sonia.scm.io.SimpleCommand;
 import sonia.scm.repository.HgConfig;
 import sonia.scm.repository.HgRepositoryHandler;
 import sonia.scm.util.IOUtil;
-import sonia.scm.util.SystemUtil;
 
 //~--- JDK imports ------------------------------------------------------------
 
 import java.io.File;
 import java.io.IOException;
-import java.util.Arrays;
-import java.util.List;
 
 /**
  *
   /** Field description */
   public static final String DIRECTORY_REPOSITORY = "repositories";
 
-  /** the logger for AbstractHgInstaller */
-  private static final Logger logger = LoggerFactory
-      .getLogger(AbstractHgInstaller.class);
-
   //~--- constructors ---------------------------------------------------------
 
   /**
   @Override
   public void install(HgConfig config) throws IOException
   {
-    File repoDirectory = new File(baseDirectory, DIRECTORY_REPOSITORY.concat(
-        File.separator).concat(HgRepositoryHandler.TYPE_NAME));
+    File repoDirectory = new File(
+                             baseDirectory,
+                             DIRECTORY_REPOSITORY.concat(File.separator).concat(
+                               HgRepositoryHandler.TYPE_NAME));
 
     IOUtil.mkdirs(repoDirectory);
     config.setRepositoryDirectory(repoDirectory);
   }
 
-  /**
-   * TODO check for windows
-   *
-   *
-   *
-   * @param path
-   * @param cmd
-   *
-   * @return
-   */
-  protected String search(String[] path, String cmd)
-  {
-    String cmdPath = null;
-
-    try
-    {
-      Command command = new SimpleCommand(cmd, "--version");
-      CommandResult result = command.execute();
-
-      if (result.isSuccessfull())
-      {
-        cmdPath = cmd;
-      }
-    }
-    catch (IOException ex)
-    {}
-
-    if (cmdPath == null)
-    {
-      for (String pathPart : path)
-      {
-        List<String> extensions = getExecutableSearchExtensions();
-        File file = findFileByExtension(pathPart, cmd, extensions);
-        if (file != null)
-        {
-          cmdPath = file.getAbsolutePath();
-          break;
-        }
-      }
-    }
-
-    if (cmdPath != null)
-    {
-      if (logger.isInfoEnabled())
-      {
-        logger.info("found {} at {}", cmd, cmdPath);
-      }
-    }
-    else if (logger.isWarnEnabled())
-    {
-      logger.warn("could not find {}", cmd);
-    }
-
-    return cmdPath;
-  }
-
-  /**
-   * Returns a list of file extensions to use when searching for executables.
-   * The list is in priority order, with the highest priority first.
-   */
-  protected List<String> getExecutableSearchExtensions()
-  {
-    List<String> extensions;
-    if (SystemUtil.isWindows())
-    {
-      extensions = Arrays.asList(".exe");
-    }
-    else
-    {
-      extensions = Arrays.asList("");
-    }
-    return extensions;
-  }
-
-  private File findFileByExtension(String parentPath, String cmd,
-      List<String> potentialExtensions)
-  {
-    File file = null;
-    for (String potentialExtension : potentialExtensions)
-    {
-      String fileName = cmd.concat(potentialExtension);
-      File potentialFile = new File(parentPath, fileName);
-      if (potentialFile.exists())
-      {
-        file = potentialFile;
-        break;
-      }
-    }
-    return file;
-  }
-
   //~--- fields ---------------------------------------------------------------
 
   /** Field description */

plugins/scm-hg-plugin/src/main/java/sonia/scm/installer/UnixHgInstaller.java

 
 //~--- non-JDK imports --------------------------------------------------------
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 import sonia.scm.repository.HgConfig;
+import sonia.scm.util.IOUtil;
 
 //~--- JDK imports ------------------------------------------------------------
 
 public class UnixHgInstaller extends AbstractHgInstaller
 {
 
-  /** Field description */
-  private static final String[] PATH = new String[]
-  {
-
-    // default path
-    "/usr/bin",
-
-    // manually installed
-    "/usr/local/bin",
-
-    // mac ports
-    "/opt/local/bin",
-
-    // opencsw
-    "/opt/csw/bin"
-  };
-
-  /** the logger for UnixHgInstaller */
-  private static final Logger logger =
-    LoggerFactory.getLogger(UnixHgInstaller.class);
-
-  //~--- constructors ---------------------------------------------------------
-
   /**
    * Constructs ...
    *
   public void install(HgConfig config) throws IOException
   {
     super.install(config);
-    config.setHgBinary(search(PATH, "hg"));
-    config.setPythonBinary(search(PATH, "python"));
+    config.setHgBinary(IOUtil.search("hg"));
+    config.setPythonBinary(IOUtil.search("python"));
   }
 
   /**

plugins/scm-hg-plugin/src/main/java/sonia/scm/installer/WindowsHgInstaller.java

  *
  */
 
+
+
 package sonia.scm.installer;
 
 //~--- non-JDK imports --------------------------------------------------------
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import sonia.scm.io.SimpleCommand;
-import sonia.scm.io.SimpleCommandResult;
 import sonia.scm.repository.HgConfig;
 import sonia.scm.util.IOUtil;
+import sonia.scm.util.RegistryUtil;
 import sonia.scm.util.Util;
 
 //~--- JDK imports ------------------------------------------------------------
 import java.io.FilenameFilter;
 import java.io.IOException;
 
-import java.util.Scanner;
-
 /**
  *
  * @author Sebastian Sdorra
   private static final String FILE_LIBRARY_ZIP = "library.zip";
 
   /** Field description */
+  private static final String FILE_LIB_MERCURIAL =
+    "Lib\\site-packages\\mercurial";
+
+  /** Field description */
   private static final String FILE_MERCURIAL_EXE = "hg.exe";
 
   /** Field description */
   private static final String FILE_MERCURIAL_SCRIPT = "hg.bat";
 
   /** Field description */
-  private static final String FILE_TEMPLATES = "templates";
-
-  /** Field description */
   private static final String FILE_SCRIPTS = "Scripts";
 
   /** Field description */
-  private static final String FILE_LIB_MERCURIAL = "Lib\\site-packages\\mercurial";
+  private static final String FILE_TEMPLATES = "templates";
 
   /** Field description */
   private static final String[] REGISTRY_HG = new String[]
   };
 
   /** Field description */
-  private static final String REGISTRY_PYTHON = "HKEY_CLASSES_ROOT\\Python.File\\shell\\open\\command";
+  private static final String REGISTRY_PYTHON =
+    "HKEY_CLASSES_ROOT\\Python.File\\shell\\open\\command";
 
   /** the logger for WindowsHgInstaller */
-  private static final Logger logger = LoggerFactory
-      .getLogger(WindowsHgInstaller.class);
+  private static final Logger logger =
+    LoggerFactory.getLogger(WindowsHgInstaller.class);
 
   //~--- constructors ---------------------------------------------------------
 
     super.install(config);
 
     String pythonBinary = getPythonBinary();
+
     config.setPythonBinary(pythonBinary);
 
     File hgScript = getMercurialScript(pythonBinary);
     File hgDirectory = getMercurialDirectory();
+
     if (hgScript != null)
     {
       config.setHgBinary(hgScript.getAbsolutePath());
    * @param config
    */
   @Override
-  public void update(HgConfig config)
-  {}
+  public void update(HgConfig config) {}
 
   /**
    * Method description
       IOUtil.copy(templateDirectory, new File(libDir, FILE_TEMPLATES));
     }
 
-    config.setHgBinary(new File(hgDirectory, FILE_MERCURIAL_EXE)
-        .getAbsolutePath());
+    config.setHgBinary(new File(hgDirectory,
+                                FILE_MERCURIAL_EXE).getAbsolutePath());
   }
 
   //~--- get methods ----------------------------------------------------------
 
     for (String registryKey : REGISTRY_HG)
     {
-      String path = getRegistryValue(registryKey, null, null);
+      String path = RegistryUtil.getRegistryValue(registryKey);
 
       if (path != null)
       {
    * Returns the location of the script to run Mercurial, if Mercurial is
    * installed as a Python package from source.  Only packages that include a
    * templates directory will be recognized.
+   *
+   * @param pythonBinary
+   *
+   * @return
    */
   private File getMercurialScript(String pythonBinary)
   {
     if (pythonBinary != null)
     {
       File pythonBinaryFile = new File(pythonBinary);
+
       if (pythonBinaryFile.exists())
       {
         File pythonDir = pythonBinaryFile.getParentFile();
         File potentialHgScript = new File(scriptsDir, FILE_MERCURIAL_SCRIPT);
         File mercurialPackageDir = new File(pythonDir, FILE_LIB_MERCURIAL);
         File templatesDir = new File(mercurialPackageDir, FILE_TEMPLATES);
+
         if (potentialHgScript.exists() && templatesDir.exists())
+        {
           hgScript = potentialHgScript;
+        }
       }
     }
+
     return hgScript;
   }
 
    */
   private String getPythonBinary()
   {
-    String python = getRegistryValue(REGISTRY_PYTHON, null, null);
+    String python = RegistryUtil.getRegistryValue(REGISTRY_PYTHON);
 
     if (python == null)
     {
-      python = search(new String[0], "python");
+      python = IOUtil.search(new String[0], "python");
     }
 
     return python;
   }
-
-  /**
-   * Method description
-   *
-   *
-   * @param key
-   * @param subKey
-   * @param defaultValue
-   *
-   * @return
-   */
-  private String getRegistryValue(String key, String subKey, String defaultValue)
-  {
-    String programDirectory = defaultValue;
-    SimpleCommand command = null;
-
-    if (subKey != null)
-    {
-      command = new SimpleCommand("reg", "query", key, "/v", subKey);
-    }
-    else
-    {
-      command = new SimpleCommand("reg", "query", key);
-    }
-
-    try
-    {
-      SimpleCommandResult result = command.execute();
-
-      if (result.isSuccessfull())
-      {
-        String output = result.getOutput();
-        Scanner scanner = new Scanner(output);
-
-        while (scanner.hasNextLine())
-        {
-          String line = scanner.nextLine();
-          int index = line.indexOf("REG_SZ");
-
-          if (index > 0)
-          {
-            programDirectory = line.substring(index + "REG_SZ".length()).trim();
-
-            if (programDirectory.startsWith("\""))
-            {
-              programDirectory = programDirectory.substring(1);
-              programDirectory = programDirectory.substring(0, programDirectory
-                  .indexOf("\""));
-            }
-
-            if (logger.isDebugEnabled())
-            {
-              logger.debug("use program directory {}", programDirectory);
-            }
-
-            break;
-          }
-        }
-      }
-    }
-    catch (IOException ex)
-    {
-      logger.error(ex.getMessage(), ex);
-    }
-
-    return programDirectory;
-  }
 }

plugins/scm-pam-plugin/pom.xml

   <parent>
     <artifactId>scm-plugins</artifactId>
     <groupId>sonia.scm.plugins</groupId>
-    <version>1.0-M6-SNAPSHOT</version>
+    <version>1.0-M7-SNAPSHOT</version>
   </parent>
 
   <groupId>sonia.scm.plugins</groupId>
   <artifactId>scm-pam-plugin</artifactId>
-  <version>1.0-M6-SNAPSHOT</version>
+  <version>1.0-M7-SNAPSHOT</version>
   <name>scm-pam-plugin</name>
   <url>https://bitbucket.org/sdorra/scm-manager</url>
   <description>Using pam as an authentication handler.</description>

plugins/scm-svn-plugin/pom.xml

   <parent>
     <artifactId>scm-plugins</artifactId>
     <groupId>sonia.scm.plugins</groupId>
-    <version>1.0-M6-SNAPSHOT</version>
+    <version>1.0-M7-SNAPSHOT</version>
   </parent>
 
   <groupId>sonia.scm.plugins</groupId>
   <artifactId>scm-svn-plugin</artifactId>
-  <version>1.0-M6-SNAPSHOT</version>
+  <version>1.0-M7-SNAPSHOT</version>
   <name>scm-svn-plugin</name>
   <url>https://bitbucket.org/sdorra/scm-manager</url>
   <description>Plugin for the version control system Subversion</description>
   <dependencies>
 
     <dependency>
+      <groupId>javax.servlet</groupId>
+      <artifactId>servlet-api</artifactId>
+      <version>${servlet.version}</version>
+      <scope>provided</scope>
+    </dependency>
+
+    <dependency>
       <groupId>org.tmatesoft.svnkit</groupId>
-      <artifactId>svnkit</artifactId>
-      <version>${svnkit.version}</version>
+      <artifactId>svnkit-dav</artifactId>
+      <version>${svnkit-dav.version}</version>
       <exclusions>
         <exclusion>
           <artifactId>trilead-ssh2</artifactId>
       </exclusions>
     </dependency>
 
-    <dependency>
-      <groupId>org.tmatesoft.svnkit</groupId>
-      <artifactId>svnkit-dav</artifactId>
-      <version>${svnkit.version}</version>
-    </dependency>
-
     <!-- test scope -->
 
     <dependency>
       <groupId>sonia.scm</groupId>
       <artifactId>scm-test</artifactId>
-      <version>1.0-M6-SNAPSHOT</version>
+      <version>1.0-M7-SNAPSHOT</version>
       <scope>test</scope>
     </dependency>
 
   </dependencies>
 
   <properties>
-    <svnkit.version>1.3.4</svnkit.version>
+    <svnkit-dav.version>1.3.5.1</svnkit-dav.version>
   </properties>
 
 </project>
   <groupId>sonia.scm</groupId>
   <artifactId>scm</artifactId>
   <packaging>pom</packaging>
-  <version>1.0-M6-SNAPSHOT</version>
+  <version>1.0-M7-SNAPSHOT</version>
   <name>scm</name>
 
   <url>http://bitbucket.org/sdorra/scm-manager</url>
     <slf4j.version>1.6.1</slf4j.version>
     <servlet.version>2.5</servlet.version>
     <guice.version>2.0</guice.version>
-    <jersey.version>1.5-ea08</jersey.version>
+    <jersey.version>1.5</jersey.version>
     <ehcache.version>2.3.1</ehcache.version>
     <project.build.javaLevel>1.6</project.build.javaLevel>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
   <parent>
     <groupId>sonia.scm</groupId>
     <artifactId>scm</artifactId>
-    <version>1.0-M6-SNAPSHOT</version>
+    <version>1.0-M7-SNAPSHOT</version>
   </parent>
 
   <groupId>sonia.scm.samples</groupId>
   <artifactId>scm-samples</artifactId>
   <packaging>pom</packaging>
-  <version>1.0-M6-SNAPSHOT</version>
+  <version>1.0-M7-SNAPSHOT</version>
   <name>scm-samples</name>
 
   <modules>

samples/scm-sample-auth/pom.xml

   <parent>
     <artifactId>scm-samples</artifactId>
     <groupId>sonia.scm.samples</groupId>
-    <version>1.0-M6-SNAPSHOT</version>
+    <version>1.0-M7-SNAPSHOT</version>
   </parent>
 
   <groupId>sonia.scm.sample</groupId>
   <artifactId>scm-sample-auth</artifactId>
-  <version>1.0-M6-SNAPSHOT</version>
+  <version>1.0-M7-SNAPSHOT</version>
   <name>scm-sample-auth</name>
   <description>Sample Authentication Plugin</description>
   <url>https://bitbucket.org/sdorra/scm-manager</url>
     <dependency>
       <groupId>sonia.scm</groupId>
       <artifactId>scm-core</artifactId>
-      <version>1.0-M6-SNAPSHOT</version>
+      <version>1.0-M7-SNAPSHOT</version>
     </dependency>
 
   </dependencies>

samples/scm-sample-hello/pom.xml

   <parent>
     <artifactId>scm-samples</artifactId>
     <groupId>sonia.scm.samples</groupId>
-    <version>1.0-M6-SNAPSHOT</version>
+    <version>1.0-M7-SNAPSHOT</version>
   </parent>
 
   <groupId>sonia.scm.sample</groupId>
   <artifactId>scm-sample-hello</artifactId>
-  <version>1.0-M6-SNAPSHOT</version>
+  <version>1.0-M7-SNAPSHOT</version>
   <name>scm-sample-hello</name>
   <description>A simple hello world plugin</description>
   <url>https://bitbucket.org/sdorra/scm-manager</url>
     <dependency>
       <groupId>sonia.scm</groupId>
       <artifactId>scm-core</artifactId>
-      <version>1.0-M6-SNAPSHOT</version>
+      <version>1.0-M7-SNAPSHOT</version>
     </dependency>
 
   </dependencies>
   <parent>
     <artifactId>scm</artifactId>
     <groupId>sonia.scm</groupId>
-    <version>1.0-M6-SNAPSHOT</version>
+    <version>1.0-M7-SNAPSHOT</version>
   </parent>
 
   <groupId>sonia.scm</groupId>
   <artifactId>scm-core</artifactId>
-  <version>1.0-M6-SNAPSHOT</version>
+  <version>1.0-M7-SNAPSHOT</version>
   <name>scm-core</name>
 
   <dependencies>

scm-core/src/main/java/sonia/scm/resources/ResourceHandler.java

+/**
+ * Copyright (c) 2010, Sebastian Sdorra
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of SCM-Manager; nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * http://bitbucket.org/sdorra/scm-manager
+ *
+ */
+
+
+
+package sonia.scm.resources;
+
+//~--- non-JDK imports --------------------------------------------------------
+
+import sonia.scm.plugin.ExtensionPoint;
+
+//~--- JDK imports ------------------------------------------------------------
+
+import java.io.InputStream;
+
+/**
+ *
+ * @author Sebastian Sdorra
+ */
+@ExtensionPoint
+public interface ResourceHandler
+{
+
+  /**
+   * Method description
+   *
+   *
+   * @return
+   */
+  public String getName();
+
+  /**
+   * Method description
+   *
+   *
+   * @return
+   */
+  public InputStream getResource();
+
+  /**
+   * Method description
+   *
+   *
+   * @return
+   */
+  public ResourceType getType();
+}

scm-core/src/main/java/sonia/scm/resources/ResourceHandlerComparator.java

+/**
+ * Copyright (c) 2010, Sebastian Sdorra
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of SCM-Manager; nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * http://bitbucket.org/sdorra/scm-manager
+ *
+ */
+
+
+
+package sonia.scm.resources;
+
+//~--- non-JDK imports --------------------------------------------------------
+
+import sonia.scm.util.Util;
+
+//~--- JDK imports ------------------------------------------------------------
+
+import java.util.Comparator;
+
+/**
+ *
+ * @author Sebastian Sdorra
+ */
+public class ResourceHandlerComparator implements Comparator<ResourceHandler>
+{
+
+  /**
+   * Method description
+   *
+   *
+   * @param handler
+   * @param otherHandler
+   *
+   * @return
+   */
+  @Override
+  public int compare(ResourceHandler handler, ResourceHandler otherHandler)
+  {
+    return Util.compare(handler.getName(), otherHandler.getName());
+  }
+}

scm-core/src/main/java/sonia/scm/resources/ResourceType.java

+/**
+ * Copyright (c) 2010, Sebastian Sdorra
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of SCM-Manager; nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * http://bitbucket.org/sdorra/scm-manager
+ *
+ */
+
+
+
+package sonia.scm.resources;
+
+/**
+ *
+ * @author Sebastian Sdorra
+ */
+public enum ResourceType { SCRIPT, STYLESHEET }

scm-core/src/main/java/sonia/scm/user/User.java

    *
    *
    * @param user
+   *
+   * @return
    */
-  public void copyProperties(User user)
+  public boolean copyProperties(User user)
   {
-    user.setAdmin(admin);
-    user.setDisplayName(displayName);
-    user.setMail(mail);
-    user.setName(name);
-    user.setPassword(password);
-    user.setType(type);
+    return copyProperties(user, true);
+  }
+
+  /**
+   * Method description
+   *
+   *
+   * @param user
+   * @param copyPassword
+   *
+   * @return
+   */
+  public boolean copyProperties(User user, boolean copyPassword)
+  {
+    boolean result = false;
+
+    if (user.isAdmin() != admin)
+    {
+      result = true;
+      user.setAdmin(admin);
+    }
+
+    if (Util.isNotEquals(user.getDisplayName(), displayName))
+    {
+      result = true;
+      user.setDisplayName(displayName);
+    }
+
+    if (Util.isNotEquals(user.getMail(), mail))
+    {
+      result = true;
+      user.setMail(mail);
+    }
+
+    if (Util.isNotEquals(user.getName(), name))
+    {
+      result = true;
+      user.setName(name);
+    }
+
+    if (copyPassword && Util.isNotEquals(user.getPassword(), password))
+    {
+      result = true;
+      user.setPassword(password);
+    }
+
+    if (Util.isNotEquals(user.getType(), type))
+    {
+      result = true;
+      user.setType(type);
+    }
+
+    return result;
   }
 
   /**
    *
    * @return
    */
-  public long getLastLogin()
+  public Long getLastModified()
   {
-    return lastLogin;
+    return lastModified;
   }
 
   /**
    * Method description
    *
    *
-   * @param lastLogin
+   * @param lastModified
    */
-  public void setLastLogin(long lastLogin)
+  public void setLastModified(long lastModified)
   {
-    this.lastLogin = lastLogin;
+    this.lastModified = lastModified;
   }
 
   /**
 
   /** Field description */
   @XmlJavaTypeAdapter(XmlTimestampDateAdapter.class)
-  private Long lastLogin;
+  private Long lastModified;
 
   /** Field description */
   private String mail;

scm-core/src/main/java/sonia/scm/util/IOUtil.java

 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import sonia.scm.io.Command;
+import sonia.scm.io.CommandResult;
+import sonia.scm.io.SimpleCommand;
 import sonia.scm.io.ZipUnArchiver;
 
 //~--- JDK imports ------------------------------------------------------------
 import java.io.Reader;
 import java.io.Writer;
 
+import java.util.Arrays;
+import java.util.List;
+
 /**
  *
  * @author Sebastian Sdorra
 {
 
   /** Field description */
+  public static final String DEFAULT_CHECKPARAMETER = "--version";
+
+  /** Field description */
+  public static final String[] DEFAULT_PATH = new String[]
+  {
+
+    // default path
+    "/usr/bin",
+
+    // manually installed
+    "/usr/local/bin",
+
+    // mac ports
+    "/opt/local/bin",
+
+    // opencsw
+    "/opt/csw/bin"
+  };
+
+  /** Field description */
   private static final Logger logger =
     LoggerFactory.getLogger(IOUtil.class.getName());
 
     }
   }
 
+  /**
+   *
+   *
+   * @param cmd
+   *
+   * @return
+   */
+  public static String search(String cmd)
+  {
+    return search(DEFAULT_PATH, cmd, DEFAULT_CHECKPARAMETER);
+  }
+
+  /**
+   *
+   *
+   * @param path
+   * @param cmd
+   *
+   * @return
+   */
+  public static String search(String[] path, String cmd)
+  {
+    return search(path, cmd, DEFAULT_CHECKPARAMETER);
+  }
+
+  /**
+   * TODO check for windows
+   *
+   *
+   *
+   * @param path
+   * @param cmd
+   * @param checkParameter
+   *
+   * @return
+   */
+  public static String search(String[] path, String cmd, String checkParameter)
+  {
+    String cmdPath = null;
+
+    try
+    {
+      Command command = new SimpleCommand(cmd, checkParameter);
+      CommandResult result = command.execute();
+
+      if (result.isSuccessfull())
+      {
+        cmdPath = cmd;
+      }
+    }
+    catch (IOException ex) {}
+
+    if (cmdPath == null)
+    {
+      for (String pathPart : path)
+      {
+        List<String> extensions = getExecutableSearchExtensions();
+        File file = findFileByExtension(pathPart, cmd, extensions);
+
+        if (file != null)
+        {
+          cmdPath = file.getAbsolutePath();
+
+          break;
+        }
+      }
+    }
+
+    if (cmdPath != null)
+    {
+      if (logger.isInfoEnabled())
+      {
+        logger.info("found {} at {}", cmd, cmdPath);
+      }
+    }
+    else if (logger.isWarnEnabled())
+    {
+      logger.warn("could not find {}", cmd);
+    }
+
+    return cmdPath;
+  }
+
+  /**
+   * Method description
+   *
+   *
+   * @param parentPath
+   * @param cmd
+   * @param potentialExtensions
+   *
+   * @return
+   */
+  private static File findFileByExtension(String parentPath, String cmd,
+          List<String> potentialExtensions)
+  {
+    File file = null;
+
+    for (String potentialExtension : potentialExtensions)
+    {
+      String fileName = cmd.concat(potentialExtension);
+      File potentialFile = new File(parentPath, fileName);
+
+      if (potentialFile.exists())
+      {
+        file = potentialFile;
+
+        break;
+      }
+    }
+
+    return file;
+  }
+
+  //~--- get methods ----------------------------------------------------------
+
+  /**
+   * Returns a list of file extensions to use when searching for executables.
+   * The list is in priority order, with the highest priority first.
+   *
+   * @return
+   */
+  private static List<String> getExecutableSearchExtensions()
+  {
+    List<String> extensions;
+
+    if (SystemUtil.isWindows())
+    {
+      extensions = Arrays.asList(".exe");
+    }
+    else
+    {
+      extensions = Arrays.asList("");
+    }
+
+    return extensions;
+  }
+
   //~--- inner classes --------------------------------------------------------
 
   /**

scm-core/src/main/java/sonia/scm/util/RegistryUtil.java

+/**
+ * Copyright (c) 2010, Sebastian Sdorra
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ * 3. Neither the name of SCM-Manager; nor the names of its
+ *    contributors may be used to endorse or promote products derived from this
+ *    software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * http://bitbucket.org/sdorra/scm-manager
+ *
+ */
+
+
+
+package sonia.scm.util;
+
+//~--- non-JDK imports --------------------------------------------------------
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import sonia.scm.io.SimpleCommand;
+import sonia.scm.io.SimpleCommandResult;
+
+//~--- JDK imports ------------------------------------------------------------
+
+import java.io.IOException;
+
+import java.util.Scanner;
+
+/**
+ *
+ * @author Sebastian Sdorra
+ */
+public class RegistryUtil
+{
+
+  /** the logger for RegistryUtil */
+  private static final Logger logger =
+    LoggerFactory.getLogger(RegistryUtil.class);
+
+  //~--- get methods ----------------------------------------------------------
+
+  /**
+   * Method description
+   *
+   *
+   * @param key
+   *
+   * @return
+   */
+  public static String getRegistryValue(String key)
+  {
+    return getRegistryValue(key, null, null);
+  }
+
+  /**
+   * Method description
+   *
+   *
+   * @param key
+   * @param defaultValue
+   *
+   * @return
+   */
+  public static String getRegistryValue(String key, String defaultValue)
+  {
+    return getRegistryValue(key, null, defaultValue);
+  }
+
+  /**
+   * Method description
+   *
+   *
+   * @param key
+   * @param subKey
+   * @param defaultValue
+   *
+   * @return
+   */
+  public static String getRegistryValue(String key, String subKey,
+          String defaultValue)
+  {
+    String value = defaultValue;
+    SimpleCommand command = null;
+
+    if (subKey != null)
+    {
+      command = new SimpleCommand("reg", "query", key, "/v", subKey);
+    }
+    else
+    {
+      command = new SimpleCommand("reg", "query", key);
+    }
+
+    try
+    {
+      SimpleCommandResult result = command.execute();
+
+      if (result.isSuccessfull())
+      {
+        String output = result.getOutput();
+        Scanner scanner = new Scanner(output);
+
+        while (scanner.hasNextLine())
+        {
+          String line = scanner.nextLine();
+          int index = line.indexOf("REG_SZ");
+
+          if (index > 0)
+          {
+            value = line.substring(index + "REG_SZ".length()).trim();
+
+            if (value.startsWith("\""))
+            {
+              value = value.substring(1);
+              value = value.substring(0, value.indexOf("\""));
+            }
+
+            if (logger.isDebugEnabled())
+            {
+              logger.debug("registry value {} at {}", value, key);
+            }
+
+            break;
+          }
+        }
+      }
+    }
+    catch (IOException ex)
+    {
+      logger.error(ex.getMessage(), ex);
+    }
+
+    return value;
+  }
+}

scm-core/src/main/java/sonia/scm/util/Util.java

    * Method description
    *
    *
+   * @param object
+   * @param otherObject
+   * @param <T>
+   *
+   * @return
+   */
+  public static <T extends Comparable> int compare(T object, T otherObject)
+  {
+    int result = 0;
+
+    if ((object != null) && (otherObject != null))
+    {
+      result = object.compareTo(otherObject);
+    }
+    else if ((object == null) && (otherObject != null))
+    {
+      result = 1;
+    }
+    else if ((object != null) && (otherObject == null))
+    {
+      result = -1;
+    }
+
+    return result;
+  }
+
+  /**
+   * Method description
+   *
+   *
    * @param date
    * @param tz
    *
     return parseDate(dateString, null);
   }
 
-  //~--- get methods ----------------------------------------------------------
-
-  /**
-   * Method description
-   *
-   *
-   * @param value
-   *
-   * @return
-   */
-  public static boolean isEmpty(String value)
-  {
-    return (value == null) || (value.trim().length() == 0);
-  }
-
-  /**
-   * Method description
-   *
-   *
-   * @param collection
-   *
-   * @return
-   */
-  public static boolean isEmpty(Collection<?> collection)
-  {
-    return (collection == null) || collection.isEmpty();
-  }
-
-  /**
-   * Method description
-   *
-   *
-   * @param array
-   *
-   * @return
-   */
-  public static boolean isEmpty(Object[] array)
-  {
-    return (array == null) || (array.length == 0);
-  }
-
-  /**
-   * Method description
-   *
-   *
-   * @param value
-   *
-   * @return
-   */
-  public static boolean isNotEmpty(String value)
-  {
-    return (value != null) && (value.trim().length() > 0);
-  }
-
-  /**
-   * Method description
-   *
-   *
-   * @param collection
-   *
-   * @return
-   */
-  public static boolean isNotEmpty(Collection<?> collection)
-  {
-    return (collection != null) &&!collection.isEmpty();
-  }
-
-  /**
-   * Method description
-   *
-   *
-   * @param array
-   *
-   * @return
-   */
-  public static boolean isNotEmpty(Object[] array)
-  {
-    return (array != null) && (array.length > 0);
-  }
-
-  //~--- methods --------------------------------------------------------------
-
   /**
    * Method description
    *
 
     return buffer.toString();
   }
+
+  //~--- get methods ----------------------------------------------------------
+
+  /**
+   * Method description
+   *
+   *
+   * @param value
+   *
+   * @return
+   */
+  public static boolean isEmpty(String value)
+  {
+    return (value == null) || (value.trim().length() == 0);
+  }
+
+  /**
+   * Method description
+   *
+   *
+   * @param collection
+   *
+   * @return
+   */
+  public static boolean isEmpty(Collection<?> collection)
+  {
+    return (collection == null) || collection.isEmpty();
+  }
+
+  /**
+   * Method description
+   *
+   *
+   * @param array
+   *
+   * @return
+   */
+  public static boolean isEmpty(Object[] array)
+  {
+    return (array == null) || (array.length == 0);
+  }
+
+  /**
+   * Method description
+   *
+   *
+   * @param object
+   * @param other
+   *
+   * @return
+   */
+  public static boolean isEquals(Object object, Object other)
+  {
+    return (object == null)
+           ? other == null
+           : object.equals(other);
+  }
+
+  /**
+   * Method description
+   *
+   *
+   * @param value
+   *
+   * @return
+   */
+  public static boolean isNotEmpty(String value)
+  {
+    return (value != null) && (value.trim().length() > 0);
+  }
+
+  /**
+   * Method description
+   *
+   *
+   * @param collection
+   *
+   * @return
+   */
+  public static boolean isNotEmpty(Collection<?> collection)
+  {
+    return (collection != null) &&!collection.isEmpty();
+  }
+
+  /**
+   * Method description
+   *
+   *
+   * @param array
+   *
+   * @return
+   */
+  public static boolean isNotEmpty(Object[] array)
+  {
+    return (array != null) && (array.length > 0);
+  }
+
+  /**
+   * Method description
+   *
+   *
+   * @param object
+   * @param other
+   *
+   * @return
+   */
+  public static boolean isNotEquals(Object object, Object other)
+  {
+    return !isEquals(object, other);
+  }
 }

scm-core/src/main/java/sonia/scm/web/security/AuthenticationResult.java

     return user;
   }
 
+  /**
+   * Method description
+   *
+   *
+   * @return
+   */
+  public boolean isCacheable()
+  {
+    return cacheable;
+  }
+
+  //~--- set methods ----------------------------------------------------------
+
+  /**
+   * Method description
+   *
+   *
+   * @param cacheable
+   */
+  public void setCacheable(boolean cacheable)
+  {
+    this.cacheable = cacheable;
+  }
+
   //~--- fields ---------------------------------------------------------------
 
   /** Field description */
+  private boolean cacheable = true;
+