Return-Path: X-Original-To: apmail-syncope-commits-archive@www.apache.org Delivered-To: apmail-syncope-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id F3BA710DD3 for ; Thu, 1 Jan 2015 18:11:55 +0000 (UTC) Received: (qmail 18970 invoked by uid 500); 1 Jan 2015 18:11:56 -0000 Delivered-To: apmail-syncope-commits-archive@syncope.apache.org Received: (qmail 18899 invoked by uid 500); 1 Jan 2015 18:11:56 -0000 Mailing-List: contact commits-help@syncope.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@syncope.apache.org Delivered-To: mailing list commits@syncope.apache.org Received: (qmail 18784 invoked by uid 99); 1 Jan 2015 18:11:56 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Jan 2015 18:11:56 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 2E387A3BEB3; Thu, 1 Jan 2015 18:11:56 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ilgrosso@apache.org To: commits@syncope.apache.org Date: Thu, 01 Jan 2015 18:11:58 -0000 Message-Id: <9bea003fd21c430294b9f5d9a834ecc8@git.apache.org> In-Reply-To: <26e85fe0744e424d9ba456a9194977e6@git.apache.org> References: <26e85fe0744e424d9ba456a9194977e6@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [03/32] syncope git commit: [SYNOPE-610][SYNCOPE-616] Fixing and improving the management of the xml and properties files inside the installer [SYNOPE-610][SYNCOPE-616] Fixing and improving the management of the xml and properties files inside the installer Project: http://git-wip-us.apache.org/repos/asf/syncope/repo Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/5e013aa4 Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/5e013aa4 Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/5e013aa4 Branch: refs/heads/2_0_X Commit: 5e013aa44bec914bb27115105f0585e6437c8316 Parents: 4a2e843 Author: Marco Di Sabatino Di Diodoro Authored: Mon Dec 22 17:56:11 2014 +0100 Committer: Marco Di Sabatino Di Diodoro Committed: Mon Dec 22 17:56:11 2014 +0100 ---------------------------------------------------------------------- installer/pom.xml | 20 +++ .../installer/containers/jboss/JBoss.java | 12 +- .../org/apache/syncope/installer/enums/DBs.java | 3 + .../installer/files/ConsoleProperties.java | 31 ++++ .../syncope/installer/files/CoreWebXml.java | 76 ++------ .../installer/files/GlassfishCoreWebXml.java | 38 +--- .../files/JBossDeploymentStructureXml.java | 40 +---- .../syncope/installer/files/ParentPom.java | 176 +------------------ .../files/PersistenceContextEMFactoryXml.java | 47 +---- .../installer/files/PersistenceProperties.java | 27 +-- .../installer/processes/ArchetypeProcess.java | 41 +++-- .../installer/processes/BaseProcess.java | 54 ++++++ .../installer/processes/ContainerProcess.java | 171 ++++++++++++++---- .../installer/processes/PersistenceProcess.java | 25 ++- .../installer/utilities/FileSystemUtils.java | 45 +++++ .../syncope/installer/utilities/MavenUtils.java | 31 +--- .../src/main/resources/configuration.properties | 31 ++++ .../main/resources/izpack/ProcessPanel.Spec.xml | 40 +++-- installer/src/main/resources/izpack/install.xml | 6 +- .../main/resources/izpack/userInputLang.xml_eng | 4 + .../main/resources/izpack/userInputLang.xml_ita | 4 + .../src/main/resources/izpack/userInputSpec.xml | 20 ++- installer/src/main/resources/modelerPom.xml | 116 ++++++++++++ 23 files changed, 589 insertions(+), 469 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/syncope/blob/5e013aa4/installer/pom.xml ---------------------------------------------------------------------- diff --git a/installer/pom.xml b/installer/pom.xml index e6675de..7f6e8b0 100644 --- a/installer/pom.xml +++ b/installer/pom.xml @@ -173,6 +173,18 @@ under the License. + ${basedir}/../core/src/main/resources/ + + **/orm* + + + + ${basedir}/../core/src/test/resources/ + + **/persistenceContextEMFactory.xml + + + ${basedir} META-INF @@ -180,6 +192,14 @@ under the License. NOTICE + + src/main/resources + + **/configuration.properties + **/modelerPom.xml + + true + http://git-wip-us.apache.org/repos/asf/syncope/blob/5e013aa4/installer/src/main/java/org/apache/syncope/installer/containers/jboss/JBoss.java ---------------------------------------------------------------------- diff --git a/installer/src/main/java/org/apache/syncope/installer/containers/jboss/JBoss.java b/installer/src/main/java/org/apache/syncope/installer/containers/jboss/JBoss.java index c3f7429..c0e6722 100644 --- a/installer/src/main/java/org/apache/syncope/installer/containers/jboss/JBoss.java +++ b/installer/src/main/java/org/apache/syncope/installer/containers/jboss/JBoss.java @@ -33,7 +33,7 @@ public class JBoss extends AbstractContainer { private final String jbossHost; - private final String jbossPort; + private final String jbossManagementPort; private final String installPath; @@ -41,15 +41,15 @@ public class JBoss extends AbstractContainer { private final HttpUtils httpUtils; - public JBoss(final boolean jbossSsl, final String jbossHost, final String jbossPort, + public JBoss(final boolean jbossSsl, final String jbossHost, final String jbossManagementPort, final String jbossAdminUsername, final String jbossAdminPassword, final String installPath, final String artifactId, final AbstractUIProcessHandler handler) { this.jbossSsl = jbossSsl; this.jbossHost = jbossHost; - this.jbossPort = jbossPort; + this.jbossManagementPort = jbossManagementPort; this.installPath = installPath; this.artifactId = artifactId; - httpUtils = new HttpUtils(jbossSsl, jbossHost, jbossPort, jbossAdminUsername, jbossAdminPassword, handler); + httpUtils = new HttpUtils(jbossSsl, jbossHost, jbossManagementPort, jbossAdminUsername, jbossAdminPassword, handler); } @@ -63,7 +63,7 @@ public class JBoss extends AbstractContainer { public boolean deploy(final String whatDeploy, final String warName) { final String responseBodyAsString = httpUtils.postWithDigestAuth( - String.format(addContentUrl, jbossHost, jbossPort), + String.format(addContentUrl, jbossHost, jbossManagementPort), String.format(whatDeploy, installPath, artifactId)); final JBossAddResponse jBossAddResponse = JsonUtils.jBossAddResponse(responseBodyAsString); @@ -72,7 +72,7 @@ public class JBoss extends AbstractContainer { jBossAddResponse.getResult().getBYTES_VALUE(), warName); int status = httpUtils. - postWithStringEntity(String.format(enableUrl, jbossHost, jbossPort), + postWithStringEntity(String.format(enableUrl, jbossHost, jbossManagementPort), JsonUtils.jBossDeployRequestContent(jBossDeployRequestContent)); return status == 200; } http://git-wip-us.apache.org/repos/asf/syncope/blob/5e013aa4/installer/src/main/java/org/apache/syncope/installer/enums/DBs.java ---------------------------------------------------------------------- diff --git a/installer/src/main/java/org/apache/syncope/installer/enums/DBs.java b/installer/src/main/java/org/apache/syncope/installer/enums/DBs.java index 714e888..db7f8ec 100644 --- a/installer/src/main/java/org/apache/syncope/installer/enums/DBs.java +++ b/installer/src/main/java/org/apache/syncope/installer/enums/DBs.java @@ -43,7 +43,10 @@ public enum DBs { db = MYSQL; } else if (ORACLE.getName().equalsIgnoreCase(containerName)) { db = ORACLE; + } else { + db = SQLSERVER; } + return db; } } http://git-wip-us.apache.org/repos/asf/syncope/blob/5e013aa4/installer/src/main/java/org/apache/syncope/installer/files/ConsoleProperties.java ---------------------------------------------------------------------- diff --git a/installer/src/main/java/org/apache/syncope/installer/files/ConsoleProperties.java b/installer/src/main/java/org/apache/syncope/installer/files/ConsoleProperties.java new file mode 100644 index 0000000..d6d2deb --- /dev/null +++ b/installer/src/main/java/org/apache/syncope/installer/files/ConsoleProperties.java @@ -0,0 +1,31 @@ +/* + * 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.files; + +public class ConsoleProperties { + + public static final String PLACEHOLDER = "scheme=http\n" + + "host=localhost\n" + + "port=8080"; + + public static final String CONSOLE = "scheme=%s\n" + + "host=%s\n" + + "port=%s"; + +} http://git-wip-us.apache.org/repos/asf/syncope/blob/5e013aa4/installer/src/main/java/org/apache/syncope/installer/files/CoreWebXml.java ---------------------------------------------------------------------- diff --git a/installer/src/main/java/org/apache/syncope/installer/files/CoreWebXml.java b/installer/src/main/java/org/apache/syncope/installer/files/CoreWebXml.java index a22c79a..1f78dbc 100644 --- a/installer/src/main/java/org/apache/syncope/installer/files/CoreWebXml.java +++ b/installer/src/main/java/org/apache/syncope/installer/files/CoreWebXml.java @@ -20,78 +20,30 @@ package org.apache.syncope.installer.files; public class CoreWebXml { - public static final String PATH = "/core/src/main/webapp/WEB-INF/web.xml"; + public static final String PLACEHOLDER = ""; - public static String withDataSource() { - return String.format(FILE, withDataSource); - } - - public static String withDataSourceForJBoss() { - return String.format(FILE, withDataSourceForJBoss); - } - - private static final String FILE = "\n" + "\n" - + "\n" + "\n" + " Apache Syncope core\n" + "\n" - + " \n" + " contextConfigLocation\n" - + " classpath*:/*Context.xml\n" + " \n" + "\n" - + " \n" - + " org.springframework.web.context.ContextLoaderListener\n" - + " \n" + " \n" - + " org.apache.syncope.core.init.ThreadLocalCleanupListener\n" - + " \n" + " \n" + " \n" + " CXFServlet\n" - + " org.apache.cxf.transport.servlet.CXFServlet\n" - + " 1 \n" + " \n" + " \n" - + " CXFServlet\n" + " /rest/*\n" - + " \n" + " \n" + " WADLServlet\n" - + " org.apache.syncope.core.rest.WADLServlet\n" - + " 2 \n" + " \n" + " \n" - + " WADLServlet\n" + " /rest/doc/*\n" - + " \n" + "\n" + " \n" + " encodingFilter\n" - + " org.springframework.web.filter.CharacterEncodingFilter\n" - + " \n" + " encoding\n" - + " UTF-8\n" + " \n" + " \n" - + " forceEncoding\n" + " true\n" - + " \n" + " \n" + " \n" - + " springSecurityFilterChain\n" - + " org.springframework.web.filter.DelegatingFilterProxy\n" - + " \n" + "\n" + " \n" + " encodingFilter\n" - + " /*\n" + " \n" + " \n" - + " springSecurityFilterChain\n" + " /*\n" - + " \n" + "\n" + " \n" + " CLIENT-CERT\n" - + " \n" + " \n" + " \n" - + "%s" - + "\n"; - - private static final String withDataSource = "\n" + private static final String WITH_DATA_SOURCE = "\n" + " \n" + " jdbc/syncopeDataSource\n" + " javax.sql.DataSource\n" + " Container\n" - + " \n" + "\n"; + + " \n" + + ""; - private static final String withDataSourceForJBoss = "\n" + private static final String WITH_DATA_SOURCE_FOR_JBOSS = "\n" + " \n" + " jdbc/syncopeDataSource\n" + " javax.sql.DataSource\n" + " Container\n" + " java:/syncopeDataSource\n" - + " \n" + "\n"; + + " \n" + + ""; + + public static String withDataSource(final String content) { + return content.replace(PLACEHOLDER, WITH_DATA_SOURCE); + } + public static String withDataSourceForJBoss(final String content) { + return content.replace(PLACEHOLDER, WITH_DATA_SOURCE_FOR_JBOSS); + } } http://git-wip-us.apache.org/repos/asf/syncope/blob/5e013aa4/installer/src/main/java/org/apache/syncope/installer/files/GlassfishCoreWebXml.java ---------------------------------------------------------------------- diff --git a/installer/src/main/java/org/apache/syncope/installer/files/GlassfishCoreWebXml.java b/installer/src/main/java/org/apache/syncope/installer/files/GlassfishCoreWebXml.java index 0541209..9eadedd 100644 --- a/installer/src/main/java/org/apache/syncope/installer/files/GlassfishCoreWebXml.java +++ b/installer/src/main/java/org/apache/syncope/installer/files/GlassfishCoreWebXml.java @@ -20,38 +20,14 @@ package org.apache.syncope.installer.files; public class GlassfishCoreWebXml { - public static final String PATH = "/core/src/main/webapp/WEB-INF/glassfish-web.xml"; - - public static String withDataSource() { - return String.format(FILE, dataSource); - } - - private final static String FILE = "\n" + "\n" - + "\n" - + "\n" + " /syncope\n" - + "%s" - + " \n" + " \n" - + " \n" + " \n" - + ""; - - private static final String dataSource = "\n" - + " \n" + public static final String PLACEHOLDER = " "; + + public static final String DATA_SOURCE = " \n" + + " jdbc/syncopeDataSource\n" + + " jdbc/syncopeDataSource\n" + + " "; } http://git-wip-us.apache.org/repos/asf/syncope/blob/5e013aa4/installer/src/main/java/org/apache/syncope/installer/files/JBossDeploymentStructureXml.java ---------------------------------------------------------------------- diff --git a/installer/src/main/java/org/apache/syncope/installer/files/JBossDeploymentStructureXml.java b/installer/src/main/java/org/apache/syncope/installer/files/JBossDeploymentStructureXml.java index 7a06b34..1d70e36 100644 --- a/installer/src/main/java/org/apache/syncope/installer/files/JBossDeploymentStructureXml.java +++ b/installer/src/main/java/org/apache/syncope/installer/files/JBossDeploymentStructureXml.java @@ -19,42 +19,10 @@ package org.apache.syncope.installer.files; public class JBossDeploymentStructureXml { + + public static final String PLACEHOLDER = ""; - public static final String PATH = "/core/src/main/webapp/WEB-INF/jboss-deployment-structure.xml"; - - public static final String FILE = "\n" + "\n" - + "\n" - + " \n" - + " \n" - + " \n" - + " \n" - + " " - + " \n" - + " \n" - + " \n" - + " \n" - + " \n" - + " \n" - + " \n" - + " \n" - + " \n" - + " \n" - + " \n" - + " \n" - + " \n" - + ""; + public static final String JBOSSMODULE = "\n" + + ""; } http://git-wip-us.apache.org/repos/asf/syncope/blob/5e013aa4/installer/src/main/java/org/apache/syncope/installer/files/ParentPom.java ---------------------------------------------------------------------- diff --git a/installer/src/main/java/org/apache/syncope/installer/files/ParentPom.java b/installer/src/main/java/org/apache/syncope/installer/files/ParentPom.java index edca681..49c05f3 100644 --- a/installer/src/main/java/org/apache/syncope/installer/files/ParentPom.java +++ b/installer/src/main/java/org/apache/syncope/installer/files/ParentPom.java @@ -19,176 +19,18 @@ package org.apache.syncope.installer.files; public class ParentPom { + + public static final String PLACEHOLDER = ""; - public static final String PATH = "/pom.xml"; - - public static final String FILE = "\n" - + "\n" - + " \n" - + " 4.0.0\n" - + " \n" - + " \n" - + " org.apache.syncope\n" - + " syncope\n" - + " %s\n" - + " \n" - + " \n" - + " \n" - + " %s\n" - + " ahsdgausygdausygduasygd\n" - + " asdasdasdasd\n" - + " \n" - + " \n" - + " Apache Syncope sample project\n" - + " %s\n" - + " %s\n" - + " 1.0-SNAPSHOT\n" - + " pom\n" - + " \n" - + " \n" - + " \n" - + " \n" - + " org.apache.syncope\n" - + " syncope-common\n" - + " ${syncope.version}\n" - + " \n" - + " \n" - + " \n" - + " org.apache.syncope\n" - + " syncope-common\n" - + " ${syncope.version}\n" - + " javadoc\n" - + " \n" - + " \n" - + " \n" - + " org.apache.syncope\n" - + " syncope-client\n" - + " ${syncope.version}\n" - + " \n" - + " \n" - + " \n" - + " org.apache.syncope\n" - + " syncope-build-tools\n" - + " ${syncope.version}\n" - + " war\n" - + " test\n" - + " \n" - + " \n" - + " \n" - + " org.apache.syncope\n" - + " syncope-core\n" - + " ${syncope.version}\n" - + " war\n" - + " \n" - + " \n" - + " org.apache.syncope\n" - + " syncope-core\n" - + " ${syncope.version}\n" - + " classes\n" - + " provided\n" - + " \n" - + " \n" - + " \n" - + " org.apache.syncope\n" - + " syncope-console\n" - + " ${syncope.version}\n" - + " war\n" - + " \n" - + " \n" - + " org.apache.syncope\n" - + " syncope-console\n" - + " ${syncope.version}\n" - + " classes\n" - + " provided\n" - + " \n" - + " \n" - + " \n" - + " \n" - + " \n" - + " \n" - + " \n" - + " \n" - + " \n" - + " \n" - + " org.apache.maven.plugins\n" - + " maven-war-plugin\n" - + " false\n" - + " \n" - + " \n" - + " \n" - + " src/main/webapp\n" - + " \n" - + " **/*.jsp\n" - + " \n" - + " true\n" - + " \n" - + " \n" - + " \n" - + " \n" - + " \n" - + " \n" - + " \n" - + " \n" - + " \n" - + " \n" - + " org.codehaus.mojo\n" - + " ianal-maven-plugin\n" - + " true\n" - + " \n" - + " \n" - + " \n" - + " verify-legal-files\n" - + " \n" - + " none\n" - + " \n" - + " \n" - + " \n" - + " \n" - + " org.apache.rat\n" - + " apache-rat-plugin\n" - + " true\n" - + " \n" - + " \n" - + " \n" - + " check\n" - + " \n" - + " none\n" - + " \n" - + " \n" - + " \n" - + " \n" - + " \n" - + " \n" - + " \n" - + " core\n" - + " console\n" - + " \n" - + " \n" - + " \n" - + " \n" + public static final String REPOSITORY = + " \n" + + " \n" + " ASF\n" - + " https://repository.apache.org/content/repositories/snapshots/\n" + + " https://repository.apache.org/content/repositories/snapshots/\n" + " \n" - + " true\n" - + " \n" - + " \n" + + " true\n" + + " \n" + + " \n" + "\n" + "\n"; http://git-wip-us.apache.org/repos/asf/syncope/blob/5e013aa4/installer/src/main/java/org/apache/syncope/installer/files/PersistenceContextEMFactoryXml.java ---------------------------------------------------------------------- diff --git a/installer/src/main/java/org/apache/syncope/installer/files/PersistenceContextEMFactoryXml.java b/installer/src/main/java/org/apache/syncope/installer/files/PersistenceContextEMFactoryXml.java index 0dd12c4..a64ea36 100644 --- a/installer/src/main/java/org/apache/syncope/installer/files/PersistenceContextEMFactoryXml.java +++ b/installer/src/main/java/org/apache/syncope/installer/files/PersistenceContextEMFactoryXml.java @@ -20,45 +20,12 @@ package org.apache.syncope.installer.files; public class PersistenceContextEMFactoryXml { - public static final String PATH = "/core/src/main/resources/persistenceContextEMFactory.xml"; + public static final String PLACEHOLDER = ""; + + public static final String JBOSS = + ""; - public static final String FILE = "\n" + "\n" - + "\n" + "\n" - + " \n" - + " \n" - + " \n" - + " \n" + " \n" - + " \n" - + " \n" - + " \n" - + " \n" + " \n" - + " \n" + " \n" + " \n" - + " \n" - + " \n" + " \n" - + " \n" + "\n" - + " \n" - + " \n" - + " \n" + " \n" - + " \n" - + " \n" + " \n" - + " \n" + " \n" + "\n" + "\n"; } http://git-wip-us.apache.org/repos/asf/syncope/blob/5e013aa4/installer/src/main/java/org/apache/syncope/installer/files/PersistenceProperties.java ---------------------------------------------------------------------- diff --git a/installer/src/main/java/org/apache/syncope/installer/files/PersistenceProperties.java b/installer/src/main/java/org/apache/syncope/installer/files/PersistenceProperties.java index c27ac35..cba0b61 100644 --- a/installer/src/main/java/org/apache/syncope/installer/files/PersistenceProperties.java +++ b/installer/src/main/java/org/apache/syncope/installer/files/PersistenceProperties.java @@ -20,8 +20,6 @@ package org.apache.syncope.installer.files; public class PersistenceProperties { - public static final String PATH = "/core/src/main/resources/persistence.properties"; - public static final String HEADER = "# Licensed to the Apache Software Foundation (ASF) under one\n" + "# or more contributor license agreements. See the NOTICE file\n" + "# distributed with this work for additional information\n" @@ -59,28 +57,31 @@ public class PersistenceProperties { + "audit.sql=audit.sql\n" + "database.schema=\n"; - public static final String ORACLE = "" - + "jpa.driverClassName=oracle.jdbc.OracleDriver\n" + public static final String ORACLE = "jpa.driverClassName=oracle.jdbc.OracleDriver\n" + "jpa.url=%s\n" + "jpa.username=%s\n" + "jpa.password=%s\n" + "jpa.dialect=org.apache.openjpa.jdbc.sql.OracleDictionary\n" - + "jpa.pool.validationQuery=SELECT 1\n" + + "jpa.pool.validationQuery=SELECT 1 FROM DUAL\n" + + "#note: other connection pool settings can also be configured here, see persistenceContext.xml\n" + "quartz.jobstore=org.quartz.impl.jdbcjobstore.oracle.OracleDelegate\n" + + "quartz.scheduler.idleWaitTime=5000\n" + "quartz.sql=tables_oracle.sql\n" - + "audit.sql=audit.sql\n" + + "audit.sql=audit_oracle.sql\n" + "database.schema=%s\n"; - public static final String SQLSERVER = "" - + "jpa.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver\n" + public static final String SQLSERVER = "jpa.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver\n" + "jpa.url=%s\n" + "jpa.username=%s\n" + "jpa.password=%s\n" - + "jpa.dialect=org.apache.openjpa.jdbc.sql.SQLServerDictionary\n" - + "quartz.jobstore=org.quartz.impl.jdbcjobstore.MSSQLDelegate\n" - + "quartz.sql=tables_sqlServer.sql\n" - + "audit.sql=audit.sql\n" - + "database.schema=\n"; + + "jpa.dialect=org.apache.openjpa.jdbc.sql.SQLServerDictionary\n" + + "jpa.pool.validationQuery=SELECT 1\n" + + "#note: other connection pool settings can also be configured here, see persistenceContext.xml\n" + + "quartz.jobstore=org.quartz.impl.jdbcjobstore.MSSQLDelegate\n" + + "quartz.scheduler.idleWaitTime=5000\n" + + "quartz.sql=tables_sqlServer.sql\n" + + "audit.sql=audit_sqlserver.sql\n" + + "database.schema="; public static final String QUARTZ_INNO_DB = "quartz.sql=tables_mysql_innodb.sql"; http://git-wip-us.apache.org/repos/asf/syncope/blob/5e013aa4/installer/src/main/java/org/apache/syncope/installer/processes/ArchetypeProcess.java ---------------------------------------------------------------------- diff --git a/installer/src/main/java/org/apache/syncope/installer/processes/ArchetypeProcess.java b/installer/src/main/java/org/apache/syncope/installer/processes/ArchetypeProcess.java index 45569e7..0c7bdea 100644 --- a/installer/src/main/java/org/apache/syncope/installer/processes/ArchetypeProcess.java +++ b/installer/src/main/java/org/apache/syncope/installer/processes/ArchetypeProcess.java @@ -22,16 +22,15 @@ import org.apache.syncope.installer.utilities.FileSystemUtils; import com.izforge.izpack.panels.process.AbstractUIProcessHandler; import java.io.File; import java.io.IOException; +import java.util.Properties; import javax.xml.parsers.ParserConfigurationException; import javax.xml.transform.TransformerException; -import org.apache.syncope.installer.files.ModelerPom; -import org.apache.syncope.installer.files.ModelerTokenValueMap; import org.apache.syncope.installer.files.ParentPom; import org.apache.syncope.installer.utilities.InstallLog; import org.apache.syncope.installer.utilities.MavenUtils; import org.xml.sax.SAXException; -public class ArchetypeProcess { +public class ArchetypeProcess extends BaseProcess { public void run(final AbstractUIProcessHandler handler, final String[] args) { final String installPath = args[0]; @@ -52,6 +51,8 @@ public class ArchetypeProcess { final String proxyUser = args[15]; final String proxyPwd = args[16]; final boolean mavenProxyAutoconf = Boolean.valueOf(args[17]); + + setSyncopeInstallDir(installPath, artifactId); final FileSystemUtils fileSystemUtils = new FileSystemUtils(handler); fileSystemUtils.createDirectory(installPath); @@ -97,21 +98,37 @@ public class ArchetypeProcess { handler.logOutput("########################## IMPORTANT ##########################", true); mavenUtils.archetypeGenerate( syncopeVersion, groupId, artifactId, secretKey, anonymousKey, installPath, customMavenProxySettings); - + if (syncopeVersion.contains("SNAPSHOT")) { - fileSystemUtils.writeToFile(new File(installPath + "/" + artifactId + ParentPom.PATH), - String.format(ParentPom.FILE, syncopeVersion, syncopeVersion, groupId, artifactId)); + final File pomFile = + new File(syncopeInstallDir + properties.getProperty("pomFile")); + String contentPomFile = fileSystemUtils.readFile(pomFile); + fileSystemUtils.writeToFile(pomFile, contentPomFile.replace(ParentPom.PLACEHOLDER, ParentPom.REPOSITORY)); } - + fileSystemUtils.createDirectory(confDirectory); fileSystemUtils.createDirectory(logsDirectory); fileSystemUtils.createDirectory(bundlesDirectory); fileSystemUtils.createDirectory(modelerDirectory); - fileSystemUtils.writeToFile(new File(modelerDirectory + ModelerPom.PATH), - String.format(ModelerPom.FILE, modelerDirectory, modelerDirectory)); - fileSystemUtils.writeToFile(new File(modelerDirectory + ModelerTokenValueMap.PATH), ModelerTokenValueMap.FILE); - mavenUtils.mvnCleanPackage(modelerDirectory, customMavenProxySettings); + + fileSystemUtils.copyFileFromResources("/" + properties.getProperty("modelerPomFile"), + modelerDirectory + "/" + properties.getProperty("pomFile"), handler); + + fileSystemUtils.copyFile( + syncopeInstallDir + + properties.getProperty("consoleResDirectory") + + "/" + properties.getProperty("tokenValueMapFile"), + modelerDirectory + "/" + properties.getProperty("tokenValueMapFile")); + + final Properties modelerProperties = new Properties(); + modelerProperties.setProperty("modeler.directory", modelerDirectory); + mavenUtils.mvnCleanPackageWithProperties(modelerDirectory, modelerProperties, customMavenProxySettings); + + final Properties syncopeProperties = new Properties(); + syncopeProperties.setProperty("conf.directory", confDirectory); + syncopeProperties.setProperty("log.directory", logsDirectory); + syncopeProperties.setProperty("bundles.directory", bundlesDirectory); mavenUtils.mvnCleanPackageWithProperties( - installPath + "/" + artifactId, confDirectory, logsDirectory, bundlesDirectory, customMavenProxySettings); + installPath + "/" + artifactId, syncopeProperties, customMavenProxySettings); } } http://git-wip-us.apache.org/repos/asf/syncope/blob/5e013aa4/installer/src/main/java/org/apache/syncope/installer/processes/BaseProcess.java ---------------------------------------------------------------------- diff --git a/installer/src/main/java/org/apache/syncope/installer/processes/BaseProcess.java b/installer/src/main/java/org/apache/syncope/installer/processes/BaseProcess.java new file mode 100644 index 0000000..2058c12 --- /dev/null +++ b/installer/src/main/java/org/apache/syncope/installer/processes/BaseProcess.java @@ -0,0 +1,54 @@ +/* + * 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.processes; + +import static org.apache.syncope.installer.processes.ArchetypeProcess.properties; + +import java.io.IOException; +import java.io.InputStream; +import java.util.Properties; +import org.apache.commons.io.IOUtils; + +public class BaseProcess { + + protected final static Properties properties = new Properties(); + + protected String syncopeInstallDir; + + private static InputStream is = null; + + static { + try { + is = BaseProcess.class.getResourceAsStream("/configuration.properties"); + properties.load(is); + } catch (final IOException e) { + } finally { + IOUtils.closeQuietly(is); + } + } + + protected void setSyncopeInstallDir(final String installPath, final String artifactId) { + final StringBuilder path = new StringBuilder(); + path.append(installPath); + path.append("/"); + path.append(artifactId); + path.append("/"); + syncopeInstallDir = path.toString(); + } +} http://git-wip-us.apache.org/repos/asf/syncope/blob/5e013aa4/installer/src/main/java/org/apache/syncope/installer/processes/ContainerProcess.java ---------------------------------------------------------------------- diff --git a/installer/src/main/java/org/apache/syncope/installer/processes/ContainerProcess.java b/installer/src/main/java/org/apache/syncope/installer/processes/ContainerProcess.java index 62cd6d4..6b99918 100644 --- a/installer/src/main/java/org/apache/syncope/installer/processes/ContainerProcess.java +++ b/installer/src/main/java/org/apache/syncope/installer/processes/ContainerProcess.java @@ -22,21 +22,31 @@ import org.apache.syncope.installer.utilities.FileSystemUtils; import com.izforge.izpack.panels.process.AbstractUIProcessHandler; import java.io.File; import java.io.IOException; +import java.util.Properties; import javax.xml.parsers.ParserConfigurationException; import javax.xml.transform.TransformerException; import org.apache.syncope.installer.containers.Glassfish; import org.apache.syncope.installer.containers.Tomcat; import org.apache.syncope.installer.containers.jboss.JBoss; import org.apache.syncope.installer.enums.Containers; +import org.apache.syncope.installer.files.ConsoleProperties; import org.apache.syncope.installer.files.GlassfishCoreWebXml; import org.apache.syncope.installer.files.JBossDeploymentStructureXml; -import org.apache.syncope.installer.files.PersistenceContextEMFactoryXml; import org.apache.syncope.installer.files.CoreWebXml; +import org.apache.syncope.installer.files.PersistenceContextEMFactoryXml; import org.apache.syncope.installer.utilities.InstallLog; import org.apache.syncope.installer.utilities.MavenUtils; import org.xml.sax.SAXException; -public class ContainerProcess { +public class ContainerProcess extends BaseProcess { + + private final static String HTTP = "http"; + + private final static String HTTPS = "https"; + + private final static String DEFAULT_HOST = "localhost"; + + private final static String DEFAULT_PORT = "8080"; private String installPath; @@ -56,6 +66,12 @@ public class ContainerProcess { private String glassfishDir; + private boolean glassfishSsl; + + private String glassfishHost; + + private String glassfishPort; + private String confDirectory; private String logsDirectory; @@ -76,6 +92,8 @@ public class ContainerProcess { private String jbossAdminPassword; + private String jbossManagementPort; + private boolean isProxyEnabled; private String proxyHost; @@ -99,49 +117,104 @@ public class ContainerProcess { tomcatPort = args[6]; tomcatUser = args[7]; tomcatPassword = args[8]; - glassfishDir = args[9]; - confDirectory = args[10]; - logsDirectory = args[11]; - bundlesDirectory = args[12]; - withDataSource = Boolean.valueOf(args[13]); - jbossSsl = Boolean.valueOf(args[14]); - jbossHost = args[15]; - jbossPort = args[16]; - jbossJdbcModuleName = args[17]; - jbossAdminUsername = args[18]; - jbossAdminPassword = args[19]; - isProxyEnabled = Boolean.valueOf(args[20]); - proxyHost = args[21]; - proxyPort = args[22]; - proxyUser = args[23]; - proxyPwd = args[24]; - mavenProxyAutoconf = Boolean.valueOf(args[25]); + glassfishSsl = Boolean.valueOf(args[9]); + glassfishHost = args[10]; + glassfishPort = args[11]; + glassfishDir = args[12]; + confDirectory = args[13]; + logsDirectory = args[14]; + bundlesDirectory = args[15]; + withDataSource = Boolean.valueOf(args[16]); + jbossSsl = Boolean.valueOf(args[17]); + jbossHost = args[18]; + jbossPort = args[19]; + jbossJdbcModuleName = args[20]; + jbossAdminUsername = args[21]; + jbossAdminPassword = args[22]; + jbossManagementPort = args[23]; + isProxyEnabled = Boolean.valueOf(args[24]); + proxyHost = args[25]; + proxyPort = args[26]; + proxyUser = args[27]; + proxyPwd = args[28]; + mavenProxyAutoconf = Boolean.valueOf(args[28]); final FileSystemUtils fileSystemUtils = new FileSystemUtils(handler); - + handler.logOutput("Configure web.xml file according to " + selectedContainer + " properties", true); InstallLog.getInstance().info("Configure web.xml file according to " + selectedContainer + " properties"); - + + setSyncopeInstallDir(installPath, artifactId); + if (withDataSource) { - fileSystemUtils.writeToFile(new File(installPath + "/" + artifactId + CoreWebXml.PATH), CoreWebXml. - withDataSource()); + final File coreWebXmlFile = + new File(syncopeInstallDir + properties.getProperty("coreWebXmlFile")); + final String contentCoreWebXmlFile = fileSystemUtils.readFile(coreWebXmlFile); + switch (selectedContainer) { + case TOMCAT: + fileSystemUtils.writeToFile(coreWebXmlFile, CoreWebXml.withDataSource(contentCoreWebXmlFile)); + break; case JBOSS: - fileSystemUtils.writeToFile(new File(installPath + "/" + artifactId + CoreWebXml.PATH), - CoreWebXml.withDataSourceForJBoss()); - fileSystemUtils.writeToFile(new File(installPath + "/" + artifactId - + PersistenceContextEMFactoryXml.PATH), PersistenceContextEMFactoryXml.FILE); - fileSystemUtils.writeToFile(new File(installPath + "/" + artifactId - + JBossDeploymentStructureXml.PATH), - String.format(JBossDeploymentStructureXml.FILE, jbossJdbcModuleName)); + fileSystemUtils. + writeToFile(coreWebXmlFile, CoreWebXml.withDataSourceForJBoss(contentCoreWebXmlFile)); + final File jbossDeploymentStructureFile = + new File(syncopeInstallDir + properties.getProperty("jBossDeploymentStructureXmlFile")); + final String contentJbossDeploymentStructureFile = + fileSystemUtils.readFile(jbossDeploymentStructureFile); + fileSystemUtils.writeToFile( + jbossDeploymentStructureFile, + contentJbossDeploymentStructureFile.replace( + JBossDeploymentStructureXml.PLACEHOLDER, + String.format(JBossDeploymentStructureXml.JBOSSMODULE, jbossJdbcModuleName))); break; case GLASSFISH: - fileSystemUtils.writeToFile(new File(installPath + "/" + artifactId + GlassfishCoreWebXml.PATH), - GlassfishCoreWebXml.withDataSource()); + final File glassfishCoreWebXmlFile = + new File(syncopeInstallDir + properties.getProperty("glassfishCoreWebXmlFile")); + final String contentGlassfishWebXmlFile = fileSystemUtils.readFile(glassfishCoreWebXmlFile); + fileSystemUtils.writeToFile(glassfishCoreWebXmlFile, + contentGlassfishWebXmlFile.replace(GlassfishCoreWebXml.PLACEHOLDER, + GlassfishCoreWebXml.DATA_SOURCE)); break; } } + final File consolePropertiesFile = + new File(syncopeInstallDir + + properties.getProperty("consoleResDirectory") + + "/" + properties.getProperty("consolePropertiesFile")); + final String contentConsolePropertiesFile = fileSystemUtils.readFile(consolePropertiesFile); + + final String scheme; + final String host; + final String port; + switch (selectedContainer) { + case TOMCAT: + scheme = tomcatSsl ? HTTPS : HTTP; + host = tomcatHost; + port = tomcatPort; + break; + case JBOSS: + scheme = jbossSsl ? HTTPS : HTTP; + host = jbossHost; + port = jbossPort; + persistenceContextEMFactory(fileSystemUtils, handler); + break; + case GLASSFISH: + scheme = glassfishSsl ? HTTPS : HTTP; + host = glassfishHost; + port = glassfishPort; + break; + default: + scheme = HTTP; + host = DEFAULT_HOST; + port = DEFAULT_PORT; + } + + fileSystemUtils.writeToFile(consolePropertiesFile, + contentConsolePropertiesFile.replace(ConsoleProperties.PLACEHOLDER, + String.format(ConsoleProperties.CONSOLE, scheme, host, port))); + final MavenUtils mavenUtils = new MavenUtils(mavenDir, handler); File customMavenProxySettings = null; try { @@ -178,8 +251,14 @@ public class ContainerProcess { InstallLog.getInstance().error(messageError.append(ex.getMessage() == null ? "" : ex.getMessage()). toString()); } - mavenUtils.mvnCleanPackageWithProperties(installPath + "/" + artifactId, confDirectory, logsDirectory, bundlesDirectory, - customMavenProxySettings); + + final Properties mvnProperties = new Properties(); + mvnProperties.setProperty("conf.directory", confDirectory); + mvnProperties.setProperty("log.directory", logsDirectory); + mvnProperties.setProperty("bundles.directory", bundlesDirectory); + mavenUtils.mvnCleanPackageWithProperties( + installPath + "/" + artifactId, mvnProperties, customMavenProxySettings); + if (isProxyEnabled && mavenProxyAutoconf) { FileSystemUtils.delete(customMavenProxySettings); } @@ -187,7 +266,8 @@ public class ContainerProcess { switch (selectedContainer) { case TOMCAT: final Tomcat tomcat = new Tomcat( - tomcatSsl, tomcatHost, tomcatPort, installPath, artifactId, tomcatUser, tomcatPassword, handler); + tomcatSsl, tomcatHost, tomcatPort, installPath, artifactId, tomcatUser, tomcatPassword, + handler); boolean deployCoreResult = tomcat.deployCore(); if (deployCoreResult) { handler.logOutput("Core successfully deployed ", true); @@ -210,7 +290,7 @@ public class ContainerProcess { break; case JBOSS: final JBoss jBoss = new JBoss( - jbossSsl, jbossHost, jbossPort, jbossAdminUsername, + jbossSsl, jbossHost, jbossManagementPort, jbossAdminUsername, jbossAdminPassword, installPath, artifactId, handler); boolean deployCoreJboss = jBoss.deployCore(); @@ -239,10 +319,25 @@ public class ContainerProcess { final Glassfish glassfish = new Glassfish(installPath, artifactId); - fileSystemUtils.exec("sh " + glassfishDir + Glassfish.DEPLOY_COMMAND + glassfish.deployCore(), null); - fileSystemUtils.exec("sh " + glassfishDir + Glassfish.DEPLOY_COMMAND + glassfish.deployConsole(), null); + fileSystemUtils.exec("sh " + glassfishDir + + Glassfish.DEPLOY_COMMAND + glassfish.deployCore(), null); + fileSystemUtils.exec("sh " + glassfishDir + + Glassfish.DEPLOY_COMMAND + glassfish.deployConsole(), null); break; } } + private void persistenceContextEMFactory( + final FileSystemUtils fileSystemUtils, final AbstractUIProcessHandler handler) { + fileSystemUtils.copyFileFromResources("/jboss/persistenceContextEMFactory.xml", + syncopeInstallDir + + properties.getProperty("persistenceContextEMFactoryFile"), handler); + final File persistenceContextEMFactoryFile = new File( + syncopeInstallDir + properties.getProperty("persistenceContextEMFactoryFile")); + final String contentPersistenceContextEMFactory = fileSystemUtils.readFile(persistenceContextEMFactoryFile); + fileSystemUtils.writeToFile( + persistenceContextEMFactoryFile, + contentPersistenceContextEMFactory.replace(PersistenceContextEMFactoryXml.PLACEHOLDER, + PersistenceContextEMFactoryXml.JBOSS)); + } } http://git-wip-us.apache.org/repos/asf/syncope/blob/5e013aa4/installer/src/main/java/org/apache/syncope/installer/processes/PersistenceProcess.java ---------------------------------------------------------------------- diff --git a/installer/src/main/java/org/apache/syncope/installer/processes/PersistenceProcess.java b/installer/src/main/java/org/apache/syncope/installer/processes/PersistenceProcess.java index 983e3e8..33356f6 100644 --- a/installer/src/main/java/org/apache/syncope/installer/processes/PersistenceProcess.java +++ b/installer/src/main/java/org/apache/syncope/installer/processes/PersistenceProcess.java @@ -22,11 +22,10 @@ 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.InstallLog; -public class PersistenceProcess { +public class PersistenceProcess extends BaseProcess { private String installPath; @@ -56,8 +55,8 @@ public class PersistenceProcess { oracleTableSpace = args[7]; final FileSystemUtils fileSystemUtils = new FileSystemUtils(handler); - final StringBuilder persistenceProperties = new StringBuilder(PersistenceProperties.HEADER); + setSyncopeInstallDir(installPath, artifactId); handler.logOutput("Configure persistence file according to " + dbSelected + " properties", true); InstallLog.getInstance().info("Configure persistence file according to " + dbSelected + " properties"); @@ -80,24 +79,22 @@ public class PersistenceProcess { persistenceProperties.append(String.format( PersistenceProperties.ORACLE, persistenceUrl, persistenceUser, persistencePassword, oracleTableSpace)); - writeOrmFile(fileSystemUtils, OrmXml.ORACLE_ORM); + fileSystemUtils.copyFileFromResources("/META-INF/orm.xml.oracle", + syncopeInstallDir + properties.getProperty("coreMetaInfDirectory") + + "/" + properties.getProperty("ormXmlFile"), handler); break; case SQLSERVER: persistenceProperties.append(String.format( PersistenceProperties.SQLSERVER, persistenceUrl, persistenceUser, persistencePassword)); - writeOrmFile(fileSystemUtils, OrmXml.SQLSERVER_ORM); + fileSystemUtils.copyFileFromResources("/META-INF/orm.xml.sqlserver", + syncopeInstallDir + + properties.getProperty("coreMetaInfDirectory") + + "/" + properties.getProperty("ormXmlFile"), handler); break; } fileSystemUtils.writeToFile(new File( - installPath + "/" + artifactId + PersistenceProperties.PATH), persistenceProperties.toString()); - - } - - private void writeOrmFile(final FileSystemUtils fileSystemUtils, final String content) { - fileSystemUtils.createDirectory( - installPath + File.separator + artifactId + OrmXml.PATH_DIR); - fileSystemUtils.writeToFile( - new File(installPath + File.separator + artifactId + OrmXml.PATH_COMPLETE), content); + syncopeInstallDir + properties.getProperty("persistencePropertiesFile")), + persistenceProperties.toString()); } } http://git-wip-us.apache.org/repos/asf/syncope/blob/5e013aa4/installer/src/main/java/org/apache/syncope/installer/utilities/FileSystemUtils.java ---------------------------------------------------------------------- diff --git a/installer/src/main/java/org/apache/syncope/installer/utilities/FileSystemUtils.java b/installer/src/main/java/org/apache/syncope/installer/utilities/FileSystemUtils.java index aea1c95..4381c1e 100644 --- a/installer/src/main/java/org/apache/syncope/installer/utilities/FileSystemUtils.java +++ b/installer/src/main/java/org/apache/syncope/installer/utilities/FileSystemUtils.java @@ -29,6 +29,11 @@ import java.io.InputStreamReader; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.PrintWriter; +import java.net.URL; +import java.nio.file.CopyOption; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.nio.file.StandardCopyOption; import javax.xml.transform.OutputKeys; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerException; @@ -54,6 +59,21 @@ public class FileSystemUtils { } } + public void copyFile(final String sourceFilePath, final String targetFilePath) { + try { + final CopyOption[] options = new CopyOption[] { + StandardCopyOption.REPLACE_EXISTING, + StandardCopyOption.COPY_ATTRIBUTES + }; + Files.copy(Paths.get(sourceFilePath), Paths.get(targetFilePath), options); + } catch (final IOException ex) { + final String errorMessage = + "Error copy file " + sourceFilePath + " to " + targetFilePath; + handler.emitError(errorMessage, errorMessage); + InstallLog.getInstance().error(errorMessage); + } + } + public void exec(final String cmd, final String path) { try { handler.logOutput("Executing " + cmd, true); @@ -96,6 +116,18 @@ public class FileSystemUtils { } } + public String readFile(final File file) { + String content = ""; + try { + content = FileUtils.readFileToString(file); + } catch (IOException ex) { + final String errorMessage = "Error reading file " + file.getAbsolutePath() + ": " + ex.getMessage(); + handler.emitError(errorMessage, errorMessage); + InstallLog.getInstance().error(errorMessage); + } + return content; + } + public void appendToFile(final File file, final String content) { try { if (!file.exists()) { @@ -131,4 +163,17 @@ public class FileSystemUtils { public static void delete(final File file) { FileUtils.deleteQuietly(file); } + + public void copyFileFromResources(final String filePath, + final String destination, final AbstractUIProcessHandler handler) { + try { + final URL url = getClass().getResource(filePath); + final File dest = new File(destination); + FileUtils.copyURLToFile(url, dest); + } catch (IOException ex) { + final String errorMessage = "Error copy file " + filePath; + handler.emitError(errorMessage, errorMessage); + InstallLog.getInstance().error(errorMessage); + } + } } http://git-wip-us.apache.org/repos/asf/syncope/blob/5e013aa4/installer/src/main/java/org/apache/syncope/installer/utilities/MavenUtils.java ---------------------------------------------------------------------- diff --git a/installer/src/main/java/org/apache/syncope/installer/utilities/MavenUtils.java b/installer/src/main/java/org/apache/syncope/installer/utilities/MavenUtils.java index e842ea7..f39d4b4 100644 --- a/installer/src/main/java/org/apache/syncope/installer/utilities/MavenUtils.java +++ b/installer/src/main/java/org/apache/syncope/installer/utilities/MavenUtils.java @@ -65,8 +65,8 @@ public class MavenUtils { final InvocationRequest request = new DefaultInvocationRequest(); request.setGoals(Collections.singletonList("archetype:generate")); request.setInteractive(false); - final Properties properties - = archetypeProperties(archetypeVersion, groupId, artifactId, secretKey, anonymousKey); + final Properties properties = + archetypeProperties(archetypeVersion, groupId, artifactId, secretKey, anonymousKey); request.setProperties(properties); if (customSettingsFile != null && FileUtils.sizeOf(customSettingsFile) > 0) { request.setUserSettingsFile(customSettingsFile); @@ -94,24 +94,8 @@ public class MavenUtils { return properties; } - public void mvnCleanPackage(final String path, final File customSettingsFile) { + public void mvnCleanPackageWithProperties(final String path, final Properties properties, final File customSettingsFile) { final InvocationRequest request = new DefaultInvocationRequest(); - if (customSettingsFile != null && FileUtils.sizeOf(customSettingsFile) > 0) { - request.setUserSettingsFile(customSettingsFile); - } - final List mavenGoals = new ArrayList(); - mavenGoals.add("clean"); - mavenGoals.add("package"); - request.setGoals(mavenGoals); - logToHandler(request.getGoals(), new Properties()); - logToFile(request.getGoals(), new Properties()); - invoke(request, path); - } - - public void mvnCleanPackageWithProperties(final String path, final String confDirectory, - final String logDirectory, final String bundlesDirectory, final File customSettingsFile) { - final InvocationRequest request = new DefaultInvocationRequest(); - final Properties properties = packageProperties(confDirectory, logDirectory, bundlesDirectory); request.setProperties(properties); if (customSettingsFile != null && FileUtils.sizeOf(customSettingsFile) > 0) { request.setUserSettingsFile(customSettingsFile); @@ -149,15 +133,6 @@ public class MavenUtils { } } - private Properties packageProperties(final String confDirectory, final String logDirectory, - final String bundlesDirectory) { - final Properties properties = new Properties(); - properties.setProperty("conf.directory", confDirectory); - properties.setProperty("log.directory", logDirectory); - properties.setProperty("bundles.directory", bundlesDirectory); - return properties; - } - private InvocationResult invoke(final InvocationRequest request, final String path) { InvocationResult result = null; final Invoker invoker = new DefaultInvoker(); http://git-wip-us.apache.org/repos/asf/syncope/blob/5e013aa4/installer/src/main/resources/configuration.properties ---------------------------------------------------------------------- diff --git a/installer/src/main/resources/configuration.properties b/installer/src/main/resources/configuration.properties new file mode 100644 index 0000000..e06fe57 --- /dev/null +++ b/installer/src/main/resources/configuration.properties @@ -0,0 +1,31 @@ +# 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. + +coreWebXmlFile=core/src/main/webapp/WEB-INF/web.xml +jBossDeploymentStructureXmlFile=core/src/main/webapp/WEB-INF/jboss-deployment-structure.xml +glassfishCoreWebXmlFile=core/src/main/webapp/WEB-INF/glassfish-web.xml +tokenValueMapFile=oryx.debug.js-tokenValueMap.properties +consoleResDirectory=console/src/main/resources +pomFile=pom.xml +persistenceContextEMFactoryFile=core/src/main/resources/persistenceContextEMFactory.xml +coreMetaInfDirectory=core/src/main/resources/META-INF +ormXmlFile=orm.xml +ormXmlOracle=orm.xml.oracle +ormXmlOracleSqlServer=orm.xml.sqlserver +persistencePropertiesFile=core/src/main/resources/persistence.properties +consolePropertiesFile=console.properties +modelerPomFile=modelerPom.xml \ No newline at end of file http://git-wip-us.apache.org/repos/asf/syncope/blob/5e013aa4/installer/src/main/resources/izpack/ProcessPanel.Spec.xml ---------------------------------------------------------------------- diff --git a/installer/src/main/resources/izpack/ProcessPanel.Spec.xml b/installer/src/main/resources/izpack/ProcessPanel.Spec.xml index db1a64f..859ec18 100644 --- a/installer/src/main/resources/izpack/ProcessPanel.Spec.xml +++ b/installer/src/main/resources/izpack/ProcessPanel.Spec.xml @@ -64,23 +64,29 @@ under the License. $tomcat.container.port $tomcat.container.user $tomcat.container.pwd - $glassfish.container.dir - $mvn.conf.directory - $mvn.log.directory - $mvn.bundle.directory - $with.datasuorce - $jboss.container.ssl - $jboss.container.host - $jboss.container.port - $jboss.container.jdbc.module - $jboss.container.user - $jboss.container.pwd - $mvn.proxy - $mvn.proxy.host - $mvn.proxy.port - $mvn.proxy.user - $mvn.proxy.pwd - $mvn.proxy.autoconf + $glassfish.container.ssl + $glassfish.container.host + $glassfish.container.port + $glassfish.container.dir + $mvn.conf.directory + $mvn.log.directory + $mvn.bundle.directory + $with.datasuorce + $jboss.container.ssl + $jboss.container.host + $jboss.container.port + $jboss.container.jdbc.module + $jboss.container.user + $jboss.container.pwd + $jboss.container.management.port + $mvn.proxy + $mvn.proxy.host + $mvn.proxy.port + $mvn.proxy.user + $mvn.proxy.pwd + $mvn.proxy.autoconf + $mvn.proxy.autoconf + $mvn.proxy.autoconf http://git-wip-us.apache.org/repos/asf/syncope/blob/5e013aa4/installer/src/main/resources/izpack/install.xml ---------------------------------------------------------------------- diff --git a/installer/src/main/resources/izpack/install.xml b/installer/src/main/resources/izpack/install.xml index c7795f8..f2c35b8 100644 --- a/installer/src/main/resources/izpack/install.xml +++ b/installer/src/main/resources/izpack/install.xml @@ -33,7 +33,7 @@ under the License. ${targetJdk} - + @@ -55,7 +55,7 @@ under the License. - + @@ -170,6 +170,6 @@ under the License. Apache Syncope Installer - + http://git-wip-us.apache.org/repos/asf/syncope/blob/5e013aa4/installer/src/main/resources/izpack/userInputLang.xml_eng ---------------------------------------------------------------------- diff --git a/installer/src/main/resources/izpack/userInputLang.xml_eng b/installer/src/main/resources/izpack/userInputLang.xml_eng index 65ab5c9..00f183f 100644 --- a/installer/src/main/resources/izpack/userInputLang.xml_eng +++ b/installer/src/main/resources/izpack/userInputLang.xml_eng @@ -52,6 +52,9 @@ under the License. + + + @@ -59,4 +62,5 @@ under the License. + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/syncope/blob/5e013aa4/installer/src/main/resources/izpack/userInputLang.xml_ita ---------------------------------------------------------------------- diff --git a/installer/src/main/resources/izpack/userInputLang.xml_ita b/installer/src/main/resources/izpack/userInputLang.xml_ita index d60fc56..65dc51f 100644 --- a/installer/src/main/resources/izpack/userInputLang.xml_ita +++ b/installer/src/main/resources/izpack/userInputLang.xml_ita @@ -52,6 +52,9 @@ under the License. + + + @@ -59,4 +62,5 @@ under the License. + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/syncope/blob/5e013aa4/installer/src/main/resources/izpack/userInputSpec.xml ---------------------------------------------------------------------- diff --git a/installer/src/main/resources/izpack/userInputSpec.xml b/installer/src/main/resources/izpack/userInputSpec.xml index bf1ce27..0253a33 100644 --- a/installer/src/main/resources/izpack/userInputSpec.xml +++ b/installer/src/main/resources/izpack/userInputSpec.xml @@ -131,7 +131,7 @@ under the License. - + @@ -200,6 +200,18 @@ under the License. + + + + + + + + + + + + @@ -213,7 +225,7 @@ under the License. - + @@ -227,5 +239,9 @@ under the License. + + + + http://git-wip-us.apache.org/repos/asf/syncope/blob/5e013aa4/installer/src/main/resources/modelerPom.xml ---------------------------------------------------------------------- diff --git a/installer/src/main/resources/modelerPom.xml b/installer/src/main/resources/modelerPom.xml new file mode 100644 index 0000000..8b65ba6 --- /dev/null +++ b/installer/src/main/resources/modelerPom.xml @@ -0,0 +1,116 @@ + + + + + 4.0.0 + + org.apache.syncope + activitiModelerSetup + 1.0-SNAPSHOT + jar + + + 5.16.2 + ${modeler.directory} + ${modeler.directory}/oryx.debug.js-tokenValueMap.properties + + UTF-8 + + + + + org.activiti + activiti-webapp-explorer2 + ${activiti.version} + war + test + + + + + + + org.apache.maven.plugins + maven-antrun-plugin + 1.7 + + + setupActivitiModeler + process-resources + + + + + + + + + + + + + + + + + + + + + + + + + + + + run + + + + + + com.google.code.maven-replacer-plugin + replacer + 1.5.3 + + + process-resources + + replace + + + + + ${activiti-modeler.directory}/editor/oryx.debug.js + ${tokenValueMap} + true + false + + + + +