From 96587c8f2e3282562fef2c0ae7b55188b88c518c Mon Sep 17 00:00:00 2001
From: OZGCloud <ozgcloud@mgm-tp.com>
Date: Wed, 4 Jan 2023 12:02:23 +0100
Subject: [PATCH] OZG-3284 move command code to own module

---
 Jenkinsfile                                   | 26 +-----
 mail-service/pom.xml                          |  7 +-
 notification-manager/pom.xml                  |  8 +-
 .../lombok.config                             |  0
 pluto-command/pom.xml                         | 32 ++++++++
 .../de/itvsh/ozg/pluto/command/Command.java   |  0
 .../pluto/command/CommandCreatedEvent.java    |  0
 .../pluto/command/CommandExecutedEvent.java   |  0
 .../ozg/pluto/command/CommandFailedEvent.java |  0
 .../ozg/pluto/command/CommandStatus.java      |  0
 .../pluto/command/VorgangCreatedEvent.java    |  0
 pluto-interface/pom.xml                       | 80 ++++---------------
 pluto-server/pom.xml                          |  2 +-
 pluto-utils/pom.xml                           |  1 +
 pom.xml                                       |  3 +-
 15 files changed, 66 insertions(+), 93 deletions(-)
 rename {pluto-interface => pluto-command}/lombok.config (100%)
 create mode 100644 pluto-command/pom.xml
 rename {pluto-interface => pluto-command}/src/main/java/de/itvsh/ozg/pluto/command/Command.java (100%)
 rename {pluto-interface => pluto-command}/src/main/java/de/itvsh/ozg/pluto/command/CommandCreatedEvent.java (100%)
 rename {pluto-interface => pluto-command}/src/main/java/de/itvsh/ozg/pluto/command/CommandExecutedEvent.java (100%)
 rename {pluto-interface => pluto-command}/src/main/java/de/itvsh/ozg/pluto/command/CommandFailedEvent.java (100%)
 rename {pluto-interface => pluto-command}/src/main/java/de/itvsh/ozg/pluto/command/CommandStatus.java (100%)
 rename {pluto-interface => pluto-command}/src/main/java/de/itvsh/ozg/pluto/command/VorgangCreatedEvent.java (100%)

diff --git a/Jenkinsfile b/Jenkinsfile
index d59a60b30..39582d834 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -74,31 +74,7 @@ pipeline {
             }
         }
 
-	stage('Build protobuf sources') {
-	    when {
-                anyOf {
-                    branch 'master'
-                    branch 'release'
-                }
-            }
-            steps {
-                dir('pluto-interface') {
-                    script {
-                    	FAILED_STAGE = env.STAGE_NAME
-                	}
-                	configFileProvider([configFile(fileId: 'maven-settings', variable: 'MAVEN_SETTINGS')]) {
-                    	sh 'mvn -s $MAVEN_SETTINGS -P proto-sources -DskipTests clean deploy -Dmaven.wagon.http.retryHandler.count=3'
-                	}
-                }
-
-            }
-
-	                          
-	                          
-      }
-
-       
-        stage('Build Docker image') {
+	   stage('Build Docker image') {
           steps {
                 script {
                     FAILED_STAGE=env.STAGE_NAME
diff --git a/mail-service/pom.xml b/mail-service/pom.xml
index 3207e9b6a..75b2727ec 100644
--- a/mail-service/pom.xml
+++ b/mail-service/pom.xml
@@ -36,7 +36,7 @@
 
 	<groupId>de.itvsh.ozg.mail</groupId>
 	<artifactId>mail-service</artifactId>
-	<version>1.3.0</version>
+	<version>1.3.1-SNAPSHOT</version>
 	<name>KOP Vorgang Manager Mail Service</name>
 
 	<properties>
@@ -53,6 +53,11 @@
 			<artifactId>pluto-interface</artifactId>
 			<version>${project.version}</version>
 		</dependency>
+		<dependency>
+			<groupId>de.itvsh.ozg.pluto</groupId>
+			<artifactId>pluto-command</artifactId>
+			<version>${project.version}</version>
+		</dependency>
 
 		<dependency>
 			<groupId>org.springframework.boot</groupId>
diff --git a/notification-manager/pom.xml b/notification-manager/pom.xml
index 7e6d2eeff..959d58a31 100644
--- a/notification-manager/pom.xml
+++ b/notification-manager/pom.xml
@@ -37,7 +37,7 @@
 	<artifactId>notification-manager</artifactId>
 
 	<name>KOP Notification Manager</name>
-	<version>1.3.0</version>
+	<version>1.3.1-SNAPSHOT</version>
 
 	<properties>
 		<user-manager-interface.version>1.1.0</user-manager-interface.version>
@@ -55,6 +55,12 @@
 			<artifactId>pluto-utils</artifactId>
 			<version>${project.version}</version>
 		</dependency>
+		<dependency>
+			<groupId>de.itvsh.ozg.pluto</groupId>
+			<artifactId>pluto-command</artifactId>
+			<version>${project.version}</version>
+		</dependency>
+		
 		<dependency>
 			<groupId>de.itvsh.kop.user</groupId>
 			<artifactId>user-manager-interface</artifactId>
diff --git a/pluto-interface/lombok.config b/pluto-command/lombok.config
similarity index 100%
rename from pluto-interface/lombok.config
rename to pluto-command/lombok.config
diff --git a/pluto-command/pom.xml b/pluto-command/pom.xml
new file mode 100644
index 000000000..5f6b07574
--- /dev/null
+++ b/pluto-command/pom.xml
@@ -0,0 +1,32 @@
+<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<groupId>de.itvsh.kop.common</groupId>
+		<artifactId>kop-common-dependencies</artifactId>
+		<version>1.4.1</version>
+		<relativePath/>
+	</parent>
+	
+	<groupId>de.itvsh.ozg.pluto</groupId>
+	<artifactId>pluto-command</artifactId>
+	<name>Command Manager</name>
+	<version>1.3.1-SNAPSHOT</version>
+	
+	<dependencies>
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>spring-context</artifactId>
+		</dependency>
+
+		<dependency>
+			<groupId>de.itvsh.kop.common</groupId>
+			<artifactId>kop-common-lib</artifactId>
+		</dependency>
+
+		<dependency>
+			<groupId>org.projectlombok</groupId>
+			<artifactId>lombok</artifactId>
+			<optional>true</optional>
+		</dependency>
+	</dependencies>
+</project>
\ No newline at end of file
diff --git a/pluto-interface/src/main/java/de/itvsh/ozg/pluto/command/Command.java b/pluto-command/src/main/java/de/itvsh/ozg/pluto/command/Command.java
similarity index 100%
rename from pluto-interface/src/main/java/de/itvsh/ozg/pluto/command/Command.java
rename to pluto-command/src/main/java/de/itvsh/ozg/pluto/command/Command.java
diff --git a/pluto-interface/src/main/java/de/itvsh/ozg/pluto/command/CommandCreatedEvent.java b/pluto-command/src/main/java/de/itvsh/ozg/pluto/command/CommandCreatedEvent.java
similarity index 100%
rename from pluto-interface/src/main/java/de/itvsh/ozg/pluto/command/CommandCreatedEvent.java
rename to pluto-command/src/main/java/de/itvsh/ozg/pluto/command/CommandCreatedEvent.java
diff --git a/pluto-interface/src/main/java/de/itvsh/ozg/pluto/command/CommandExecutedEvent.java b/pluto-command/src/main/java/de/itvsh/ozg/pluto/command/CommandExecutedEvent.java
similarity index 100%
rename from pluto-interface/src/main/java/de/itvsh/ozg/pluto/command/CommandExecutedEvent.java
rename to pluto-command/src/main/java/de/itvsh/ozg/pluto/command/CommandExecutedEvent.java
diff --git a/pluto-interface/src/main/java/de/itvsh/ozg/pluto/command/CommandFailedEvent.java b/pluto-command/src/main/java/de/itvsh/ozg/pluto/command/CommandFailedEvent.java
similarity index 100%
rename from pluto-interface/src/main/java/de/itvsh/ozg/pluto/command/CommandFailedEvent.java
rename to pluto-command/src/main/java/de/itvsh/ozg/pluto/command/CommandFailedEvent.java
diff --git a/pluto-interface/src/main/java/de/itvsh/ozg/pluto/command/CommandStatus.java b/pluto-command/src/main/java/de/itvsh/ozg/pluto/command/CommandStatus.java
similarity index 100%
rename from pluto-interface/src/main/java/de/itvsh/ozg/pluto/command/CommandStatus.java
rename to pluto-command/src/main/java/de/itvsh/ozg/pluto/command/CommandStatus.java
diff --git a/pluto-interface/src/main/java/de/itvsh/ozg/pluto/command/VorgangCreatedEvent.java b/pluto-command/src/main/java/de/itvsh/ozg/pluto/command/VorgangCreatedEvent.java
similarity index 100%
rename from pluto-interface/src/main/java/de/itvsh/ozg/pluto/command/VorgangCreatedEvent.java
rename to pluto-command/src/main/java/de/itvsh/ozg/pluto/command/VorgangCreatedEvent.java
diff --git a/pluto-interface/pom.xml b/pluto-interface/pom.xml
index c4654497f..84c7423e6 100644
--- a/pluto-interface/pom.xml
+++ b/pluto-interface/pom.xml
@@ -30,13 +30,13 @@
 	<parent>
 		<groupId>de.itvsh.kop.common</groupId>
 		<artifactId>kop-common-dependencies</artifactId>
-		<version>1.3.0</version>
+		<version>1.4.1</version>
 		<relativePath />
 	</parent>
 
 	<groupId>de.itvsh.ozg.pluto</groupId>
 	<artifactId>pluto-interface</artifactId>
-	<version>1.3.0</version>
+	<version>1.3.1-SNAPSHOT</version>
 
 	<name>KOP Vorgang Manager gRPC Interface</name>
 	<description>Interface (gRPC) for Pluto Server</description>
@@ -50,8 +50,6 @@
 		<maven.compiler.target>${java.version}</maven.compiler.target>
 
 		<kop.license.version>1.3.0</kop.license.version>
-
-		<src.dir>src/main/java</src.dir>
 	</properties>
 
 	<dependencyManagement>
@@ -67,22 +65,6 @@
 	</dependencyManagement>
 
 	<dependencies>
-		<dependency>
-			<groupId>org.springframework</groupId>
-			<artifactId>spring-context</artifactId>
-		</dependency>
-
-		<dependency>
-			<groupId>de.itvsh.kop.common</groupId>
-			<artifactId>kop-common-lib</artifactId>
-		</dependency>
-
-		<dependency>
-			<groupId>org.projectlombok</groupId>
-			<artifactId>lombok</artifactId>
-			<optional>true</optional>
-		</dependency>
-
 		<!-- GRPC -->
 		<dependency>
 			<groupId>io.grpc</groupId>
@@ -103,7 +85,7 @@
 	</dependencies>
 
 	<build>
-		<sourceDirectory>${src.dir}</sourceDirectory>
+		<sourceDirectory>src/main/protobuf</sourceDirectory>
 
 		<extensions>
 			<extension>
@@ -141,7 +123,6 @@
 			<plugin>
 				<groupId>com.mycila</groupId>
 				<artifactId>license-maven-plugin</artifactId>
-				<version>4.1</version>
 				<configuration>
 					<mapping>
 						<proto>SLASHSTAR_STYLE</proto>
@@ -167,51 +148,22 @@
 				</dependencies>
 			</plugin>
 
-
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-source-plugin</artifactId>
+				<version>3.2.1</version>
+				<executions>
+					<execution>
+						<id>attach-sources</id>
+						<goals>
+							<goal>jar</goal>
+						</goals>
+					</execution>
+				</executions>
+			</plugin>
 		</plugins>
 	</build>
 
-	<profiles>
-		<profile>
-			<id>proto-sources</id>
-			<properties>
-				<src.dir>src/main/protobuf</src.dir>
-			</properties>
-			<build>
-				<plugins>
-					<plugin>
-						<groupId>org.apache.maven.plugins</groupId>
-						<artifactId>maven-jar-plugin</artifactId>
-						<executions>
-							<execution>
-								<id>default-jar</id>
-								<phase>none</phase>
-							</execution>
-						</executions>
-					</plugin>
-					<plugin>
-						<groupId>org.apache.maven.plugins</groupId>
-						<artifactId>maven-source-plugin</artifactId>
-						<version>3.2.1</version>
-						<executions>
-							<execution>
-								<id>attach-sources</id>
-								<goals>
-									<goal>jar</goal>
-								</goals>
-							</execution>
-						</executions>
-
-						<configuration>
-							<includes>*.proto</includes>
-							<finalName>pluto-protobuf-interface-${project.version}</finalName>
-						</configuration>
-					</plugin>
-				</plugins>
-			</build>
-		</profile>
-	</profiles>
-
 	<distributionManagement>
 		<repository>
 			<id>ozg-nexus</id>
diff --git a/pluto-server/pom.xml b/pluto-server/pom.xml
index cd444b75a..0178e2dae 100644
--- a/pluto-server/pom.xml
+++ b/pluto-server/pom.xml
@@ -36,7 +36,7 @@
 
 	<groupId>de.itvsh.ozg.pluto</groupId>
 	<artifactId>pluto-server</artifactId>
-	<version>1.3.0</version>
+	<version>1.3.1-SNAPSHOT</version>
 
 	<name>KOP Vorgang Manager (Pluto) Server</name>
 	<description>Server Implementierung des VorgangManagers (Pluto)</description>
diff --git a/pluto-utils/pom.xml b/pluto-utils/pom.xml
index 2a92ff654..c580c28ad 100644
--- a/pluto-utils/pom.xml
+++ b/pluto-utils/pom.xml
@@ -37,6 +37,7 @@
 	<groupId>de.itvsh.ozg.pluto</groupId>
 	<artifactId>pluto-utils</artifactId>
 	<name>KOP Vorgang Manager (Pluto) Utils</name>
+	<version>1.3.1-SNAPSHOT</version>
 
 	<properties>
 		<pluto.version>1.3.0</pluto.version>
diff --git a/pom.xml b/pom.xml
index fc1df09f5..0fbb7d3ea 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,7 +29,7 @@
 	<modelVersion>4.0.0</modelVersion>
 	<groupId>de.itvsh.ozg</groupId>
 	<artifactId>pluto</artifactId>
-	<version>1.3.0</version>
+	<version>1.3.1-SNAPSHOT</version>
 
 	<name>Pluto Parent</name>
 	<packaging>pom</packaging>
@@ -44,6 +44,7 @@
 		<module>mail-service</module>
 		<module>pluto-utils</module>
 		<module>notification-manager</module>
+		<module>pluto-command</module>
 	</modules>
 
 	<build>
-- 
GitLab