Änderungen von Dokument Plugin-Entwicklung


Von Version 1.2
bearbeitet von rth
am 14.02.2022, 17:19
Änderungskommentar: Es gibt keinen Kommentar für diese Version
Auf Version 16.1
bearbeitet von MKO
am 13.07.2023, 13:19
Änderungskommentar: Es gibt keinen Kommentar für diese Version

Zusammenfassung

Details

Seiteneigenschaften
Dokument-Autor
... ... @@ -1,1 +1,1 @@
1 -XWiki.rth
1 +XWiki.mko
Inhalt
... ... @@ -1,93 +1,104 @@
1 1  {{content/}}
2 2  
3 -== Plugins für zusätzliche Funktionalitäten ==
4 4  
5 5  {{formcycle/}} bietet ein Vielzahl von Einstiegspunkten für die Erweiterung der Standard-Funktionalitäten durch Plugins. Basierend auf den einzelnen [[Plugin-Typen>>doc:Formcycle.PluginDevelopment.Types.WebHome]] werden diese zu gewissen Zeitpunkten automatisch oder manuell angesprochen und erlauben es somit von der Ersetzung eigener Platzhalter bis hin zur Implementierung eigener Verarbeitungslogik {{formcycle/}} anzupassen. Als fundamentaler erster Schritt für die Entwicklung eigener Plugins ist hierbei das Erstellen eines entsprechenden Java-Projekts anzusehen.
6 6  
7 7  == API-Dokumentation ==
8 8  
9 -Die API-Dokumentation für {{formcycle/}} findet sich hier auf unserer Seite: [[Javadocs>>https://docs.formcycle.eu/]]
8 +Die API-Dokumentation für {{formcycle/}} findet sich hier auf unserer Seite: [[JavaScript und JavaDocs>>https://docs.formcycle.eu/]]
10 10  
11 -== Projekt-Setup ==
10 +== Maven-Setup ==
12 12  
13 -Zu Beginn der Entwicklung eines Plugins ist es nötig das entsprechende Entwicklungsprojekt aufzusetzten und zu konfigurieren. Für letzteres kommt hierbei das Build-Management-Tool [[Apache Maven>>url:https://maven.apache.org/||rel="__blank"]] zum Einsatz. Um die entsprechenden Abhängigkeiten zu {{formcycle case="dat"/}} bereitzustellen ist ein Repository unter der URL [[https:~~/~~/artifactory.xima-services.de/artifactory/fc-plugin-dev>>url:https://artifactory.xima-services.de/artifactory/fc-plugin-dev]] zu benutzen. Dieses beinhaltet alle öffentlich zur Verfügung stehenden Artefakte welche dem Plugin zur Laufzeit bereitgestellt und während der Entwicklung benötigt werden. Augangspunkt ist hierbei das Artefakt //fc-plugin-common//, welches die einzelnen Plugin-Schnittstellen beinhaltet und auch auf [[unserere Downloadseite zur Verfügung steht>>url:http://artifactory.xima-services.de/artifactory/fc-plugin-dev/de/xima/fc/fc-plugin-common/]]. Ein Auszug des Project Object Models (pom.xml) sieht dem entsprechend beispielhaft wie folgt aus:
12 +Zu Beginn der Entwicklung eines Plugins ist es nötig, das entsprechende Entwicklungsprojekt aufzusetzten und zu konfigurieren.
14 14  
15 -{{panel title="Beispiel für pom.xml" fullwidth="true" initial="hidden" triggerable="true"}}
14 +Für letzteres empfehlen wir hierbei das Build-Management-Tool [[Apache Maven>>url:https://maven.apache.org/||rel="__blank"]] zu verwenden. Andere Build-Tools können prinzipiell auch genutzt werden, hier können wir aber keine Hilfe bereitstellen.
15 +
16 +Um die entsprechenden Abhängigkeiten zu {{formcycle case="dat"/}} bereitzustellen, ist das Repository unter der URL [[https:~~/~~/artifactory.xima-services.de/artifactory/fc-plugin-dev>>url:https://artifactory.xima-services.de/artifactory/fc-plugin-dev]] zu benutzen. Dieses enthält alle öffentlich zur Verfügung stehenden Artefakte, welche dem Plugin zur Laufzeit bereitgestellt und während der Entwicklung benötigt werden.
17 +
18 +Damit das Repository auch beim Bauen mit Maven verwendet wird, sollte folgendes in die Maven-Konfigurationsdatei //settings.xml// geschrieben werden. Diese Datei findet sich in der Regeln im //.m2//-Ordner im Home-Verzeichnis des aktuellen Nutzers. Unter Linux //~~/.m2/settings.xml// und unter Windows //%homepath%\.m2\settings.xml//:
19 +
20 +{{panel title="~~~~/.m2/settings.xml" fullwidth="true" initial="hidden" triggerable="true"}}
16 16  {{code language="xml"}}
17 -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
18 - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
22 +<?xml version="1.0" encoding="UTF-8"?>
23 +<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd" xmlns="http://maven.apache.org/SETTINGS/1.1.0"
24 + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
19 19  
20 -...
26 + <!-- Add XIMA artifactory -->
27 + <profiles>
28 + <profile>
29 + <!-- FORMCYCLE dependencies -->
30 + <repositories>
31 + <repository>
32 + <snapshots>
33 + <enabled>false</enabled>
34 + </snapshots>
35 + <id>xima</id>
36 + <name>fc-plugin-dev</name>
37 + <url>https://artifactory.xima-services.de/artifactory/fc-plugin-dev</url>
38 + </repository>
39 + </repositories>
40 + <!-- Maven plugins for FORMCYCLE -->
41 + <pluginRepositories>
42 + <pluginRepository>
43 + <snapshots>
44 + <enabled>false</enabled>
45 + </snapshots>
46 + <id>xima</id>
47 + <name>fc-plugin-dev</name>
48 + <url>https://artifactory.xima-services.de/artifactory/fc-plugin-dev</url>
49 + </pluginRepository>
50 + </pluginRepositories>
51 + <id>xima-artifactory</id>
52 + </profile>
53 + </profiles>
21 21  
22 - <properties>
23 - <!-- Configuration -->
24 - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
55 + <!-- Enable XIMA artifactory by default -->
56 + <activeProfiles>
57 + <activeProfile>xima-artifactory</activeProfile>
58 + </activeProfiles>
25 25  
26 - <!-- Dependencies -->
27 - <xfc.version>7.0.9</xfc.version>
60 + <!-- FORMCYCLE specific Maven plugins provided by XIMA -->
61 + <pluginGroups>
62 + <pluginGroup>de.xima.fc.maven.plugin</pluginGroup>
63 + </pluginGroups>
64 +</settings>
65 +{{/code}}
66 +{{/panel}}
28 28  
29 - <!-- Plugins -->
30 - <maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
31 - <maven-jar-plugin.version>3.1.0</maven-jar-plugin.version>
32 - </properties>
68 +== Maven-Projekteinrichtung ==
33 33  
34 - <repositories>
35 - <repository>
36 - <id>xima</id>
37 - <name>fc-plugin-dev</name>
38 - <url>https://artifactory.xima-services.de/artifactory/fc-plugin-dev</url>
39 - </repository>
40 - </repositories>
70 +Im Folgenden werden einige Punkte beschrieben, die beim Einrichten eines Maven-Projekts für ein {{formcycle/}}-Plugin beachtet werden müssen. Für den schnellen Einstieg gibt auch einige [[Maven-Archetypes>>||anchor="HMaven-Archetypes"]].
41 41  
42 - <dependencies>
43 - <dependency>
44 - <groupId>de.xima.fc</groupId>
45 - <artifactId>fc-plugin-common</artifactId>
46 - <version>${xfc.version}</version>
47 - <scope>provided</scope>
48 - </dependency>
49 - </dependencies>
72 +=== Artekfakte und Abhängigkeiten ===
50 50  
51 - <build>
52 - <plugins>
53 - <plugin>
54 - <groupId>org.apache.maven.plugins</groupId>
55 - <artifactId>maven-compiler-plugin</artifactId>
56 - <version>${maven-compiler-plugin.version}</version>
57 - <configuration>
58 - <release>11</release>
59 - <encoding>UTF-8</encoding>
60 - </configuration>
61 - </plugin>
74 +{{info}}
75 +Alle Abhängigkeiten zu {{formcycle case="dat"/}} sind im scope "provided" zu definieren!
76 +{{/info}}
62 62  
63 - <plugin>
64 - <groupId>org.apache.maven.plugins</groupId>
65 - <artifactId>maven-jar-plugin</artifactId>
66 - <version>${maven-jar-plugin.version}</version>
67 - <configuration>
68 - <archive>
69 - <manifest>
70 - <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
71 - </manifest>
72 - <manifestEntries>
73 - <formcycle-version-requirement>${xfc.version}</formcycle-version-requirement>
74 - <Build-Time>${maven.build.timestamp}</Build-Time>
75 - </manifestEntries>
76 - </archive>
77 - </configuration>
78 - </plugin>
78 +Eine fertige einfache //pom.xml// können Sie [[hier herunterladen>>attach:pom.xml||rel="__blank"]].
79 79  
80 - </plugins>
81 - </build>
82 -</project>
80 +Ausgangspunkt für die Entwicklung von Plugin ist das Maven-Artefakt //fc-plugin-common//. Dieses enthält die einzelnen Plugin-Schnittstellen und steht auch auf [[unsererer Downloadseite zur Verfügung>>url:http://artifactory.xima-services.de/artifactory/fc-plugin-dev/de/xima/fc/fc-plugin-common||rel="noopener noreferrer" target="_blank"]].
83 83  
82 +In der //pom.xml// des Plugin-Projekts kann diese Abhängigkeit wie folgt eingebunden werden:
83 +
84 +{{code language="xml"}}
85 + <properties>
86 + <xfc.version>7.2.1</xfc.version>
87 + </properties>
88 +
89 + <dependencies>
90 + <dependency>
91 + <groupId>de.xima.fc</groupId>
92 + <artifactId>fc-plugin-common</artifactId>
93 + <version>${xfc.version}</version>
94 + <scope>provided</scope>
95 + </dependency>
96 + </dependencies>
84 84  {{/code}}
85 -{{/panel}}
86 86  
87 -Ferner steht je nach Tiefe der Integration in die bestehende Umgebung von {{formcycle case="dat"/}} und dessen Benutzung als höchste Implementierung das Artefakt //fc-logic// zur Verfügung. Dieses wird wie folgt als weitere (oder einzige) Abhängigkeit definiert:
99 +Ferner steht je nach Tiefe der Integration in die bestehende Umgebung von {{formcycle case="dat"/}} und deren Benutzung als höchste Implementierung das Artefakt //fc-logic// zur Verfügung. Dieses wird wie folgt als weitere (oder einzige) Abhängigkeit definiert:
88 88  
89 89  {{code language="xml"}}
90 -...
91 91   <dependency>
92 92   <groupId>de.xima.fc</groupId>
93 93   <artifactId>fc-logic</artifactId>
... ... @@ -94,19 +94,214 @@
94 94   <version>${xfc.version}</version>
95 95   <scope>provided</scope>
96 96   </dependency>
97 -...
98 98  {{/code}}
99 99  
100 -Eine entsprechende Benutzung ist vor allem bei der Verwendung der Datenbankschnittstelle sowie bei der Implementierung von eigenen Verarbeitungen nötig. Eine Vorlage für ein somit entstehendes Project Object Model finden Sie [[hier>>attach:pom.xml||rel="__blank"]].
110 +Eine entsprechende Benutzung ist vor allem bei der Verwendung der Datenbankschnittstelle sowie bei der Implementierung von eigenen Verarbeitungen nötig.
101 101  
102 -Ferner ist zu beachten, dass sämtliche Abhängigkeiten zu {{formcycle case="dat"/}} im scope //provided //anzugeben sind. Dies verhindert neben Classpath-Problemen auch das unnötige Anschwellen der Plugin-Größe. Ebenso sollten diesbezüglich Abhängigkeiten auf bereits von {{formcycle case="dat"/}} benutzten und damit bereitstehenden Bibliotheken wiederverwendet werden (z.B. diverse Apache Commons-Implementierungen).
112 +Ferner ist zu beachten, dass sämtliche Abhängigkeiten zu {{formcycle case="dat"/}} im scope //provided //anzugeben sind. Dies verhindert neben Classpath-Problemen auch das unnötige Anschwellen der Plugin-Größe. Ebenso sollten diesbezüglich Abhängigkeiten auf bereits von {{formcycle case="dat"/}} benutzten und damit bereitstehenden Bibliotheken wiederverwendet werden (z.B. diverse Apache Commons-Implementierungen). Solche Abhängigkeit sind auch im Scope //provided// zu definieren. Eine einfache Möglichkeit, Fehler zu vermeiden, ist das Importieren der FORMCYCLE-Bom:
103 103  
114 +{{code language="xml"}}
115 + <dependencyManagement>
116 + <dependencies>
117 + <!--Import dependency versions from FORMCYCLE -->
118 + <dependency>
119 + <groupId>de.xima.fc</groupId>
120 + <artifactId>fc</artifactId>
121 + <version>${xfc.version}</version>
122 + <type>pom</type>
123 + <scope>import</scope>
124 + </dependency>
125 + </dependencies>
126 + </dependencyManagement>
127 +{{/code}}
128 +
129 +Dann einfach die gewünschte Abhängigkeit ohne {{code}}<version>...</version>{{/code}} definieren. Wenn FORMCYCLE die Abhängigkeit schon enthält, gibt es keinen Build-Fehler. Andernfalls muss diese im Plugin mitgeliefert werden. In dem Fall die Version hinzufügen und den Provided-Scope entfernen.
130 +
131 +=== Manifest und Fat JAR ===
132 +
133 +In der //META-INF/MANIFEST.MF// in der Plugin-JAR-Datei sollten folgende Informationen stehen:
134 +
135 +; formcycle-version-requirement
136 +: Erforderlich. Version von {{formcycle/}}, für die das Plugin gedacht ist. Ist erforderlich, damit {{formcycle/}} bei der Installation die Kompatibilität prüfen kann.
137 +; Implementation-Version
138 +: Erforderlich. Version des Plugins; Diese wird z.B. in der Oberfläche angezeigt.
139 +; Plugin-Key
140 +: Erforderlch. Wird zur Identifizierung des Plugin innherhalb von {{formcycle/}} verwendet, und auch von etwa dem Deploy-Plugin oder Server-Plugin. Empfohlener Wert ist {{code}}${project.groupId}:${project.artifactId}{{/code}}.
141 +; Build-Time oder Build-Timestamp
142 +: Optional. Wird bei SNAPSHOT-Versionen mit angezeigt, um den SNAPSHOT zu identifizieren.
143 +
104 104  {{info}}
105 -Alle Abhangigkeiten zu {{formcycle case="dat"/}} sind im scope "provided" zu definieren!
145 +Bis einschließlich Version 7.x von {{formcycle/}} ist noch {{code}}Implementation-Title{{/code}} mit dem gleichen Wert wie {{code}}Plugin-Key{{/code}} erforderlich.
106 106  {{/info}}
107 107  
108 -Basierend auf der hiermit zur Verfügung stehenden Infrastruktur steht der Entwicklung von eigenen Plugin-Implementierungen nichts mehr im Wege. Die Installation erfolgt anschließend je nach Verwendungszweck über die Oberflächen [[Mandant-Plugins>>doc:Formcycle.UserInterface.Client.Plugins]] oder [[System-Plugins>>doc:Formcycle.SystemSettings.UserInterface.SystemPlugins]].
148 +Diese Informationen nnen wie unten beschrieben mittels des //maven-assembly-plugin// in die Manifest-Datei geschrieben werden.
109 109  
110 -== Demo-Plugins ==
150 +Weiterhin ist beim Bauen zu beachten, dass eine sogenannte Fat-JAR gebaut werden muss. Abhängigkeiten zu {{formcycle case="dat"/}} sowie anderen Bibliotheken, welche bereits durch {{formcycle case="acc"/}} mitgeliefert werden, sollten wie bereits erwähnt im scope //provided// eingebunden werden. Falls im Plugin aber noch andere Abhängigkeiten benutzt werden, müssen diese in der JAR-Datei inkludiert werden (Fat JAR).
111 111  
112 -Um einen besseren Einstieg in die Plugin-Entwicklung zu finden, [[bieten wir auf unserer Downloadseite>>url:https://customer.formcycle.eu/index.php/s/PgdMrNOvbYEzhmr]] auch für jeden Plugintyp ein kommentiertes Demo-Maven-Projekt an. Sie können diese herunterladen und in der Entwicklungsumgebung ihrer Wahl einsehen und kompilieren.
152 +Dies kann entweder über das [[maven-assembly-plugin>>url:https://maven.apache.org/plugins/maven-assembly-plugin/]] oder das [[maven-shade-plugin>>url:https://maven.apache.org/plugins/maven-shade-plugin/]] erfolgen. Letzteres ist für forgeschrittene Anwendungsfälle gedacht, wenn etwa mehrere Abhängigkeiten die gleichen Dateien mitbringen und zusammengeführt werden müssen.
153 +
154 +Für einfache Plugins ist das //maven-assembly-plugin// ausreichend. Dieses kann in der //pom.xml// wie folgt konfiguriert werden:
155 +
156 +{{panel title="maven-assembly-plugin in pom.xml" fullwidth="true" initial="hidden" triggerable="true"}}
157 +{{code language="java"}}
158 + <properties>
159 + <maven-assembly-plugin.version>3.3.0</maven-assembly-plugin.version>
160 + </properties>
161 + <build>
162 + <finalName>${project.artifactId}</finalName>
163 + <plugins>
164 + <plugin>
165 + <groupId>org.apache.maven.plugins</groupId>
166 + <artifactId>maven-assembly-plugin</artifactId>
167 + <version>${maven-assembly-plugin.version}</version>
168 + <executions>
169 + <execution>
170 + <id>fat-jar</id>
171 + <phase>package</phase>
172 + <goals>
173 + <goal>single</goal>
174 + </goals>
175 + <configuration>
176 + <finalName>${project.artifactId}</finalName>
177 + <appendAssemblyId>false</appendAssemblyId>
178 + <descriptorRefs>
179 + <descriptorRef>jar-with-dependencies</descriptorRef>
180 + </descriptorRefs>
181 + <archive>
182 + <manifest>
183 + <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
184 + </manifest>
185 + <manifestEntries>
186 + <formcycle-version-requirement>${xfc-version}</formcycle-version-requirement>
187 + <Build-Timestamp>${maven.build.timestamp}</Build-Timestamp>
188 + <Implementation-Title>${project.groupId}:${project.artifactId}</Implementation-Title>
189 + <Implementation-Vendor-Id>${project.groupId}</Implementation-Vendor-Id>
190 + <Implementation-Version>${project.version}</Implementation-Version>
191 + </manifestEntries>
192 + </archive>
193 + </configuration>
194 + </execution>
195 + </executions>
196 + </plugin>
197 + </plugins>
198 + </build>
199 +{{/code}}
200 +{{/panel}}
201 +
202 +=== Bauen und Installieren ===
203 +
204 +Der genaue Befehl zum Bauen hängt von den konkreten Einstellungen in der //pom.xml// ab. In der Regel sollte aber folgender Standardbefehl im Plugin-Verzeichnis funktionieren:
205 +
206 +{{code}}
207 + mvn clean install
208 +{{/code}}
209 +
210 +Nachdem das Plugin erfolgreich gebaut wurde, kann die so entstandene JAR-Datei im //target//-Verzeichnis in {{formcycle/}} über die Oberfläche [[Mandant-Plugins>>doc:Formcycle.UserInterface.Client.Plugins]] beziehungsweise [[System-Plugins>>doc:Formcycle.SystemSettings.UserInterface.SystemPlugins]] hochgeladen werden.
211 +
212 +Siehe [[Deploy-Plugin>>||anchor="HDeploy-Plugin"]] zum automatischen Hochladen beim Maven-Build.
213 +
214 +Siehe [[FC-Server-Plugin>>||anchor="HFC-Server-Plugin"]] zum Starten eines einfachen {{formcycle/}}-Servers.
215 +
216 +== Maven-Archetypes ==
217 +
218 +{{figure image="eclipse-archetype.png" width="500"}}
219 + Hinzufügen des Archetypes-Katalogs in Eclipse
220 +{{/figure}}
221 +
222 +{{figure image="eclipse-archetype-select.png" width="500"}}
223 + Auswahl eines Archetypes beim Erstellen eines Maven-Projekts in Eclipse
224 +{{/figure}}
225 +
226 +Für einige häufig verwendete Plugin-Typen stehen [[Maven-Archetypes>>url:https://maven.apache.org/guides/introduction/introduction-to-archetypes.html||rel="noopener noreferrer" target="_blank"]] bereits, um schnell ein Maven-Projekt aufsetzen zu können.
227 +
228 +Voraussetzung für die Verwendung ist, dass in den //~~/.m2/settings.xml// wie oben beschrieben das XIMA-Artifactory eingerichtet wurde. Dann kann etwa über die Kommandozeile wie folgt eine Archetype generiert werden:
229 +
230 +{{code}}
231 +mvn archetype:generate -DarchetypeArtifactId=plugin-archetype-workflow-element-simple -DarchetypeGroupId=de.xima.fc.archetype -DarchetypeVersion=7.0.4
232 +{{/code}}
233 +
234 +Es werden dann einige wenige Informationen wie die gewünschten Maven-Koordinaten des neuen Plugin-Projekts abgefragt und anschließend ein neues vorkonfiguriertes Projekt erstellt.
235 +
236 +Alle vorhandenen Archetypes und deren Versionen können im [[Archetype-Katalog>>url:https://artifactory.xima-services.de/artifactory/fc-plugin-dev/archetype-catalog.xml||rel="noopener noreferrer" target="_blank"]] eingesehen werden.
237 +
238 +In Eclipse kann der Archetype-Katalog in den Einstellungen hinzugefügt werden. Bei der Erstellung eines neuen Maven-Projekt werden dann alle verfügbaren Archetypes angezeigt:
239 +
240 +{{code language="plaintext"}}
241 +https://artifactory.xima-services.de/artifactory/fc-plugin-dev/archetype-catalog.xml
242 +{{/code}}
243 +
244 +== Deploy-Plugin ==
245 +
246 +Um beim Entwickeln nicht jedes Mal eine neue Plugin-Version manuell über die Oberfläche hochladen zu müssen, kann das Deploy-Plugin verwendet werden. Dieses besteht aus 2 Teilen:
247 +
248 +* Ein Maven-Plugin, welches nach dem Bauen das Plugin via HTTP an einen laufenden {{formcycle/}}-Server sendet
249 +* Ein Plugin für {{formcycle/}}, welche die Gegenstelle in {{formcycle/}} bereitstellt und das Plugin aus dem HTTP-Request in {{formcycle/}} installiert.
250 +
251 +Weitere Details können im [[Hilfe-Artikel zum Deploy-Plugin>>doc:Formcycle.PluginDocumentation.FormcycleDeployPluginPlugin]] nachgelesen werden. Für die meisten Fälle ist kene Konfiguration in der //pom.xml// erforderlich. Es empfiehlt sich aber, wenigstens die Version festzusetzen:
252 +
253 +{{code language="xml"}}
254 + <properties>
255 + <fc-deploy-plugin-maven-plugin.version>7.0.1</fc-deploy-plugin-maven-plugin.version>
256 + <build>
257 + <plugins>
258 + <plugin>
259 + <groupId>de.xima.fc.maven.plugin</groupId>
260 + <artifactId>fc-deploy-plugin-maven-plugin</artifactId>
261 + <version>${fc-deploy-plugin-maven-plugin.version}</version>
262 + </plugin>
263 + </plugins>
264 + </build>
265 +{{/code}}
266 +
267 +Sofern das Deploy-Plugin bereits in {{formcycle/}} installiert ist, kann das Plugin-Projekt dann wie folgt gebaut und hochgeladen werden:
268 +
269 +{{code language="bash"}}
270 +mvn fc-deploy:deploy
271 +{{/code}}
272 +
273 +Es wird hierbei davon ausgegangen, dass {{formcycle/}} unter der Standard-URL {{code}}http://localhost:8080/xima-formcycle{{/code}} läuft und das Standard-Passwort "admin" für das Deploy-Plugin verwendet wird. Ist dies nicht der Fall, können die Werte auch angepasst werden:
274 +
275 +{{code language="bash"}}
276 +mvn package fc-deploy:deploy -DfcDeployUrl=http://localhost:8080/xima-formcycle -DfcDeployToken=admin
277 +{{/code}}
278 +
279 +{{info}}
280 +Bis einschließlich Version 7.x von {{formcycle/}} und dem Maven-Plugin ist es noch erforderlich, die package-Phase explizit aufzuführen. Zudem müssen die URL und das Passwort angegeben werden. Ab Version 8.x sind die Standardwerte gesetzt und die package-Phase wird automatisch ausgeführt.
281 +{{/info}}
282 +
283 +Soll das Plugin im Bereich eines bestimmten Mandanten registriert werden, so kann dies über den zusätzlichen Launch-Configuration Parameter //fcDeployClientId //erreicht werden. Dieser Parameter muss als Wert die Id des Mandanten enthalten.
284 +
285 +== FC-Server-Plugin ==
286 +
287 +Zum Testen eines Plugins ist es erforderlich, einen laufenden {{formcycle/}}-Server zu haben. Zur Vereinfachung der Entwicklung gibt es das //fc-server-maven-plugin//, welches mittels eines einzigen Befehls ein fertig eingerichtetes {{formcycle/}} lokal startet, wo auch bereits das Deploy-Plugin vorinstalliert ist.
288 +
289 +Sofern wie oben beschrieben in //~~/.m2/settings.xml// die //pluginGroup// hinterlegt wurde, kann in einem beliebiegen Verzeichnis wie folgt ein {{formcycle/}}-Server per Maven gestartet werden:
290 +
291 +{{code language="bash"}}
292 +# Aktuelle Version starten
293 +mvn fc-server:run-ms-war
294 +
295 +# Spezifische Version starten
296 +mvn de.xima.fc.maven.plugin:fc-server-maven-plugin:7.0.4:run-ms-war -DxfcVersion=7.0.16
297 +{{/code}}
298 +
299 +{{info}}
300 +Wir empfehlen die Nutzung von Java 11. Bei Nutzung von Java 17 kann es aktuell zu Problemen beim Starten von {{formcycle/}} kommen.
301 +{{/info}}
302 +
303 +{{info}}
304 +Bis einschließlich Version 7.x von {{formcycle/}} und dem Maven-Plugin ist es noch erforderlich, die package-Phase explizit aufzuführen: {{code}}mvn package fc-server:run-ms-war{{/code}}. Ab Version 8.x geschieht dies automatisch.
305 +{{/info}}
306 +
307 +{{info}}
308 +Die Major- und Minor-Version des Maven-Plugins sollte immer der Major- und Minor-Version des zu startenden {{formcycle case="gen"/}} entsprechen. Für {{formcycle/}} 7.0.x sollte also das Maven-Plugin in Version 7.0.x verwendet werde, für {{formcycle/}} 7.1.x das Maven-Plugin in Version 7.1.x usw.
309 +{{/info}}
310 +
311 +Nach kurzer Wartezeit (beim ersten Mal kann es länger dauern) ist dann ein {{formcycle/}}-Server gestartet. Die URL steht am Ende in der Kommandozeile, standardmäßig http://localhost:8080/xima-formcycle Der Zugang für den Superadmin ist {{code language="plaintext"}}sadmin{{/code}} (Passwort {{code language="plaintext"}}admin{{/code}}), der Zugang für den Mandantadministrator {{code language="plaintext"}}admin{{/code}} (Passwort {{code language="plaintext"}}/admin_{{/code}}).
312 +
313 +Falls der Befehl in einem Maven-Projekt eines {{formcycle/}}-Plugins ausgeführt wird, dann wird das Plugin automatisch gebaut und nach dem Starten des Servers hochgeladen und installiert. Zudem wird versucht, die {{formcycle/}}-Version aus dem Plugin-Projekt auszulesen.
314 +
315 +Dies funktioniert auch in einem Ordner ohne Maven-Projekt. Falls keine {{formcycle/}}-Version angegeben ist, wird eine Standard-Version genommen, abhängig von der Maven-Plugin-Version.
316 +
317 +Für fortgeschrittenen Gebrauch siehe die [[README.md>>attach:README-FC-SERVER.md||rel="__blank"]].
318 +
pom.xml
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.ximaadmin
1 +XWiki.awa
Größe
... ... @@ -1,1 +1,1 @@
1 -2.1 KB
1 +5.8 KB
Inhalt
... ... @@ -2,58 +2,91 @@
2 2   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3 3   <modelVersion>4.0.0</modelVersion>
4 4  
5 + <!-- MUST BE FILLED IN -->
5 5   <groupId></groupId>
6 6   <artifactId></artifactId>
7 7   <version></version>
8 - <packaging>jar</packaging>
9 -
10 10   <name></name>
11 11  
11 + <packaging>jar</packaging>
12 +
12 12   <properties>
13 13   <!-- Configuration -->
14 14   <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
15 15  
16 16   <!-- Dependencies -->
17 - <xfc-version>4.2.3</xfc-version>
18 + <xfc.version>7.2.1</xfc.version>
19 + <junit-jupiter.version>5.6.0</junit-jupiter.version>
18 18  
19 19   <!-- Plugins -->
20 - <maven-compiler-plugin-version>3.3</maven-compiler-plugin-version>
21 - <maven-jar-plugin-version>2.4</maven-jar-plugin-version>
22 + <maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
23 + <maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
24 + <maven-jar-plugin.version>3.1.0</maven-jar-plugin.version>
25 + <maven-assembly-plugin.version>3.3.0</maven-assembly-plugin.version>
26 + <fc-deploy-plugin-maven-plugin.version>7.0.1</fc-deploy-plugin-maven-plugin.version>
27 + <fc-server-maven-plugin.version>7.0.1</fc-server-maven-plugin.version>
22 22   </properties>
23 23  
24 - <repositories>
25 - <repository>
26 - <id>xima</id>
27 - <name>fc-plugin-dev</name>
28 - <url>http://artifactory.xima-services.de/artifactory/fc-plugin-dev</url>
29 - </repository>
30 - </repositories>
31 -
32 32   <dependencies>
31 + <!-- Reference FORMCYCLE libraries. The plugin is installed in a running -->
32 + <!-- FORMCYCLE system, , so you do not need to include the FORMCYCLE libraries -->
33 + <!-- in the plugin JAR. This is done by setting the scope to "provided" -->
33 33   <dependency>
34 34   <groupId>de.xima.fc</groupId>
35 - <artifactId>fc-plugin-common</artifactId>
36 - <version>${xfc-version}</version>
36 + <artifactId>fc-logic</artifactId>
37 + <version>${xfc.version}</version>
37 37   <scope>provided</scope>
38 38   </dependency>
39 39  
41 + <!-- JUnit for writing unit tests -->
40 40   <dependency>
41 - <groupId>de.xima.fc</groupId>
42 - <artifactId>fc-logic</artifactId>
43 - <version>${xfc-version}</version>
44 - <scope>provided</scope>
43 + <groupId>org.junit.jupiter</groupId>
44 + <artifactId>junit-jupiter</artifactId>
45 + <version>${junit-jupiter.version}</version>
46 + <scope>test</scope>
45 45   </dependency>
48 +
49 + <!-- You can add additional dependencies here. -->
50 + <!-- Some common libraries as apache-commons and guava are provided by -->
51 + <!-- FORMCYCLE and can be set to scope=provided. -->
52 +
46 46   </dependencies>
47 47  
48 48   <build>
56 + <finalName>${project.artifactId}</finalName>
57 +
49 49   <plugins>
59 +
60 + <!-- Upload the plugin to a running FORMCYCLE server as part of the Maven build process -->
61 + <!-- mvn package fc-deploy:deploy -DfcDeployUrl=http://localhost:8080/xima-formcycle -DfcDeployToken=admin -->
50 50   <plugin>
63 + <groupId>de.xima.fc.maven.plugin</groupId>
64 + <artifactId>fc-deploy-plugin-maven-plugin</artifactId>
65 + <version>${fc-deploy-plugin-maven-plugin.version}</version>
66 + </plugin>
67 +
68 + <!-- Start a preconfigured FORMCYCLE server-->
69 + <!-- mvn fc-server:run-ms-war -->
70 + <plugin>
71 + <groupId>de.xima.fc.maven.plugin</groupId>
72 + <artifactId>fc-server-maven-plugin</artifactId>
73 + <version>${fc-server-maven-plugin.version}</version>
74 + <configuration>
75 + <bootstrap>
76 + <pluginManagement>
77 + <deployMavenProject>true</deployMavenProject>
78 + </pluginManagement>
79 + </bootstrap>
80 + </configuration>
81 + </plugin>
82 +
83 + <!-- Configure the compilation process. At least Java 11 is required. -->
84 + <plugin>
51 51   <groupId>org.apache.maven.plugins</groupId>
52 52   <artifactId>maven-compiler-plugin</artifactId>
53 - <version>${maven-compiler-plugin-version}</version>
87 + <version>${maven-compiler-plugin.version}</version>
54 54   <configuration>
55 - <source>1.7</source>
56 - <target>1.7</target>
89 + <release>11</release>
57 57   <encoding>UTF-8</encoding>
58 58   <showDeprecation>true</showDeprecation>
59 59   <showWarnings>true</showWarnings>
... ... @@ -60,10 +60,11 @@
60 60   </configuration>
61 61   </plugin>
62 62  
96 + <!-- Configure how the JAR is created, including manifest entries -->
63 63   <plugin>
64 64   <groupId>org.apache.maven.plugins</groupId>
65 65   <artifactId>maven-jar-plugin</artifactId>
66 - <version>${maven-jar-plugin-version}</version>
100 + <version>${maven-jar-plugin.version}</version>
67 67   <configuration>
68 68   <archive>
69 69   <manifest>
... ... @@ -70,13 +70,59 @@
70 70   <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
71 71   </manifest>
72 72   <manifestEntries>
73 - <formcycle-version-requirement>${xfc-version}</formcycle-version-requirement>
107 + <formcycle-version-requirement>${xfc.version}</formcycle-version-requirement>
108 + <Build-Timestamp>${maven.build.timestamp}</Build-Timestamp>
109 + <Implementation-Title>${project.groupId}:${project.artifactId}</Implementation-Title>
110 + <Implementation-Vendor-Id>${project.groupId}</Implementation-Vendor-Id>
111 + <Implementation-Version>${project.version}</Implementation-Version>
74 74   </manifestEntries>
75 75   </archive>
76 76   </configuration>
77 77   </plugin>
116 +
117 + <!-- Build a fat JAR with all dependencies included -->
118 + <plugin>
119 + <groupId>org.apache.maven.plugins</groupId>
120 + <artifactId>maven-assembly-plugin</artifactId>
121 + <version>${maven-assembly-plugin.version}</version>
122 + <executions>
123 + <execution>
124 + <id>fat-jar</id>
125 + <phase>package</phase>
126 + <goals>
127 + <goal>single</goal>
128 + </goals>
129 + <configuration>
130 + <finalName>${project.artifactId}</finalName>
131 + <appendAssemblyId>false</appendAssemblyId>
132 + <descriptorRefs>
133 + <descriptorRef>jar-with-dependencies</descriptorRef>
134 + </descriptorRefs>
135 + <archive>
136 + <manifest>
137 + <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
138 + </manifest>
139 + <manifestEntries>
140 + <formcycle-version-requirement>${xfc.version}</formcycle-version-requirement>
141 + <Build-Timestamp>${maven.build.timestamp}</Build-Timestamp>
142 + <Plugin-Key>${project.groupId}:${project.artifactId}</Plugin-Key>
143 + <Implementation-Title>${project.groupId}:${project.artifactId}</Implementation-Title>
144 + <Implementation-Vendor-Id>${project.groupId}</Implementation-Vendor-Id>
145 + <Implementation-Version>${project.version}</Implementation-Version>
146 + </manifestEntries>
147 + </archive>
148 + </configuration>
149 + </execution>
150 + </executions>
151 + </plugin>
152 +
153 + <!-- Use JUnit to run test classes -->
154 + <plugin>
155 + <groupId>org.apache.maven.plugins</groupId>
156 + <artifactId>maven-surefire-plugin</artifactId>
157 + <version>${maven-surefire-plugin.version}</version>
158 + </plugin>
78 78   </plugins>
79 79   </build>
80 80  </project>
81 81  
82 -
README-FC-SERVER.md
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.awa
Größe
... ... @@ -1,0 +1,1 @@
1 +15.1 KB
Inhalt
... ... @@ -1,0 +1,495 @@
1 +Maven plugin for starting a FORMCYCLE server, similar to the Jetty maven plugin, but initializes the FORMCYCLE application.
2 +
3 +## TL;DR
4 +
5 +Version 8:
6 +
7 +```bash
8 +# Standalone
9 +mvn de.xima.fc.maven.plugin:fc-server-maven-plugin:8.0.0:ms -DxfcVersion=8.0.4
10 +
11 +# FORMCYCLE plugin project
12 +mvn fc-server:run-ms-war
13 +```
14 +
15 +Version 7:
16 +
17 +> mvn de.xima.fc.maven.plugin:fc-server-maven-plugin:7.0.4:ms -DxfcVersion=7.0.16
18 +
19 +## Versioning
20 +
21 +* The major and minor version are always equal to the FORMCYCLE major version against which the project was built.
22 +* The patch version is for the plugin.
23 +
24 +## Terms
25 +
26 +A "FORMCYCLE plugin project" is Maven project packaged as a fat jar, with a (possibly transitive)
27 +compile dependency on `de.xima.fc:fc-plugin-common` in the `provided` scope.
28 +
29 +A Maven project "packaged as a fat jar" is Maven project with its `packaging` set to `jar` and
30 +that includes a plugin execution for either the `maven-assembly-plugin` or the `maven-shade-plugin`.
31 +
32 +## Goals
33 +
34 +See the site above for more in-depth info.
35 +
36 +* `ms` Intended for use as a command line tool to start a server without a Maven project:
37 + `mvn fc-server:ms`.
38 +* `run-ms-war` Intended for use as a command line tool to start a server on an existing
39 + [FORMCYCLE plugin project](#terms): `mvn fc-server:ms`.
40 +* `start-ms-war` Goal for integration into an existing lifecycle defined in a pom.xml, should be
41 + bound to a particular phase. Does not block by default.
42 +
43 +## Usage
44 +
45 +This is a Maven plugin with several goals. You can run it via the command line:
46 +
47 +```bash
48 +# When you have no Maven project
49 +mvn fc-server:ms
50 +
51 +# When you have an existing FORMYCLE plugin project
52 +mvn fc-server:run-ms-war
53 +```
54 +
55 +If the command is run from within an existing Maven project, it first packages the project, then starts the server and finally (if `-DdeployMavenProject=true` is set), installs the main artifact file of the Mavne project automatically into the started FORMCYCLE instance.
56 +
57 +The first command can be used in a directory without a Maven project.
58 +
59 +If the second command is run on an existing [FORMCYCLE plugin project](#terms), it first packages that project, then
60 +starts the server and finally installs the main artifact file of the Maven project automatically into the started
61 +FORMCYCLE instance.
62 +
63 +If Maven cannot find the plugin or you need to run a specific version of the plugin, you have to use the full coordinates:
64 +
65 +> mvn de.xima.fc.maven.plugin:fc-server-maven-plugin:8.0.0-SNAPSHOT:run-ms-war
66 +
67 +To get Maven to find the plugin without the full name, either add the plugin to `<plugin>` section of your `pom.xml` or add the following to the `~/.m2/settings.xml`:
68 +
69 +```xml
70 +<settings>
71 + <pluginGroups>
72 + <pluginGroup>de.xima.fc.maven.plugin</pluginGroup>
73 + </pluginGroups>
74 +</settings>
75 +```
76 +
77 +If you want to configure the plugin, you can do so via a `<plugin>` section in the `pom.xml`. See the
78 +site above for documentation. Below are some example configurations.
79 +
80 +### Use a different FORMCYCLE version
81 +
82 +The FORMCYCLE version defaults to the version against which the version of the plugin was built. The plugin major and minor version always follow the FORMCYCLE version, e.g. plugin version 7.0.9 will default to some `7.0.x` release of FORMCYCLE.
83 +
84 +To set the version of the FORMCYCLE app:
85 +
86 +```xml
87 +<plugin>
88 + <groupId>de.xima.fc.maven.plugin</groupId>
89 + <artifactId>fc-server-maven-plugin</artifactId>
90 + <version>${fc-server-maven-plugin.version}</version>
91 + <configuration>
92 + <xfcVersion>7.0.7</xfcVersion>
93 + </configuration>
94 +</plugin>
95 +```
96 +
97 +Note that you can also use:
98 +
99 +> mvn fc-server:ms -DxfcVersion=7.0.7
100 +
101 +You may have to use a different version of the plugin for older FC versions (major and minor plugin version always follow the FC version)
102 +
103 +> mvn de.xima.fc.maven.plugin:fc-server-maven-plugin:7.0.4:ms -DxfcVersion=7.0.16
104 +
105 +### Use a custom FORMCYCLE war file
106 +
107 +If you need to, you can also use a custom FORMCYCLE WAR file, e.g. a local build etc.
108 +
109 +
110 +```xml
111 +<plugin>
112 + <groupId>de.xima.fc.maven.plugin</groupId>
113 + <artifactId>fc-server-maven-plugin</artifactId>
114 + <version>${fc-server-maven-plugin.version}</version>
115 + <configuration>
116 + <warFile>/path/to/formcycle.war</warFile>
117 + </configuration>
118 +</plugin>
119 +```
120 +
121 +You can also use specify this setting on the command line:
122 +
123 +> mvn fc-server:ms -DwarFile=/path/to/formcycle.war
124 +
125 +### Change servlet container settings
126 +
127 +You can change the server context path and port:
128 +
129 +```xml
130 +<plugin>
131 + <groupId>de.xima.fc.maven.plugin</groupId>
132 + <artifactId>fc-server-maven-plugin</artifactId>
133 + <version>${fc-server-maven-plugin.version}</version>
134 + <configuration>
135 + <contextPath>form-server</contextPath>
136 + <port>8099</port>
137 + </configuration>
138 +</plugin>
139 +```
140 +
141 +You can also use specify these settings on the command line:
142 +
143 +> mvn fc-server:ms -DcontextPath=form-server -Dport=8090
144 +
145 +### Change app persistence directory
146 +
147 +All FORMCYCLE specific data such as the log files, configuration files or temporary files are stored in the application directory in the `target` folder. You can use a different app directory if you want.
148 +
149 +```xml
150 +<plugin>
151 + <groupId>de.xima.fc.maven.plugin</groupId>
152 + <artifactId>fc-server-maven-plugin</artifactId>
153 + <version>${fc-server-maven-plugin.version}</version>
154 + <configuration>
155 + <appDir>${project.basedir}/xfc-server</appDir>
156 + </configuration>
157 +</plugin>
158 +```
159 +
160 +You can also use specify this setting on the command line:
161 +
162 +> mvn fc-server:ms -DappDir=target/apps/xfc-server
163 +
164 +### Use a different servlet container
165 +
166 +By default, Jetty is used, but this can be changed:
167 +
168 +```xml
169 +<plugin>
170 + <groupId>de.xima.fc.maven.plugin</groupId>
171 + <artifactId>fc-server-maven-plugin</artifactId>
172 + <version>${fc-server-maven-plugin.version}</version>
173 + <configuration>
174 + <container>tomcat:9</container>
175 + </configuration>
176 +</plugin>
177 +```
178 +
179 +You can also use specify this setting on the command line:
180 +
181 +> mvn fc-server:ms -Dcontainer=tomcat:9
182 +
183 +By default, supported values are currently
184 +
185 +* `jetty:10` - Jetty Servlet Container Version 10.x
186 +* `tomcat:9` - Apache Tomcat Version 9.x
187 +
188 +To use a custom container, include a `de.xima.servletcontainer.api.IServletContainerProvider` in
189 +the classpath and specify the corresponding name.
190 +
191 +### Use in-memory H2 database
192 +
193 +By default, the H2 database is stored in a file, so the data is persisted when you restart the server. But you can also use an in-memory database:
194 +
195 +```xml
196 +<plugin>
197 + <groupId>de.xima.fc.maven.plugin</groupId>
198 + <artifactId>fc-server-maven-plugin</artifactId>
199 + <version>${fc-server-maven-plugin.version}</version>
200 + <configuration>
201 + <h2Storage>ram</h2Storage>
202 + </configuration>
203 +</plugin>
204 +```
205 +
206 +You can also use specify this setting on the command line:
207 +
208 +> mvn fc-server:ms -Dh2Storage=ram
209 +
210 +### Use a different database
211 +
212 +Include the driver via `dbDrivers` and configure the `database.properties`:
213 +
214 +```xml
215 +<plugin>
216 + <groupId>de.xima.fc.maven.plugin</groupId>
217 + <artifactId>fc-server-maven-plugin</artifactId>
218 + <version>${fc-server-maven-plugin.version}</version>
219 + <configuration>
220 + <dbDrivers>
221 + <dbDriver>postgresql</dbDriver>
222 + </dbDrivers>
223 + <databaseProperties>
224 + <properties>
225 + <property>
226 + <name>db.connection.dbms.shortname</name>
227 + <value>postgresql</value>
228 + </property>
229 + <property>
230 + <name>db.connection.jdbcurl</name>
231 + <value>jdbc:postgresql://localhost:5432/my_database</value>
232 + </property>
233 + <property>
234 + <name>db.connection.login.username</name>
235 + <value>USERNAME</value>
236 + </property>
237 + <property>
238 + <name>db.connection.login.password</name>
239 + <value>PASSWORD</value>
240 + </property>
241 + </properties>
242 + </databaseProperties>
243 + </configuration>
244 +</plugin>
245 +```
246 +
247 +You can also use specify this setting on the command line (separate multiple drivers with a comma):
248 +
249 +> mvn fc-server:ms -DaddDbDrivers=postgresql,h2 -DdbShortname=postgresql -DdbJdbcUrl=jdbc:postgresql://localhost:5432/my_database -DdbUsername=USERNAME -DdbPassword=PASSWORD
250 +
251 +Supported database drivers are
252 +
253 +* `h2`
254 +* `mariadb`
255 +* `mysql`
256 +* `oracle`
257 +* `postgresql`
258 +* `sqlserver`
259 +* `custom` (does not add any driver, add your own driver via `dependencies`)
260 +
261 +### Create default clients
262 +
263 +You can add additional clients to be created when the FORMCYCLE app starts. When the client exists already, it is updated with the configured settings. Clients are identified by their `name`.
264 +
265 +```xml
266 +<plugin>
267 + <groupId>de.xima.fc.maven.plugin</groupId>
268 + <artifactId>fc-server-maven-plugin</artifactId>
269 + <version>${fc-server-maven-plugin.version}</version>
270 + <configuration>
271 + <bootstrap>
272 + <clientManagement>
273 + <!-- Do not create the default client -->
274 + <excludeDefaults>true</excludeDefaults>
275 + <clients>
276 + <!-- Create a default client -->
277 + <client>
278 + <baseSettings>
279 + <name>myforms</name>
280 + <alias>Formular</alias>
281 + <languageTag>de</languageTag>
282 + <baseUrl>http://10.42.42.50/form-server</baseUrl>
283 + <description>Client for testing forms</description>
284 + </baseSettings>
285 + <adminUser>
286 + <userName>awa</userName>
287 + <email>awa@xima.de</email>
288 + <givenName>Andre</givenName>
289 + <lastName>Wachsmuth</lastName>
290 + <password>12345678</password>
291 + </adminUser>
292 + </client>
293 + </clients>
294 + </clientManagement>
295 + </bootstrap>
296 + </configuration>
297 +</plugin>
298 +```
299 +
300 +### Including additional plugins
301 +
302 +You can include additional plugins that should be installed after the FORMYCLE app was started:
303 +
304 +```xml
305 +<plugin>
306 + <groupId>de.xima.fc.maven.plugin</groupId>
307 + <artifactId>fc-server-maven-plugin</artifactId>
308 + <version>${fc-server-maven-plugin.version}</version>
309 + <configuration>
310 + <bootstrap>
311 + <pluginManagement>
312 + <plugins>
313 + <!-- You can specify a Maven coordinate when the plugin is available via Maven -->
314 + <plugin>
315 + <location>de.xima.fc.plugin:fc-plugin-bundle-leitfaden:2.0.22</location>
316 + </plugin>
317 + <!-- You can also specify a local path -->
318 + <plugin>
319 + <location>/path/to/some-plugin.jar</location>
320 + </plugin>
321 + </plugins>
322 + </pluginManagement>
323 + </bootstrap>
324 + </configuration>
325 +</plugin>
326 +```
327 +
328 +You can also use specify this setting on the command line:
329 +
330 +> mvn fc-server:ms -DaddSystemPlugins=de.xima.fc.plugin:fc-plugin-bundle-leitfaden:2.0.22
331 +
332 +Supported plugin sources:
333 +
334 +* Store coordinate:
335 + * `store:/1ce83c47-7b8d-4da8-844e-723cf5e3c426/2.0.7`(no double slash!)
336 + * in general: `store://[itemKey]/[version]/[fileName]?store=[storeKey]&server=[baseUrl]`
337 + * only the `itemKey` and `version` are required
338 +* Maven coordinate
339 + * `-DaddSystemPlugins=de.xima.fc.plugin:fc-plugin-bundle-leitfaden:2.0.22`
340 +* File:
341 + * `-DaddSystemPlugins=/home/user/Downloads/myPlugin.jar`
342 +* URL:
343 + * `-DaddSystemPlugins=https://example.com/plugin.jar`
344 +
345 +### Use a different or no license
346 +
347 +By default, a demo license is used. To use a different license:
348 +
349 +```xml
350 +<plugin>
351 + <groupId>de.xima.fc.maven.plugin</groupId>
352 + <artifactId>fc-server-maven-plugin</artifactId>
353 + <version>${fc-server-maven-plugin.version}</version>
354 + <configuration>
355 + <licenseFile>/path/to/license.lic</licenseFile>
356 + </configuration>
357 +</plugin>
358 +```
359 +
360 +You can also use specify this setting on the command line:
361 +
362 +> mvn fc-server:ms -DlicenseFile=/path/to/license.lic
363 +
364 +Sometimes you may want to start the server without a preinstalled license:
365 +
366 +```xml
367 +<plugin>
368 + <groupId>de.xima.fc.maven.plugin</groupId>
369 + <artifactId>fc-server-maven-plugin</artifactId>
370 + <version>${fc-server-maven-plugin.version}</version>
371 + <configuration>
372 + <licenseFile>builtin:none</licenseFile>
373 + </configuration>
374 +</plugin>
375 +```
376 +
377 +The value for `licenseFile` can be either
378 +* a file path
379 + * `file:/path/to/license.lic`
380 +* a file URI
381 + * `file:/path/to/license.lic`
382 +* a builtin URI:
383 + * `builtin:<name>`
384 + * `builtin:demo` Uses a simple demo license.
385 + * `builtin:none` Uses no license.
386 +
387 +### Deploy current plugin project on startup
388 +
389 +By default, the `run-ms-war` goal checks whether the current Maven project is a
390 +[FORMCYCLE plugin project](#terms). If so, it automatically picks up the main artifact file
391 +of the project and installs the plugin after the FORMCYCLE app was started.
392 +
393 +To configure this behavior, add the following configuration in your pom:
394 +
395 +```xml
396 +<plugin>
397 + <groupId>de.xima.fc.maven.plugin</groupId>
398 + <artifactId>fc-server-maven-plugin</artifactId>
399 + <version>${fc-server-maven-plugin.version}</version>
400 + <configuration>
401 + <deployMavenProject>true</deployMavenProject>
402 + </configuration>
403 +</plugin>
404 +```
405 +
406 +You can also use specify this setting on the command line:
407 +
408 +> mvn fc-server:run-ms-war -DdeployMavenProject=false
409 +
410 +### Include additional dependencies
411 +
412 +Sometimes you may want to include additional dependencies in the classpath, e.g. for custom servlet container
413 +providers or database drivers.
414 +
415 +You can add additional dependencies on a per-execution basis like this:
416 +
417 +```xml
418 +<plugin>
419 + <groupId>de.xima.fc.maven.plugin</groupId>
420 + <artifactId>fc-server-maven-plugin</artifactId>
421 + <version>${fc-server-maven-plugin.version}</version>
422 + <executions>
423 + <execution>
424 + <goals>
425 + <goal>run-ms-war</goal>
426 + </goals>
427 + <phase>package</phase>
428 + <configuration>
429 + <dependencies>
430 + <dependency>
431 + <groupId>com.ibm.db2</groupId>
432 + <artifactId>jcc</artifactId>
433 + <version>11.5.8.0</version>
434 + </dependency>
435 + </dependencies>
436 + </configuration>
437 + </execution>
438 + </executions>
439 +</plugin>
440 +```
441 +
442 +You can also use specify this setting on the command line (separate multiple dependenies with a comma):
443 +
444 +> mvn fc-server:run-ms-war -DaddDependencies=com.ibm.db2:jcc:com.ibm.db2
445 +
446 +### Skip execution for multi-module projects
447 +
448 +By default, the `run-ms-war` goal skips execution when run on a Maven project that is not a
449 +[FORMCYCLE plugin project](#terms). This can be useful e.g. when you have a multi-module project
450 +where only one project is a FORMYCLE plugin. You can then simply invoke `mvn fc-server:run-ms-war`
451 +on the parent project. This builds the entire project until it reaches the FORMCYCE plugin, at which
452 +point it starts the server and installs the built plugin.
453 +
454 +To disable this default behavior, use `-DskipNonPluginProject=false` or use the following configuration in your pom:
455 +
456 +```xml
457 +<plugin>
458 + <groupId>de.xima.fc.maven.plugin</groupId>
459 + <artifactId>fc-server-maven-plugin</artifactId>
460 + <version>${fc-server-maven-plugin.version}</version>
461 + <configuration>
462 + <skipNonPluginProject>true</skipNonPluginProject>
463 + </configuration>
464 +</plugin>
465 +```
466 +
467 +You can also force the execution to be always skipped via the `skip` parameter in your pom:
468 +
469 +
470 +```xml
471 +<plugin>
472 + <groupId>de.xima.fc.maven.plugin</groupId>
473 + <artifactId>fc-server-maven-plugin</artifactId>
474 + <version>${fc-server-maven-plugin.version}</version>
475 + <configuration>
476 + <skip>true</skip>
477 + </configuration>
478 +</plugin>
479 +```
480 +
481 +You can also use specify this setting on the command line:
482 +
483 +> mvn fc-server:run-ms-war -Dskip.fc.server
484 +
485 +### Remote debugging
486 +
487 +To remote debug the the application server, start it with
488 +
489 +> MAVEN_OPTS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=1044 mvn fc-server:ms
490 +
491 +Then attach the debugger to port 1044.
492 +
493 +Note: When you start this goal from within your IDE, you usually do no need to specify this manually
494 +as your IDE will usually attach to the JVM process automatically already.
495 +
eclipse-archetype-select.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.awa
Größe
... ... @@ -1,0 +1,1 @@
1 +66.8 KB
Inhalt
eclipse-archetype.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.awa
Größe
... ... @@ -1,0 +1,1 @@
1 +74.9 KB
Inhalt