From cbc515403e66426efbd7065ce64334a745d9bfa1 Mon Sep 17 00:00:00 2001
From: Joze RIHTARSIC <joze.RIHTARSIC@ext.ec.europa.eu>
Date: Wed, 1 Jun 2022 12:55:19 +0200
Subject: [PATCH] add wls deployment module

---
 .../smp/validation/ServiceGroupValidator.java |  2 +-
 smp-wls-deploy/assembly.xml                   | 21 +++++
 smp-wls-deploy/pom.xml                        | 77 +++++++++++++++++++
 smp-wls-deploy/src/main/resources/pom.xml     | 38 +++++++++
 4 files changed, 137 insertions(+), 1 deletion(-)
 create mode 100644 smp-wls-deploy/assembly.xml
 create mode 100644 smp-wls-deploy/pom.xml
 create mode 100644 smp-wls-deploy/src/main/resources/pom.xml

diff --git a/smp-webapp/src/main/java/eu/europa/ec/edelivery/smp/validation/ServiceGroupValidator.java b/smp-webapp/src/main/java/eu/europa/ec/edelivery/smp/validation/ServiceGroupValidator.java
index 0f898f9f6..bbde9c3f1 100644
--- a/smp-webapp/src/main/java/eu/europa/ec/edelivery/smp/validation/ServiceGroupValidator.java
+++ b/smp-webapp/src/main/java/eu/europa/ec/edelivery/smp/validation/ServiceGroupValidator.java
@@ -50,7 +50,7 @@ public class ServiceGroupValidator {
         boolean schemeMandatory = configurationService.getParticipantSchemeMandatory();
         LOG.debug("Parse service group [{}] with [{}] scheme", serviceGroupId, (schemeMandatory?"mandatory":"optional"));
 
-        final ParticipantIdentifierType participantId = caseSensitivityNormalizer.normalize(Identifiers.asParticipantId(serviceGroupId, schemeMandatory));
+        final ParticipantIdentifierType participantId = caseSensitivityNormalizer.normalize(Identifiers.asParticipantId(serviceGroupId, schemeMandatory), schemeMandatory);
         final ParticipantIdentifierType serviceGroupParticipantId =  caseSensitivityNormalizer.normalize(
                 serviceGroup.getParticipantIdentifier(), schemeMandatory);
 
diff --git a/smp-wls-deploy/assembly.xml b/smp-wls-deploy/assembly.xml
new file mode 100644
index 000000000..2735d044a
--- /dev/null
+++ b/smp-wls-deploy/assembly.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+<assembly>
+    <id>bundle</id>
+    <formats>
+        <format>zip</format>
+    </formats>
+     <files>
+        <file>
+            <source>${project.basedir}/../smp-webapp/target/smp.war</source>
+            <outputDirectory></outputDirectory>
+            <destName>smp.war</destName>
+            <filtered>false</filtered>
+        </file>
+         <file>
+             <source>${project.basedir}/target/pom.xml</source>
+             <outputDirectory></outputDirectory>
+             <filtered>false</filtered>
+         </file>
+    </files>
+</assembly>
+
diff --git a/smp-wls-deploy/pom.xml b/smp-wls-deploy/pom.xml
new file mode 100644
index 000000000..a634b415d
--- /dev/null
+++ b/smp-wls-deploy/pom.xml
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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>eu.europa.ec.edelivery</groupId>
+        <artifactId>smp-modules</artifactId>
+        <version>4.2-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+    <artifactId>smp-wls-deploy</artifactId>
+    <name>smp-wls-deploy</name>
+    <packaging>pom</packaging>
+    <licenses>
+        <license>
+            <name>EUPL-1.2</name>
+            <url>https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12</url>
+        </license>
+    </licenses>
+    <distributionManagement>
+        <repository>
+            <id>wls-deploy-releases</id>
+            <url>${deploy-repository}</url>
+        </repository>
+        <snapshotRepository>
+            <id>wls-deploy-snapshots</id>
+            <url>${deploy-repository-snapshot}</url>
+        </snapshotRepository>
+    </distributionManagement>
+    <build>
+        <!-- Enable the filtering. Maven will map the ${} in resources/db.properties with the active Maven profile properties.
+      map ${} variables to source code -->
+
+        <plugins>
+            <plugin>
+                <artifactId>maven-resources-plugin</artifactId>
+                <configuration>
+                    <escapeString>\</escapeString>
+                </configuration>
+                <executions>
+                    <execution>
+                        <id>copy-resources</id>
+                        <phase>prepare-package</phase>
+                        <goals>
+                            <goal>copy-resources</goal>
+                        </goals>
+                        <configuration>
+                            <outputDirectory>target</outputDirectory>
+                            <resources>
+                                <resource>
+                                    <directory>src/main/resources</directory>
+                                    <filtering>true</filtering>
+                                </resource>
+                            </resources>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <artifactId>maven-assembly-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>create-deploy-assembly</id>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>single</goal>
+                        </goals>
+                        <configuration>
+                            <descriptors>
+                                <descriptor>assembly.xml</descriptor>
+                            </descriptors>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</project>
\ No newline at end of file
diff --git a/smp-wls-deploy/src/main/resources/pom.xml b/smp-wls-deploy/src/main/resources/pom.xml
new file mode 100644
index 000000000..58168a3f3
--- /dev/null
+++ b/smp-wls-deploy/src/main/resources/pom.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<project xmlns="http://maven.apache.org/POM/4.0.0">
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>eu.europa.ec.edelivery</groupId>
+    <artifactId>smp</artifactId>
+    <version>${project.version}</version>
+    <name>smp</name>
+    <packaging>pom</packaging>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>com.oracle.weblogic</groupId>
+                <artifactId>weblogic-maven-plugin</artifactId>
+                <version>12.2.1-4-0</version>
+                <configuration>
+                    <adminurl>\${oracleServerUrl}</adminurl>
+                    <user>\${oracleUsername}</user>
+                    <password>\${oraclePassword}</password>
+                    <userConfigFile>\${userConfigFile}</userConfigFile>
+                    <userKeyFile>\${userKeyFile}</userKeyFile>
+                    <source>\${project.basedir}/smp.war</source>
+                    <targets>\${oracleServerName}</targets>
+                    <verbose>true</verbose>
+                    <name>\${project.name}</name>
+                    <upload>true</upload>
+                </configuration>
+                <executions>
+                    <execution>
+                        <phase>pre-integration-test</phase>
+                        <goals>
+                            <goal>redeploy</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</project>
-- 
GitLab