You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by ma...@apache.org on 2014/07/07 11:38:18 UTC
svn commit: r1608386 - in /syncope/trunk/installer/src/main:
java/org/apache/syncope/installer/containers/
java/org/apache/syncope/installer/containers/jboss/
java/org/apache/syncope/installer/files/
java/org/apache/syncope/installer/processes/ resourc...
Author: massi
Date: Mon Jul 7 09:38:18 2014
New Revision: 1608386
URL: http://svn.apache.org/r1608386
Log:
Fixed #SYNCOPE-532
Added:
syncope/trunk/installer/src/main/java/org/apache/syncope/installer/containers/AbstractContainer.java
Modified:
syncope/trunk/installer/src/main/java/org/apache/syncope/installer/containers/Glassfish.java
syncope/trunk/installer/src/main/java/org/apache/syncope/installer/containers/Tomcat.java
syncope/trunk/installer/src/main/java/org/apache/syncope/installer/containers/jboss/JBoss.java
syncope/trunk/installer/src/main/java/org/apache/syncope/installer/files/Pom.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/resources/izpack/install.xml
syncope/trunk/installer/src/main/resources/izpack/userInputSpec.xml
Added: syncope/trunk/installer/src/main/java/org/apache/syncope/installer/containers/AbstractContainer.java
URL: http://svn.apache.org/viewvc/syncope/trunk/installer/src/main/java/org/apache/syncope/installer/containers/AbstractContainer.java?rev=1608386&view=auto
==============================================================================
--- syncope/trunk/installer/src/main/java/org/apache/syncope/installer/containers/AbstractContainer.java (added)
+++ syncope/trunk/installer/src/main/java/org/apache/syncope/installer/containers/AbstractContainer.java Mon Jul 7 09:38:18 2014
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.installer.containers;
+
+public abstract class AbstractContainer {
+
+ protected static final String CORE_RELATIVE_PATH = "%s/%s/core/target/syncope.war";
+
+ protected static final String CONSOLE_RELATIVE_PATH = "%s/%s/console/target/syncope-console.war";
+
+}
Modified: syncope/trunk/installer/src/main/java/org/apache/syncope/installer/containers/Glassfish.java
URL: http://svn.apache.org/viewvc/syncope/trunk/installer/src/main/java/org/apache/syncope/installer/containers/Glassfish.java?rev=1608386&r1=1608385&r2=1608386&view=diff
==============================================================================
--- syncope/trunk/installer/src/main/java/org/apache/syncope/installer/containers/Glassfish.java (original)
+++ syncope/trunk/installer/src/main/java/org/apache/syncope/installer/containers/Glassfish.java Mon Jul 7 09:38:18 2014
@@ -18,13 +18,28 @@
*/
package org.apache.syncope.installer.containers;
-public class Glassfish {
+public class Glassfish extends AbstractContainer {
- public static final String deploySyncopeCore
- = "%s/%s/core/target/syncope.war";
+ private final String installPath;
- public static final String deploySyncopeConsole
- = "%s/%s/console/target/syncope-console.war";
+ private final String artifactId;
+
+ public Glassfish(final String installPath, final String artifactId) {
+ this.installPath = installPath;
+ this.artifactId = artifactId;
+ }
+
+ public String deployCore() {
+ return deploy(CORE_RELATIVE_PATH);
+ }
+
+ public String deployConsole() {
+ return deploy(CONSOLE_RELATIVE_PATH);
+ }
+
+ public String deploy(final String what) {
+ return String.format(what, installPath, artifactId);
+ }
public static final String CREATE_JAVA_OPT_COMMAND = "/bin/asadmin create-jvm-options"
+ "-Dcom.sun.enterprise.overrideablejavaxpackages=javax.ws.rs,javax.ws.rs.core,javax.ws.rs.ext";
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=1608386&r1=1608385&r2=1608386&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 Mon Jul 7 09:38:18 2014
@@ -23,16 +23,16 @@ import java.net.URLEncoder;
import org.apache.syncope.installer.utilities.Commands;
import org.apache.syncope.installer.utilities.HttpUtils;
-public class Tomcat {
+public class Tomcat extends AbstractContainer {
private static final String UNIX_DEPLOY_SYNCOPE_CORE_QUERY
- = "/manager/text/deploy?path=/syncope&war=file:%s/%s/core/target/syncope.war";
+ = "/manager/text/deploy?path=/syncope&war=file:" + CORE_RELATIVE_PATH;
private static final String WIN_DEPLOY_SYNCOPE_CORE_QUERY
= "/manager/text/deploy?path=/syncope&war=file:%s\\%s\\core\\target\\syncope.war";
private static final String UNIX_DEPLOY_SYNCOPE_CONSOLE_QUERY
- = "/manager/text/deploy?path=/syncope-console&war=file:%s/%s/console/target/syncope-console.war";
+ = "/manager/text/deploy?path=/syncope-console&war=file:" + CONSOLE_RELATIVE_PATH;
private static final String WIN_DEPLOY_SYNCOPE_CONSOLE_QUERY
= "/manager/text/deploy?path=/syncope-console&war=file:%s\\%s\\console\\target\\syncope-console.war";
Modified: syncope/trunk/installer/src/main/java/org/apache/syncope/installer/containers/jboss/JBoss.java
URL: http://svn.apache.org/viewvc/syncope/trunk/installer/src/main/java/org/apache/syncope/installer/containers/jboss/JBoss.java?rev=1608386&r1=1608385&r2=1608386&view=diff
==============================================================================
--- syncope/trunk/installer/src/main/java/org/apache/syncope/installer/containers/jboss/JBoss.java (original)
+++ syncope/trunk/installer/src/main/java/org/apache/syncope/installer/containers/jboss/JBoss.java Mon Jul 7 09:38:18 2014
@@ -18,14 +18,11 @@
*/
package org.apache.syncope.installer.containers.jboss;
+import org.apache.syncope.installer.containers.AbstractContainer;
import org.apache.syncope.installer.utilities.HttpUtils;
import org.apache.syncope.installer.utilities.JsonUtils;
-public class JBoss {
-
- private final String core = "%s/%s/core/target/syncope.war";
-
- private final String console = "%s/%s/console/target/syncope-console.war";
+public class JBoss extends AbstractContainer {
private final String addContentUrl = "http://%s:%s/management/add-content";
@@ -56,11 +53,11 @@ public class JBoss {
}
public boolean deployCore() {
- return deploy(core, "syncope.war");
+ return deploy(CORE_RELATIVE_PATH, "syncope.war");
}
public boolean deployConsole() {
- return deploy(console, "syncope-console.war");
+ return deploy(CONSOLE_RELATIVE_PATH, "syncope-console.war");
}
public boolean deploy(final String whatDeploy, final String warName) {
Modified: syncope/trunk/installer/src/main/java/org/apache/syncope/installer/files/Pom.java
URL: http://svn.apache.org/viewvc/syncope/trunk/installer/src/main/java/org/apache/syncope/installer/files/Pom.java?rev=1608386&r1=1608385&r2=1608386&view=diff
==============================================================================
--- syncope/trunk/installer/src/main/java/org/apache/syncope/installer/files/Pom.java (original)
+++ syncope/trunk/installer/src/main/java/org/apache/syncope/installer/files/Pom.java Mon Jul 7 09:38:18 2014
@@ -39,8 +39,8 @@ public class Pom {
+ "--><project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd\">\n"
+ "\n" + " <modelVersion>4.0.0</modelVersion>\n" + "\n" + " <parent>\n"
+ " <groupId>org.apache.syncope</groupId>\n" + " <artifactId>syncope</artifactId>\n"
- + " <version xmlns=\"\">1.2.0-SNAPSHOT</version>\n" + " </parent>\n" + "\n" + " <properties>\n"
- + " <syncope.version xmlns=\"\">1.2.0-SNAPSHOT</syncope.version>\n"
+ + " <version xmlns=\"\">%s</version>\n" + " </parent>\n" + "\n" + " <properties>\n"
+ + " <syncope.version xmlns=\"\">%s</syncope.version>\n"
+ " <secretKey>123456789asdfghj</secretKey>\n" + " <anonymousKey>aoshdaiuhdaiuhd</anonymousKey>\n"
+ " </properties>\n" + "\n" + " <name>Apache Syncope sample project</name>\n"
+ " <groupId>net.tirasa</groupId>\n" + " <artifactId>syncope</artifactId>\n"
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=1608386&r1=1608385&r2=1608386&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 Mon Jul 7 09:38:18 2014
@@ -43,7 +43,8 @@ public class ArchetypeProcess extends Ab
}
exec(Commands.createArchetype(mavenDir, syncopeVersion, groupId, artifactId, secretKey, anonymousKey),
handler, installPath);
- writeToFile(new File(installPath + "/" + artifactId + Pom.PATH), Pom.FILE);
+ writeToFile(new File(installPath + "/" + artifactId + Pom.PATH),
+ String.format(Pom.FILE, syncopeVersion, syncopeVersion));
exec(Commands.createDirectory(logsDirectory), handler, null);
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=1608386&r1=1608385&r2=1608386&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 Mon Jul 7 09:38:18 2014
@@ -149,10 +149,11 @@ public class ContainerProcess extends Ab
case GLASSFISH:
final String createJavaOptCommand = "sh " + glassfishDir + Glassfish.CREATE_JAVA_OPT_COMMAND;
exec(createJavaOptCommand, handler, null);
- exec("sh " + glassfishDir + Glassfish.DEPLOY_COMMAND
- + String.format(Glassfish.deploySyncopeCore, installPath, artifactId), handler, null);
- exec("sh " + glassfishDir + Glassfish.DEPLOY_COMMAND
- + String.format(Glassfish.deploySyncopeConsole, installPath, artifactId), 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);
break;
}
}
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=1608386&r1=1608385&r2=1608386&view=diff
==============================================================================
--- syncope/trunk/installer/src/main/resources/izpack/install.xml (original)
+++ syncope/trunk/installer/src/main/resources/izpack/install.xml Mon Jul 7 09:38:18 2014
@@ -24,7 +24,6 @@ under the License.
http://izpack.org/schema/5.0/izpack-installation-5.0.xsd">
<properties>
<property name="info.appName" value="Apache Syncope"/>
- <property name="info.appVersion" value="@{project.version}"/>
<property name="info.url" value="http://syncope.apache.org"/>
<property name="info.company.name" value="Tirasa S.r.l."/>
<property name="info.company.email" value="info@tirasa.net"/>
@@ -118,7 +117,7 @@ under the License.
</conditions>
<resources>
- <res id="installer.jar" src="../syncope-installer-1.2.0-SNAPSHOT.jar"/>
+ <res id="installer.jar" src="../syncope-installer-@{syncope.version}.jar"/>
<res id="Installer.image" src="img/apache-syncope-vert.png" />
@@ -132,7 +131,7 @@ under the License.
<res id="ProcessPanel.Spec.xml" src="ProcessPanel.Spec.xml"/>
</resources>
- <jar src="../syncope-installer-1.2.0-SNAPSHOT.jar" stage="install"/>
+ <jar src="../syncope-installer-@{syncope.version}.jar" stage="install"/>
<jar src="lib/commons-logging-1.1.3.jar"/>
<jar src="lib/commons-codec-1.9.jar"/>
<jar src="lib/commons-io-2.4.jar"/>
Modified: syncope/trunk/installer/src/main/resources/izpack/userInputSpec.xml
URL: http://svn.apache.org/viewvc/syncope/trunk/installer/src/main/resources/izpack/userInputSpec.xml?rev=1608386&r1=1608385&r2=1608386&view=diff
==============================================================================
--- syncope/trunk/installer/src/main/resources/izpack/userInputSpec.xml (original)
+++ syncope/trunk/installer/src/main/resources/izpack/userInputSpec.xml Mon Jul 7 09:38:18 2014
@@ -53,7 +53,7 @@ under the License.
</field>
<field type="space"/>
<field type="text" variable="mvn.syncope.version">
- <spec id="mvn.syncope.version.id" size="20" set="1.2.0-SNAPSHOT"/>
+ <spec id="mvn.syncope.version.id" size="20" set="${syncope.version}"/>
</field>
<!-- <field type="space"/>
<field type="password" variable="mvn.syncope.admin.password">