syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1615112 - in /syncope/trunk: ./ installer/ installer/src/main/java/org/apache/syncope/installer/containers/ installer/src/main/java/org/apache/syncope/installer/processes/ installer/src/main/java/org/apache/syncope/installer/utilities/ ins...
Date Fri, 01 Aug 2014 14:24:34 GMT
Author: massi
Date: Fri Aug  1 14:24:34 2014
New Revision: 1615112

URL: http://svn.apache.org/r1615112
Log:
merge from branch

Added:
    syncope/trunk/installer/src/main/java/org/apache/syncope/installer/utilities/FileSystemUtils.java
      - copied unchanged from r1615111, syncope/branches/1_2_X/installer/src/main/java/org/apache/syncope/installer/utilities/FileSystemUtils.java
    syncope/trunk/installer/src/main/java/org/apache/syncope/installer/utilities/MavenUtils.java
      - copied unchanged from r1615111, syncope/branches/1_2_X/installer/src/main/java/org/apache/syncope/installer/utilities/MavenUtils.java
Removed:
    syncope/trunk/installer/src/main/java/org/apache/syncope/installer/processes/AbstractProcess.java
    syncope/trunk/installer/src/main/java/org/apache/syncope/installer/utilities/Commands.java
Modified:
    syncope/trunk/installer/pom.xml
    syncope/trunk/installer/src/main/java/org/apache/syncope/installer/containers/Tomcat.java
    syncope/trunk/installer/src/main/java/org/apache/syncope/installer/processes/ArchetypeProcess.java
    syncope/trunk/installer/src/main/java/org/apache/syncope/installer/processes/ContainerProcess.java
    syncope/trunk/installer/src/main/java/org/apache/syncope/installer/processes/PersistenceProcess.java
    syncope/trunk/installer/src/main/resources/izpack/install.xml
    syncope/trunk/pom.xml

Modified: syncope/trunk/installer/pom.xml
URL: http://svn.apache.org/viewvc/syncope/trunk/installer/pom.xml?rev=1615112&r1=1615111&r2=1615112&view=diff
==============================================================================
--- syncope/trunk/installer/pom.xml (original)
+++ syncope/trunk/installer/pom.xml Fri Aug  1 14:24:34 2014
@@ -55,6 +55,10 @@ under the License.
       <groupId>org.codehaus.izpack</groupId>
       <artifactId>izpack-panel</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.apache.maven.shared</groupId>
+      <artifactId>maven-invoker</artifactId>
+    </dependency>
     
     <dependency>
       <groupId>org.apache.httpcomponents</groupId>

Modified: syncope/trunk/installer/src/main/java/org/apache/syncope/installer/containers/Tomcat.java
URL: http://svn.apache.org/viewvc/syncope/trunk/installer/src/main/java/org/apache/syncope/installer/containers/Tomcat.java?rev=1615112&r1=1615111&r2=1615112&view=diff
==============================================================================
--- syncope/trunk/installer/src/main/java/org/apache/syncope/installer/containers/Tomcat.java
(original)
+++ syncope/trunk/installer/src/main/java/org/apache/syncope/installer/containers/Tomcat.java
Fri Aug  1 14:24:34 2014
@@ -20,7 +20,7 @@ package org.apache.syncope.installer.con
 
 import java.io.UnsupportedEncodingException;
 import java.net.URLEncoder;
-import org.apache.syncope.installer.utilities.Commands;
+import org.apache.syncope.installer.utilities.FileSystemUtils;
 import org.apache.syncope.installer.utilities.HttpUtils;
 
 public class Tomcat extends AbstractContainer {
@@ -52,7 +52,7 @@ public class Tomcat extends AbstractCont
 
     public boolean deployCore() {
         int status;
-        if (Commands.IS_WIN) {
+        if (FileSystemUtils.IS_WIN) {
             status = httpUtils.getWithBasicAuth(pathEncoded(WIN_DEPLOY_SYNCOPE_CORE_QUERY));
         } else {
             status = httpUtils.getWithBasicAuth(path(UNIX_DEPLOY_SYNCOPE_CORE_QUERY));
@@ -63,7 +63,7 @@ public class Tomcat extends AbstractCont
 
     public boolean deployConsole() {
         int status;
-        if (Commands.IS_WIN) {
+        if (FileSystemUtils.IS_WIN) {
             status = httpUtils.getWithBasicAuth(pathEncoded(WIN_DEPLOY_SYNCOPE_CONSOLE_QUERY));
         } else {
             status = httpUtils.getWithBasicAuth(path(UNIX_DEPLOY_SYNCOPE_CONSOLE_QUERY));

Modified: syncope/trunk/installer/src/main/java/org/apache/syncope/installer/processes/ArchetypeProcess.java
URL: http://svn.apache.org/viewvc/syncope/trunk/installer/src/main/java/org/apache/syncope/installer/processes/ArchetypeProcess.java?rev=1615112&r1=1615111&r2=1615112&view=diff
==============================================================================
--- syncope/trunk/installer/src/main/java/org/apache/syncope/installer/processes/ArchetypeProcess.java
(original)
+++ syncope/trunk/installer/src/main/java/org/apache/syncope/installer/processes/ArchetypeProcess.java
Fri Aug  1 14:24:34 2014
@@ -18,12 +18,13 @@
  */
 package org.apache.syncope.installer.processes;
 
+import org.apache.syncope.installer.utilities.FileSystemUtils;
 import com.izforge.izpack.panels.process.AbstractUIProcessHandler;
 import java.io.File;
 import org.apache.syncope.installer.files.Pom;
-import org.apache.syncope.installer.utilities.Commands;
+import org.apache.syncope.installer.utilities.MavenUtils;
 
-public class ArchetypeProcess extends AbstractProcess {
+public class ArchetypeProcess {
 
     public void run(final AbstractUIProcessHandler handler, final String[] args) {
 
@@ -39,19 +40,22 @@ public class ArchetypeProcess extends Ab
         final String syncopeAdminPassword = args[9];
 
         if (!new File(installPath).exists()) {
-            exec(Commands.createDirectory(installPath), handler, null);
+            FileSystemUtils.createDirectory(installPath, handler, null);
         }
-        exec(Commands.createArchetype(mavenDir, syncopeVersion, groupId, artifactId, secretKey,
anonymousKey),
-                handler, installPath);
-        writeToFile(new File(installPath + "/" + artifactId + Pom.PATH),
+        
+        final MavenUtils mavenUtils = new MavenUtils(mavenDir);
+        
+        mavenUtils.archetypeGenerate(
+                syncopeVersion, groupId, artifactId, secretKey, anonymousKey, installPath);
+
+        FileSystemUtils.writeToFile(new File(installPath + "/" + artifactId + Pom.PATH),
                 String.format(Pom.FILE, syncopeVersion, syncopeVersion));
 
-        exec(Commands.createDirectory(logsDirectory), handler, null);
+        FileSystemUtils.createDirectory(logsDirectory, handler, null);
 
-        exec(Commands.createDirectory(bundlesDirectory), handler, null);
+        FileSystemUtils.createDirectory(bundlesDirectory, handler, null);
 
-        exec(Commands.compileArchetype(mavenDir, logsDirectory, bundlesDirectory),
-                handler, installPath + "/" + artifactId);
+        mavenUtils.createPackage(installPath + "/" + artifactId, logsDirectory, bundlesDirectory);
     }
 
 }

Modified: syncope/trunk/installer/src/main/java/org/apache/syncope/installer/processes/ContainerProcess.java
URL: http://svn.apache.org/viewvc/syncope/trunk/installer/src/main/java/org/apache/syncope/installer/processes/ContainerProcess.java?rev=1615112&r1=1615111&r2=1615112&view=diff
==============================================================================
--- syncope/trunk/installer/src/main/java/org/apache/syncope/installer/processes/ContainerProcess.java
(original)
+++ syncope/trunk/installer/src/main/java/org/apache/syncope/installer/processes/ContainerProcess.java
Fri Aug  1 14:24:34 2014
@@ -18,6 +18,7 @@
  */
 package org.apache.syncope.installer.processes;
 
+import org.apache.syncope.installer.utilities.FileSystemUtils;
 import com.izforge.izpack.panels.process.AbstractUIProcessHandler;
 import java.io.File;
 import org.apache.syncope.installer.containers.Glassfish;
@@ -28,9 +29,9 @@ import org.apache.syncope.installer.file
 import org.apache.syncope.installer.files.JBossDeploymentStructureXml;
 import org.apache.syncope.installer.files.PersistenceContextEMFactoryXml;
 import org.apache.syncope.installer.files.WebXml;
-import org.apache.syncope.installer.utilities.Commands;
+import org.apache.syncope.installer.utilities.MavenUtils;
 
-public class ContainerProcess extends AbstractProcess {
+public class ContainerProcess {
 
     private String installPath;
 
@@ -91,24 +92,26 @@ public class ContainerProcess extends Ab
         jbossAdminPassword = args[18];
 
         if (withDataSource) {
-            writeToFile(new File(installPath + "/" + artifactId + WebXml.PATH), WebXml.withDataSource());
+            FileSystemUtils.writeToFile(new File(installPath + "/" + artifactId + WebXml.PATH),
WebXml.withDataSource());
             switch (selectedContainer) {
                 case JBOSS:
-                    writeToFile(new File(installPath + "/" + artifactId + WebXml.PATH), WebXml.withDataSourceForJBoss());
-                    writeToFile(new File(installPath + "/" + artifactId + PersistenceContextEMFactoryXml.PATH),
-                            PersistenceContextEMFactoryXml.FILE);
-                    writeToFile(new File(installPath + "/" + artifactId + JBossDeploymentStructureXml.PATH),
+                    FileSystemUtils.writeToFile(new File(installPath + "/" + artifactId +
WebXml.PATH),
+                            WebXml.withDataSourceForJBoss());
+                    FileSystemUtils.writeToFile(new File(installPath + "/" + artifactId
+                            + PersistenceContextEMFactoryXml.PATH), PersistenceContextEMFactoryXml.FILE);
+                    FileSystemUtils.writeToFile(new File(installPath + "/" + artifactId
+                            + JBossDeploymentStructureXml.PATH),
                             String.format(JBossDeploymentStructureXml.FILE, jbossJdbcModuleName));
                     break;
                 case GLASSFISH:
-                    writeToFile(new File(installPath + "/" + artifactId + GlassfishWebXml.PATH),
+                    FileSystemUtils.writeToFile(new File(installPath + "/" + artifactId +
GlassfishWebXml.PATH),
                             GlassfishWebXml.withDataSource());
                     break;
             }
         }
 
-        exec(Commands.compileArchetype(mavenDir, logsDirectory, bundlesDirectory),
-                handler, installPath + "/" + artifactId);
+        final MavenUtils mavenUtils = new MavenUtils(mavenDir);
+        mavenUtils.createPackage(installPath + "/" + artifactId, logsDirectory, bundlesDirectory);
 
         switch (selectedContainer) {
             case TOMCAT:
@@ -148,12 +151,12 @@ public class ContainerProcess extends Ab
                 break;
             case GLASSFISH:
                 final String createJavaOptCommand = "sh " + glassfishDir + Glassfish.CREATE_JAVA_OPT_COMMAND;
-                exec(createJavaOptCommand, handler, null);
+                FileSystemUtils.exec(createJavaOptCommand, handler, null);
 
                 final Glassfish glassfish = new Glassfish(installPath, artifactId);
 
-                exec("sh " + glassfishDir + Glassfish.DEPLOY_COMMAND + glassfish.deployCore(),
handler, null);
-                exec("sh " + glassfishDir + Glassfish.DEPLOY_COMMAND + glassfish.deployConsole(),
handler, null);
+                FileSystemUtils.exec("sh " + glassfishDir + Glassfish.DEPLOY_COMMAND + glassfish.deployCore(),
handler, null);
+                FileSystemUtils.exec("sh " + glassfishDir + Glassfish.DEPLOY_COMMAND + glassfish.deployConsole(),
handler, null);
                 break;
         }
     }

Modified: syncope/trunk/installer/src/main/java/org/apache/syncope/installer/processes/PersistenceProcess.java
URL: http://svn.apache.org/viewvc/syncope/trunk/installer/src/main/java/org/apache/syncope/installer/processes/PersistenceProcess.java?rev=1615112&r1=1615111&r2=1615112&view=diff
==============================================================================
--- syncope/trunk/installer/src/main/java/org/apache/syncope/installer/processes/PersistenceProcess.java
(original)
+++ syncope/trunk/installer/src/main/java/org/apache/syncope/installer/processes/PersistenceProcess.java
Fri Aug  1 14:24:34 2014
@@ -18,14 +18,14 @@
  */
 package org.apache.syncope.installer.processes;
 
+import org.apache.syncope.installer.utilities.FileSystemUtils;
 import com.izforge.izpack.panels.process.AbstractUIProcessHandler;
 import java.io.File;
 import org.apache.syncope.installer.enums.DBs;
 import org.apache.syncope.installer.files.OrmXml;
 import org.apache.syncope.installer.files.PersistenceProperties;
-import org.apache.syncope.installer.utilities.Commands;
 
-public class PersistenceProcess extends AbstractProcess {
+public class PersistenceProcess {
 
     private String installPath;
 
@@ -83,14 +83,14 @@ public class PersistenceProcess extends 
                 break;
         }
 
-        writeToFile(new File(
+        FileSystemUtils.writeToFile(new File(
                 installPath + "/" + artifactId + PersistenceProperties.PATH), persistenceProperties.toString());
 
     }
 
     private void writeOrmFile(final AbstractUIProcessHandler handler, final String content)
{
-        exec(Commands.createDirectory(installPath + "/" + artifactId + OrmXml.PATH_DIR),
handler, null);
+        FileSystemUtils.createDirectory(installPath + "/" + artifactId + OrmXml.PATH_DIR,
handler, null);
         final File orm = new File(installPath + "/" + artifactId + OrmXml.PATH_COMPLETE);
-        writeToFile(orm, content);
+        FileSystemUtils.writeToFile(orm, content);
     }
 }

Modified: syncope/trunk/installer/src/main/resources/izpack/install.xml
URL: http://svn.apache.org/viewvc/syncope/trunk/installer/src/main/resources/izpack/install.xml?rev=1615112&r1=1615111&r2=1615112&view=diff
==============================================================================
--- syncope/trunk/installer/src/main/resources/izpack/install.xml (original)
+++ syncope/trunk/installer/src/main/resources/izpack/install.xml Fri Aug  1 14:24:34 2014
@@ -142,6 +142,9 @@ under the License.
   <jar src="lib/jackson-core-@{jackson.version}.1.jar"/>
   <jar src="lib/jackson-annotations-@{jackson.version}.jar"/>
   
+  <jar src="lib/maven-invoker-@{maven-invoker.version}.jar"/>
+  <jar src="lib/plexus-utils-3.0.8.jar"/>
+  
   <panels>
     <panel classname="HTMLHelloPanel" id="welcome"/>
        

Modified: syncope/trunk/pom.xml
URL: http://svn.apache.org/viewvc/syncope/trunk/pom.xml?rev=1615112&r1=1615111&r2=1615112&view=diff
==============================================================================
--- syncope/trunk/pom.xml (original)
+++ syncope/trunk/pom.xml Fri Aug  1 14:24:34 2014
@@ -367,6 +367,7 @@ under the License.
     <codemirror.version>3.23</codemirror.version>
 
     <izpack.version>5.0.0-rc2</izpack.version>
+    <maven-invoker.version>2.1.1</maven-invoker.version>
     
     <jdeb.version>1.3</jdeb.version>
  
@@ -923,6 +924,11 @@ under the License.
         <artifactId>izpack-panel</artifactId>
         <version>${izpack.version}</version>
       </dependency>
+      <dependency>
+        <groupId>org.apache.maven.shared</groupId>
+        <artifactId>maven-invoker</artifactId>
+        <version>${maven-invoker.version}</version>
+      </dependency>
       
       <!-- TEST -->
       <dependency>



Mime
View raw message