Hallo Martin,
danke für deine Antwort.
Bezgl. des Vorgehens zum Zurücksetzen des Entwicklungssystems auf einen Release Stand sind wir wegen den Unwägbarkeiten beim DB-Schema / Referenzen auf Templates erst Mal davon abgekommen. Wir werden jetzt noch mal den von E-Spirit vorgeschlagenen Weg der verteilten Entwicklung für uns prüfen.
Zum Maven Profil kann ich sagen das wir da kein Plugin entwickeln werden. Ich beschreibe hier noch mal kurz wie wir das aktuell umgesetzt haben:
0. fs-cli in der benötigten Version von Github holen und im internen Maven Repository ablegen, das gleiche gilt für fs-access.jar
1. Im Maven Multi-Module Build gibt es ein eigenes Maven Modul für die fs-templates (Ablage der Templates unter src/main/resources/firstspirit)
2a. Die Konfiguration der Pfade erfolgt in der POM:
<fsdevtools.basepath>${project.build.directory}\fs-cli</fsdevtools.basepath>
<fsdevtools.execpath>${fsdevtools.basepath}\bin</fsdevtools.execpath>
<fsdevtools.libpath>${fsdevtools.basepath}\lib</fsdevtools.libpath>
<fsdevtools.confpath>${fsdevtools.basepath}\conf</fsdevtools.confpath>
<fsdevtools.executable>fs-cli.cmd</fsdevtools.executable>
<fsdevtools.exportsyncpath>${project.basedir}\src\main\resources\firstspirit</fsdevtools.exportsyncpath>
<fsdevtools.importsyncpath>${project.build.directory}\import\firstspirit</fsdevtools.importsyncpath>
<fsdevtools.exportcommand>export</fsdevtools.exportcommand>
<fsdevtools.importcommand>import</fsdevtools.importcommand>
<fsdevtools.testcommand>test</fsdevtools.testcommand>
<fsdevtools.store>templatestore</fsdevtools.store>
<!-- fs environment config path-->
<fs.configpath>${project.basedir}\src\main\resources\config</fs.configpath>
2b. Die Konfiguration der Zielumgebungen (host, port, projekt, user, etc) welches fs-cli benötigt liegt in Properties Dateien (pro Umgebung) und kann per "properties-maven-plugin" später mit einer einfachen Angabe der Umgebung geladen werden:
<!-- load environment config -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<executions>
<execution>
<phase>initialize</phase>
<goals>
<goal>read-project-properties</goal>
</goals>
<configuration>
<files>
<file>${fs.configpath}\${fs.export.env}.properties</file>
</files>
</configuration>
</execution>
</executions>
</plugin>
3. Bei jeder Ausführung wird im Standard Build Ablauf die konfigurierte Version des fs-cli + fs-access.jar aus dem Maven Repository geladen und lokal entpackt.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack-fs-cli</id>
<phase>validate</phase>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<configuration>
<includeGroupIds>de.espirit.firstspirit</includeGroupIds>
<includeArtifactIds>fs-cli</includeArtifactIds>
<outputDirectory>${project.build.directory}</outputDirectory>
</configuration>
</execution>
<execution>
<id>copy-fs-access</id>
<phase>validate</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>de.espirit.firstspirit</groupId>
<artifactId>fs-access</artifactId>
<version>${firstspirit.version}</version>
<type>jar</type>
<overWrite>true</overWrite>
<outputDirectory>${fsdevtools.libpath}</outputDirectory>
<destFileName>fs-access.jar</destFileName>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
4. Es gibt drei Profile die man ausführen kann, Export, Import und Test welche die Aktionen des fs-cli widerspiegeln, diese führen das fs-cli mit Parameter aus, hier mal Beispielhaft der Export:
<profile>
<id>export-templates</id>
<properties>
<!-- skip deploy -->
<maven.install.skip>false</maven.install.skip>
<maven.deploy.skip>true</maven.deploy.skip>
</properties>
<build>
<defaultGoal>clean install</defaultGoal>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<id>export-templates</id>
<phase>process-resources</phase>
<configuration>
<executable>${fsdevtools.execpath}/${fsdevtools.executable}</executable>
<workingDirectory>${project.build.directory}</workingDirectory>
<arguments>
<argument>-h</argument>
<argument>${fs.host}</argument>
<argument>-port</argument>
<argument>${fs.port}</argument>
<argument>-p</argument>
<argument>${fs.project}</argument>
<argument>-u</argument>
<argument>${fs.user}</argument>
<argument>-pwd</argument>
<argument>${fs.pwd}</argument>
<argument>-sd</argument>
<argument>${fsdevtools.exportsyncpath}</argument>
<argument>${fsdevtools.exportcommand}</argument>
<argument>${fsdevtools.store}</argument>
</arguments>
</configuration>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
</plugin>
<plugins>
</build>
</profiles>
5. Wenn der Release Build (maven deploy) ausgeführt wird, wird aus dem Template Ordner ein ZIP Artefakt (über das
maven-assembly-plugin) welches mit der entsprechenden Version in das Maven Repository hochgeladen wird.
Bei Fragen bitte melden.
Viele Grüße
Thomas