Files
2025-06-06 09:15:13 +02:00

227 lines
8.3 KiB
XML

<?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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.itac.interface.interfaces</groupId>
<artifactId>imsinterfaces-commonsmt-dotnetplugin</artifactId>
<packaging>pom</packaging>
<name>imsinterfaces-commonsmt-dotnetplugin</name>
<version>${mes.interface.version}</version>
<parent>
<groupId>com.itac.interface.interfaces</groupId>
<artifactId>imsinterfaces-commonsmt</artifactId>
<version>${mes.interface.version}</version>
</parent>
<properties>
<projectname>${job.name}</projectname>
<artes.lib.name>artes-dotnet.dll</artes.lib.name>
<dotnet.build.dir>${dotnet.build.basedir}/${project.artifactId}/${user.name}/${projectname}</dotnet.build.dir>
<dotnet.framework.version>v3.5</dotnet.framework.version>
<dotnet4.framework.version>v4.0.30319</dotnet4.framework.version>
<timestamp>${maven.build.timestamp}</timestamp>
</properties>
<dependencies>
<dependency>
<groupId>com.itac.product</groupId>
<artifactId>artes-dotnet</artifactId>
<classifier>net4</classifier>
<type>zip</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.itac.interface.commonsmt</groupId>
<artifactId>commonsmt-dotnet-api</artifactId>
<classifier>windows</classifier>
<type>zip</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.itac.product</groupId>
<artifactId>artes-common</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<!--
Step 1:
die artes-dontnet.zip (aus dem Repository) entpacken und ins lokale Plugin-Verzeichnis kopieren -->
<id>copy-dotnet-dependencies</id>
<phase>generate-sources</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>com.itac.product</groupId>
<artifactId>artes-dotnet</artifactId>
<type>zip</type>
<classifier>net4</classifier>
<overWrite>true</overWrite>
<outputDirectory>${project.basedir}/Plugin/lib</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
<execution>
<!--
Step 1:
die artes-dontnet.zip (aus dem Repository) entpacken und ins lokale Plugin-Verzeichnis kopieren -->
<id>copy-commonsmt-api</id>
<phase>generate-sources</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>com.itac.interface.commonsmt</groupId>
<artifactId>commonsmt-dotnet-api</artifactId>
<classifier>windows</classifier>
<version>${commonsmt.version}</version>
<type>zip</type>
<overWrite>true</overWrite>
<outputDirectory>${project.basedir}/Plugin/lib</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>create-demo-source-bundle</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<finalName>DemoApplication</finalName>
<descriptor>${project.basedir}/src/main/assembly/sourcesDistribution.xml</descriptor>
</configuration>
</execution>
<!--
Step 2:
zusammenpacken aller source-Files, Properties, libs in ein Zip
Dieses wird dann per SCP auf die windows Maschien kopiert -->
<execution>
<id>create-project-sources-bundle</id>
<phase>process-resources</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<finalName>dotnet</finalName>
<descriptor>${project.basedir}/src/main/assembly/sources.xml</descriptor>
</configuration>
</execution>
<!-- Step 5
zusammenpacken des Ergebnisses in ein einziges zip; da ist das gesamte Projekt drin-->
<execution>
<id>pack-bundle</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>${project.basedir}/src/main/assembly/descriptor.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.itac.tools</groupId>
<artifactId>ssh-plugin</artifactId>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>ssh</goal>
</goals>
</execution>
</executions>
<configuration>
<parallel>true</parallel>
<remoteHosts>
<RemoteHost>
<host>${dotnet.build.host}</host>
<user>${dotnet.build.user}</user>
<password>${dotnet.build.pw}</password>
<commands>
<ExecuteCommand>
<order>1</order>
<arg>cd ${dotnet.build.basedir};
rm -rf ${project.artifactId}/${user.name}/${projectname};
mkdir ${project.artifactId};
cd ${project.artifactId};
mkdir ${user.name};
cd ${user.name};
mkdir ${projectname};
cd ${projectname};
</arg>
</ExecuteCommand>
<PutCommand>
<order>2</order>
<remoteDirectory>${dotnet.build.dir}/</remoteDirectory>
<localFiles>
<param>${project.basedir}/target/dotnet-buildsources.zip</param>
</localFiles>
</PutCommand>
<!-- Step 3:
Entpacken des Source-Folders auf der Windows-Build-Maschine -->
<ExecuteCommand>
<order>10</order>
<arg>cd ${dotnet.build.dir} &amp;&amp;unzip -q dotnet-buildsources.zip;
</arg>
</ExecuteCommand>
<!-- Step 4:
starten des msBuild-Vorgangs -->
<ExecuteCommand>
<order>40</order>
<arg>cd ${dotnet.build.dir} &amp;&amp;${dotnet.build.framework.dir}/${dotnet4.framework.version}/msbuild.exe;
</arg>
</ExecuteCommand>
<!-- Step 5:
compiled files lokal kopieren -->
<GetCommand>
<order>50</order>
<localDirectory>${project.build.directory}</localDirectory>
<remoteFiles>
<param>${dotnet.build.dir}/Plugin/bin/debug/CommonSmtPlugin.dll</param>
<param>${dotnet.build.dir}/DemoApplication/bin/debug/DemoApplication.exe</param>
<param>${dotnet.build.dir}/DemoApplication/bin/debug/DemoApplication.exe.config</param>
</remoteFiles>
</GetCommand>
</commands>
</RemoteHost>
</remoteHosts>
</configuration>
</plugin>
</plugins>
</build>
</project>