From a2e7f907c89b11ad6ed9a90b48df17c9377b1379 Mon Sep 17 00:00:00 2001
From: Catalin-Emanuel ENACHE <Catalin-Emanuel.ENACHE@ext.ec.europa.eu>
Date: Wed, 7 Feb 2018 14:24:42 +0100
Subject: [PATCH] [EDELIVERY-3114] changes as per pull request

---
 README.md              | 20 ++++++++++++++++++++
 deploy_war.sh          |  2 +-
 pom.xml                | 17 ++++++++++++++---
 smp-api/pom.xml        |  7 ++++++-
 smp-parent-pom/pom.xml |  3 ---
 5 files changed, 41 insertions(+), 8 deletions(-)

diff --git a/README.md b/README.md
index 01c3d45e3..39fdc0490 100644
--- a/README.md
+++ b/README.md
@@ -23,3 +23,23 @@ Any remote DB with preconfigured schema might be used as well. Sample build comm
 ## Source code history
 This is a continuation of CIPA SMP Joinup repository, which was migrated here to GIT on 07.12.2016:
 [https://joinup.ec.europa.eu/svn/cipaedelivery/trunk]
+
+## To run with SoapUI code coverage (from Bamboo, etc)
+Step 1:
+
+mvn clean install -Prun-soapui -Pdeploy-war
+    -Djdbc.driver=oracle.jdbc.OracleDriver
+    -Djdbc.url=jdbc:oracle:thin:<HOST_AND_PORT_AND_SERVICENAME>
+    -Djdbc.user=<USERNAME>
+    "-Djdbc.password=<PASSWORD>"
+    -Dtarget-database=Oracle
+    -DjacocoRemotePort=65000
+    -DjacocoRemoteAddress=localhost
+    "-Durl=http://localhost:7001/smp"
+    -DdeployWarFolder=/home/edelivery/oracle/middleware/domains/bdmsl/autodeploy/
+
+Step 2:
+
+mvn sonar:sonar
+
+
diff --git a/deploy_war.sh b/deploy_war.sh
index 347227c43..2dabd3de3 100644
--- a/deploy_war.sh
+++ b/deploy_war.sh
@@ -1,2 +1,2 @@
-cp smp-webapp/target/smp.war /home/edelivery/oracle/middleware/domains/bdmsl/autodeploy/
+cp smp-webapp/target/smp.war $DEPLOY_FOLDER
 sleep 3m
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 783ec37d5..f7c57686c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -31,14 +31,20 @@
     <properties>
         <sonar.host.url>http://edelquality.westeurope.cloudapp.azure.com:9000/sonar/</sonar.host.url>
         <sonar.exclusions>**/smp/data/model/*, **/smp/exceptions/*, **/to_be_removed/*</sonar.exclusions>
+        <jacoco.maven.plugin.version>0.7.9</jacoco.maven.plugin.version>
 
-        <sonar.ws.timeout>300</sonar.ws.timeout>
-        <sonar.login>1659ebb88e2d1a896bfd56e835358c06418219c3</sonar.login>
+        <!-- jacoco remote agent settings start -->
         <sonar.jacoco.remotePort>${jacocoRemotePort}</sonar.jacoco.remotePort>
         <sonar.jacoco.remoteAddress>${jacocoRemoteAddress}</sonar.jacoco.remoteAddress>
-        <jacoco.maven.plugin.version>0.7.9</jacoco.maven.plugin.version>
+        <!-- jacoco remote agent settings end -->
+
+        <!-- jacoco, sonar code coverage settings start -->
         <sonar.jacoco.codeCoveragePath>${maven.multiModuleProjectDirectory}/code-coverage</sonar.jacoco.codeCoveragePath>
         <sonar.jacoco.reportPath>${sonar.jacoco.codeCoveragePath}/jacoco-ut.exec</sonar.jacoco.reportPath>
+        <!-- jacoco, sonar code coverage settings start -->
+
+        <!-- default value for deploy under Weblogic, etc -->
+        <deployWarFolder>/home/edelivery/oracle/middleware/domains/bdmsl/autodeploy/</deployWarFolder>
     </properties>
 
 
@@ -143,6 +149,11 @@
                                     <goal>exec</goal>
                                 </goals>
                                 <configuration>
+                                    <environmentVariables>
+                                        <DEPLOY_FOLDER>
+                                            ${deployWarFolder}
+                                        </DEPLOY_FOLDER>
+                                    </environmentVariables>
                                     <executable>bash</executable>
                                     <commandlineArgs>deploy_war.sh</commandlineArgs>
                                 </configuration>
diff --git a/smp-api/pom.xml b/smp-api/pom.xml
index b3cde7b82..65e143d17 100644
--- a/smp-api/pom.xml
+++ b/smp-api/pom.xml
@@ -80,7 +80,12 @@
                 </configuration>
             </plugin>
 
-            <!-- just clean code coverage folder before collecting any information-->
+            <!-- just clean code coverage folder before collecting any information.
+            placed in this module as is the first in maven reactor order to collect info
+            about code coverage.
+            do not move this to parent pom or root pom!
+            for Pawel to know after years ;)
+            -->
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-clean-plugin</artifactId>
diff --git a/smp-parent-pom/pom.xml b/smp-parent-pom/pom.xml
index 0c8bba7e0..85ff9c41b 100644
--- a/smp-parent-pom/pom.xml
+++ b/smp-parent-pom/pom.xml
@@ -93,7 +93,6 @@
 		<xmlunit.version>2.5.1</xmlunit.version>
 		<hamcrest.version>2.0.0.0</hamcrest.version>
 
-
         <sonar.jacoco.reportPath>${maven.multiModuleProjectDirectory}/code-coverage/jacoco-ut.exec</sonar.jacoco.reportPath>
         <sonar.jacoco.itReportPath>${maven.multiModuleProjectDirectory}/code-coverage/jacoco-it.exec</sonar.jacoco.itReportPath>
         <jacoco.maven.plugin.version>0.7.9</jacoco.maven.plugin.version>
@@ -635,8 +634,6 @@
 				</configuration>
 			</plugin>
 
-
-            <!-- catalin -->
             <!-- unit tests, surefire plugin -->
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
-- 
GitLab