You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2020/03/16 08:49:21 UTC

[syncope] 08/08: [SYNCOPE-1545] Archetype

This is an automated email from the ASF dual-hosted git repository.

ilgrosso pushed a commit to branch SYNCOPE-1545
in repository https://gitbox.apache.org/repos/asf/syncope.git

commit 13624ac55b8afeb6027f0977c56c7e251c6cd4a6
Author: Francesco Chicchiriccò <il...@apache.org>
AuthorDate: Sun Mar 15 17:26:24 2020 +0100

    [SYNCOPE-1545] Archetype
---
 archetype/pom.xml                                  |  32 +++++
 .../META-INF/maven/archetype-metadata.xml          |  13 ++
 .../main/resources/archetype-resources/fit/pom.xml |  12 +-
 .../main/resources/archetype-resources/wa/pom.xml  | 134 +++++++++++++++++++++
 .../wa/src/test/resources/keymaster.properties     |  19 +++
 archetype/src/main/resources/meta-pom.xml          |   7 ++
 core/idrepo/logic/pom.xml                          |   8 --
 .../org/apache/syncope/fit/core/ReportITCase.java  |   7 +-
 pom.xml                                            |  33 -----
 wa/pom.xml                                         |   1 +
 10 files changed, 219 insertions(+), 47 deletions(-)

diff --git a/archetype/pom.xml b/archetype/pom.xml
index 54a749a..f500f59 100644
--- a/archetype/pom.xml
+++ b/archetype/pom.xml
@@ -354,6 +354,38 @@ under the License.
           <include>keymaster.properties</include>          
         </includes>
       </resource>
+
+      <resource>
+        <directory>../wa/src/main/resources</directory>
+        <targetPath>${project.build.outputDirectory}/archetype-resources/wa/src/main/resources</targetPath>
+      </resource>
+      <resource>
+        <directory>../wa/src/test/resources</directory>
+        <targetPath>${project.build.outputDirectory}/archetype-resources/wa/src/main/resources</targetPath>
+        <includes>
+          <include>keymaster.properties</include>          
+        </includes>
+      </resource>
+      <resource>
+        <directory>../fit/wa-reference/src/main/resources</directory>
+        <targetPath>${project.build.outputDirectory}/archetype-resources/wa/src/main/resources</targetPath>
+        <includes>
+          <include>application-embedded.properties</include>
+          <include>log4j2.xml</include>
+        </includes>
+      </resource>
+      <resource>
+        <directory>../fit/wa-reference/src/main/resources</directory>
+        <targetPath>${project.build.outputDirectory}/archetype-resources/wa/src/test/resources</targetPath>
+        <includes>
+          <include>wa</include>
+          <include>keymaster.properties</include>
+        </includes>
+      </resource>
+      <resource>
+        <directory>../fit/wa-reference/src/main/webapp/WEB-INF</directory>
+        <targetPath>${project.build.outputDirectory}/archetype-resources/wa/src/main/webapp/WEB-INF</targetPath>
+      </resource>
     </resources>
   </build>
   
diff --git a/archetype/src/main/resources/META-INF/maven/archetype-metadata.xml b/archetype/src/main/resources/META-INF/maven/archetype-metadata.xml
index f22b5fb..9fa586c 100644
--- a/archetype/src/main/resources/META-INF/maven/archetype-metadata.xml
+++ b/archetype/src/main/resources/META-INF/maven/archetype-metadata.xml
@@ -79,6 +79,19 @@ under the License.
         </fileSet>
       </fileSets>
     </module>
+    <module id="syncope-wa" dir="wa" name="syncope-wa">
+      <fileSets>
+        <fileSet filtered="false" encoding="UTF-8">
+          <directory>src/main/resources</directory>
+        </fileSet>
+        <fileSet filtered="false" encoding="UTF-8">
+          <directory>src/main/webapp</directory>
+        </fileSet>
+        <fileSet filtered="false" encoding="UTF-8">
+          <directory>src/test/resources</directory>
+        </fileSet>
+      </fileSets>
+    </module>
     <module id="syncope-sra" dir="sra" name="syncope-sra">
       <fileSets>
         <fileSet filtered="false" encoding="UTF-8">
diff --git a/archetype/src/main/resources/archetype-resources/fit/pom.xml b/archetype/src/main/resources/archetype-resources/fit/pom.xml
index 53745a8..6be3d9d 100644
--- a/archetype/src/main/resources/archetype-resources/fit/pom.xml
+++ b/archetype/src/main/resources/archetype-resources/fit/pom.xml
@@ -153,6 +153,10 @@ under the License.
                 <copy file="../enduser/target/test-classes/customTemplate.json" 
                       todir="../enduser/target/syncope-enduser/WEB-INF/classes" 
                       overwrite="true"/>
+
+                <copy file="../wa/target/test-classes/keymaster.properties" 
+                      todir="../wa/target/syncope-wa/WEB-INF/classes" 
+                      overwrite="true"/>
               </target>
             </configuration>
             <goals>
@@ -181,7 +185,7 @@ under the License.
               <goal>exec</goal>
             </goals>
             <configuration>
-              <executable>java</executable>
+              <executable>${JAVA_HOME}/bin/java</executable>
               <arguments>
                 <argument>-jar</argument>
                 <argument>${basedir}/../sra/target/syncope-sra.jar</argument>
@@ -253,6 +257,12 @@ under the License.
                 <context>syncope-enduser</context>
               </properties>
             </deployable>
+            <deployable>
+              <location>../wa/target/syncope-wa</location>
+              <properties>
+                <context>syncope-wa</context>
+              </properties>
+            </deployable>
           </deployables>
         </configuration>
       </plugin>
diff --git a/archetype/src/main/resources/archetype-resources/wa/pom.xml b/archetype/src/main/resources/archetype-resources/wa/pom.xml
new file mode 100644
index 0000000..91b4a22
--- /dev/null
+++ b/archetype/src/main/resources/archetype-resources/wa/pom.xml
@@ -0,0 +1,134 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+<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/xsd/maven-4.0.0.xsd">
+
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>${groupId}</groupId>
+    <artifactId>${rootArtifactId}</artifactId>
+    <version>${version}</version>
+  </parent>
+
+  <name>Apache Syncope sample project - WA</name>
+  <groupId>${groupId}</groupId>
+  <artifactId>${artifactId}</artifactId>
+  <packaging>war</packaging>
+
+  <properties>
+    <guava.version>28.2-jre</guava.version>
+    <opensaml.version>3.4.5</opensaml.version>
+    <bootstrap.version>4.4.1</bootstrap.version>
+    <slf4j.version>2.0.0-alpha1</slf4j.version>
+  </properties>
+
+  <dependencies>
+    <dependency>
+      <groupId>${groupId}</groupId>
+      <artifactId>syncope-common</artifactId>
+      <version>${project.version}</version>
+    </dependency>  
+    
+    <dependency>
+      <groupId>org.apache.syncope</groupId>
+      <artifactId>syncope-wa</artifactId>
+    </dependency>
+    
+    <dependency>
+      <groupId>org.apache.syncope.ext.self-keymaster</groupId>
+      <artifactId>syncope-ext-self-keymaster-client</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.syncope.common.keymaster</groupId>
+      <artifactId>syncope-common-keymaster-client-zookeeper</artifactId>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <finalName>syncope-wa</finalName>
+
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-war-plugin</artifactId>
+        <inherited>true</inherited>
+        <configuration>
+          <webResources>
+            <resource>
+              <directory>${basedir}/src/main/webapp/WEB-INF</directory>
+              <filtering>true</filtering>
+              <targetPath>WEB-INF</targetPath>
+              <includes>
+                <include>web.xml</include>
+              </includes>
+            </resource>
+          </webResources>
+        </configuration>
+      </plugin>
+    </plugins>
+
+    <resources>
+      <resource>
+        <directory>src/main/resources</directory>
+        <filtering>true</filtering>
+      </resource>
+    </resources>
+
+    <testResources>
+      <testResource>
+        <directory>src/test/resources</directory>
+        <filtering>true</filtering>
+      </testResource>
+    </testResources>
+  </build>
+
+  <profiles>
+    <profile>
+      <id>executable</id>
+      
+      <dependencies>
+        <dependency>
+          <groupId>org.springframework.boot</groupId>
+          <artifactId>spring-boot-starter-undertow</artifactId>
+        </dependency>
+      </dependencies>
+        
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-maven-plugin</artifactId>
+            <configuration>
+              <mainClass>org.apache.syncope.wa.SyncopeWAApplication</mainClass>
+              <layout>ZIP</layout>
+            </configuration>
+            <executions>
+              <execution>
+                <goals>
+                  <goal>repackage</goal>
+                </goals>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+  </profiles>
+</project>
diff --git a/archetype/src/main/resources/archetype-resources/wa/src/test/resources/keymaster.properties b/archetype/src/main/resources/archetype-resources/wa/src/test/resources/keymaster.properties
new file mode 100644
index 0000000..033fe3b
--- /dev/null
+++ b/archetype/src/main/resources/archetype-resources/wa/src/test/resources/keymaster.properties
@@ -0,0 +1,19 @@
+# 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.
+keymaster.address=http://localhost:9080/syncope/rest/keymaster
+keymaster.username=${anonymousUser}
+keymaster.password=${anonymousKey}
diff --git a/archetype/src/main/resources/meta-pom.xml b/archetype/src/main/resources/meta-pom.xml
index 8eb4a43..fe5f3e8 100644
--- a/archetype/src/main/resources/meta-pom.xml
+++ b/archetype/src/main/resources/meta-pom.xml
@@ -89,6 +89,12 @@ under the License.
       </dependency>
 
       <dependency>
+        <groupId>org.apache.syncope</groupId>
+        <artifactId>syncope-wa</artifactId>
+        <version>${syncope.version}</version>
+      </dependency>
+
+      <dependency>
         <groupId>org.apache.syncope.ext.self-keymaster</groupId>
         <artifactId>syncope-ext-self-keymaster-rest-cxf</artifactId>
         <version>${syncope.version}</version>
@@ -135,6 +141,7 @@ under the License.
     <module>console</module>
     <module>enduser</module>
     <module>sra</module>
+    <module>wa</module>
     <module>fit</module>
   </modules>
 
diff --git a/core/idrepo/logic/pom.xml b/core/idrepo/logic/pom.xml
index 67df68e..cfc1aac 100644
--- a/core/idrepo/logic/pom.xml
+++ b/core/idrepo/logic/pom.xml
@@ -70,14 +70,6 @@ under the License.
       <groupId>org.apache.xmlgraphics</groupId>
       <artifactId>fop</artifactId>
     </dependency>
-    <dependency>
-      <groupId>org.apache.xmlgraphics</groupId>
-      <artifactId>batik-i18n</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.xmlgraphics</groupId>
-      <artifactId>batik-constants</artifactId>
-    </dependency>
 
     <dependency>
       <groupId>org.apache.logging.log4j</groupId>
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/ReportITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/ReportITCase.java
index 918175c..ab9e35e 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/ReportITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/ReportITCase.java
@@ -238,8 +238,7 @@ public class ReportITCase extends AbstractITCase {
         assertNotNull(response);
         assertEquals(Response.Status.OK.getStatusCode(), response.getStatusInfo().getStatusCode());
         assertNotNull(response.getHeaderString(HttpHeaders.CONTENT_DISPOSITION));
-        assertTrue(response.getHeaderString(HttpHeaders.CONTENT_DISPOSITION).
-                endsWith('.' + fmt.name().toLowerCase()));
+        assertTrue(response.getHeaderString(HttpHeaders.CONTENT_DISPOSITION).endsWith('.' + fmt.name().toLowerCase()));
 
         Object entity = response.getEntity();
         assertTrue(entity instanceof InputStream);
@@ -249,7 +248,6 @@ public class ReportITCase extends AbstractITCase {
     @Test
     public void executeAndExport() throws IOException {
         ReportTO reportTO = reportService.read("0062ea9c-924d-4ecf-9961-4492a8cc6d1b");
-        reportTO.setKey(null);
         reportTO.setName("executeAndExport" + getUUIDString());
         reportTO.setActive(false);
         reportTO.getExecutions().clear();
@@ -282,10 +280,10 @@ public class ReportITCase extends AbstractITCase {
         try {
             Thread.sleep(1000);
         } catch (InterruptedException e) {
+            // ignore
         }
 
         ReportTO reportTO = reportService.read("0062ea9c-924d-4ecf-9961-4492a8cc6d1b");
-        reportTO.setKey(null);
         reportTO.setName("deleteExecutions" + getUUIDString());
         reportTO.getExecutions().clear();
         reportTO = createReport(reportTO);
@@ -379,7 +377,6 @@ public class ReportITCase extends AbstractITCase {
     public void issueSYNCOPE102() throws IOException {
         // Create
         ReportTO reportTO = reportService.read("0062ea9c-924d-4ecf-9961-4492a8cc6d1b");
-        reportTO.setKey(null);
         reportTO.setName("issueSYNCOPE102" + getUUIDString());
         reportTO = createReport(reportTO);
         assertNotNull(reportTO);
diff --git a/pom.xml b/pom.xml
index bfc1ce0..81ff696 100644
--- a/pom.xml
+++ b/pom.xml
@@ -422,7 +422,6 @@ under the License.
     <quartz.version>2.3.2</quartz.version>
 
     <cocoon.version>3.0.0-alpha-3</cocoon.version>
-    <batik.version>1.12</batik.version>
 
     <groovy.version>3.0.1</groovy.version>
 
@@ -1377,37 +1376,11 @@ under the License.
             <artifactId>xalan</artifactId>
           </exclusion>
           <exclusion>
-            <groupId>org.apache.xmlgraphics</groupId>
-            <artifactId>batik-svg-dom</artifactId>
-          </exclusion>
-          <exclusion>
-            <groupId>org.apache.xmlgraphics</groupId>
-            <artifactId>batik-bridge</artifactId>
-          </exclusion>
-          <exclusion>
-            <groupId>org.apache.xmlgraphics</groupId>
-            <artifactId>batik-transcoder</artifactId>
-          </exclusion>
-          <exclusion>
-            <groupId>org.apache.xmlgraphics</groupId>
-            <artifactId>batik-extension</artifactId>
-          </exclusion>
-          <exclusion>
             <groupId>javax.servlet</groupId>
             <artifactId>servlet-api</artifactId>
           </exclusion>
         </exclusions>
       </dependency>
-      <dependency>
-        <groupId>org.apache.xmlgraphics</groupId>
-        <artifactId>batik-i18n</artifactId>
-        <version>${batik.version}</version>
-      </dependency>
-      <dependency>
-        <groupId>org.apache.xmlgraphics</groupId>
-        <artifactId>batik-constants</artifactId>
-        <version>${batik.version}</version>
-      </dependency>
 
       <!-- Flowable -->
       <dependency>
@@ -2126,12 +2099,6 @@ under the License.
         </plugin>
 
         <plugin>
-          <groupId>org.codehaus.mojo</groupId>
-          <artifactId>properties-maven-plugin</artifactId>
-          <version>1.0.0</version>
-        </plugin>
-
-        <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-resources-plugin</artifactId>
           <version>3.1.0</version>
diff --git a/wa/pom.xml b/wa/pom.xml
index fe7a713..b733af1 100644
--- a/wa/pom.xml
+++ b/wa/pom.xml
@@ -179,6 +179,7 @@ under the License.
       <groupId>org.apereo.cas</groupId>
       <artifactId>cas-server-webapp-config</artifactId>
     </dependency>
+
     <dependency>
       <groupId>org.springframework.boot</groupId>
       <artifactId>spring-boot-starter-web</artifactId>