Änderungen von Dokument Plugin-Entwicklung
Zusammenfassung
-
Anhänge (0 geändert, 1 hinzugefügt, 1 gelöscht)
Details
- README.md
-
- Author
-
... ... @@ -1,1 +1,0 @@ 1 -XWiki.awa - Größe
-
... ... @@ -1,1 +1,0 @@ 1 -15.7 KB - Inhalt
-
... ... @@ -1,526 +1,0 @@ 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 -See [changelog](./CHANGELOG.md) for a list of versions. 20 - 21 -## Table of contents 22 - 23 -[[_TOC_]] 24 - 25 -## Versioning 26 - 27 -* The major and minor version are always equal to the FORMCYCLE major version against which the project was built. 28 -* The patch version is for the plugin. 29 - 30 -## Building 31 - 32 -```bash 33 -mvn clean install 34 -``` 35 - 36 -## Release 37 - 38 -* Update version via `mvn versions:set -DnewVersion=1.2.3` 39 -* Add release notes to `CHANGELOG.md` 40 -* Upload code to github 41 -* `mvn clean deploy` 42 -* Add a tag `git tag -a 1.2.3` and push via `git push origin 1.2.3` 43 -* Set next development version `mvn versions:set -DnewVersion=1.2.4-SNAPSHOT` 44 - 45 -## Site 46 - 47 -```bash 48 -mvn site 49 -mvn site:stage 50 -``` 51 - 52 -The open `target/staging/index.html` in a browser. See `target/staging/fc-server-maven-plugin/plugin-info.html` 53 -for the MOJO documentation. 54 - 55 -## Terms 56 - 57 -A "FORMCYCLE plugin project" is Maven project packaged as a fat jar, with a (possibly transitive) 58 -compile dependency on `de.xima.fc:fc-plugin-common` in the `provided` scope. 59 - 60 -A Maven project "packaged as a fat jar" is Maven project with its `packaging` set to `jar` and 61 -that includes a plugin execution for either the `maven-assembly-plugin` or the `maven-shade-plugin`. 62 - 63 -## Goals 64 - 65 -See the site above for more in-depth info. 66 - 67 -* `ms` Intended for use as a command line tool to start a server without a Maven project: 68 - `mvn fc-server:ms`. 69 -* `run-ms-war` Intended for use as a command line tool to start a server on an existing 70 - [FORMCYCLE plugin project](#terms): `mvn fc-server:ms`. 71 -* `start-ms-war` Goal for integration into an existing lifecycle defined in a pom.xml, should be 72 - bound to a particular phase. Does not block by default. 73 - 74 -## Usage 75 - 76 -This is a Maven plugin with several goals. You can run it via the command line: 77 - 78 -```bash 79 -# When you have no Maven project 80 -mvn fc-server:ms 81 - 82 -# When you have an existing FORMYCLE plugin project 83 -mvn fc-server:run-ms-war 84 -``` 85 - 86 -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. 87 - 88 -The first command can be used in a directory without a Maven project. 89 - 90 -If the second command is run on an existing [FORMCYCLE plugin project](#terms), it first packages that project, then 91 -starts the server and finally installs the main artifact file of the Maven project automatically into the started 92 -FORMCYCLE instance. 93 - 94 -If Maven cannot find the plugin or you need to run a specific version of the plugin, you have to use the full coordinates: 95 - 96 -> mvn de.xima.fc.maven.plugin:fc-server-maven-plugin:8.0.0-SNAPSHOT:run-ms-war 97 - 98 -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`: 99 - 100 -```xml 101 -<settings> 102 - <pluginGroups> 103 - <pluginGroup>de.xima.fc.maven.plugin</pluginGroup> 104 - </pluginGroups> 105 -</settings> 106 -``` 107 - 108 -If you want to configure the plugin, you can do so via a `<plugin>` section in the `pom.xml`. See the 109 -site above for documentation. Below are some example configurations. 110 - 111 -### Use a different FORMCYCLE version 112 - 113 -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. 114 - 115 -To set the version of the FORMCYCLE app: 116 - 117 -```xml 118 -<plugin> 119 - <groupId>de.xima.fc.maven.plugin</groupId> 120 - <artifactId>fc-server-maven-plugin</artifactId> 121 - <version>${fc-server-maven-plugin.version}</version> 122 - <configuration> 123 - <xfcVersion>7.0.7</xfcVersion> 124 - </configuration> 125 -</plugin> 126 -``` 127 - 128 -Note that you can also use: 129 - 130 -> mvn fc-server:ms -DxfcVersion=7.0.7 131 - 132 -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) 133 - 134 -> mvn de.xima.fc.maven.plugin:fc-server-maven-plugin:7.0.4:ms -DxfcVersion=7.0.16 135 - 136 -### Use a custom FORMCYCLE war file 137 - 138 -If you need to, you can also use a custom FORMCYCLE WAR file, e.g. a local build etc. 139 - 140 - 141 -```xml 142 -<plugin> 143 - <groupId>de.xima.fc.maven.plugin</groupId> 144 - <artifactId>fc-server-maven-plugin</artifactId> 145 - <version>${fc-server-maven-plugin.version}</version> 146 - <configuration> 147 - <warFile>/path/to/formcycle.war</warFile> 148 - </configuration> 149 -</plugin> 150 -``` 151 - 152 -You can also use specify this setting on the command line: 153 - 154 -> mvn fc-server:ms -DwarFile=/path/to/formcycle.war 155 - 156 -### Change servlet container settings 157 - 158 -You can change the server context path and port: 159 - 160 -```xml 161 -<plugin> 162 - <groupId>de.xima.fc.maven.plugin</groupId> 163 - <artifactId>fc-server-maven-plugin</artifactId> 164 - <version>${fc-server-maven-plugin.version}</version> 165 - <configuration> 166 - <contextPath>form-server</contextPath> 167 - <port>8099</port> 168 - </configuration> 169 -</plugin> 170 -``` 171 - 172 -You can also use specify these settings on the command line: 173 - 174 -> mvn fc-server:ms -DcontextPath=form-server -Dport=8090 175 - 176 -### Change app persistence directory 177 - 178 -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. 179 - 180 -```xml 181 -<plugin> 182 - <groupId>de.xima.fc.maven.plugin</groupId> 183 - <artifactId>fc-server-maven-plugin</artifactId> 184 - <version>${fc-server-maven-plugin.version}</version> 185 - <configuration> 186 - <appDir>${project.basedir}/xfc-server</appDir> 187 - </configuration> 188 -</plugin> 189 -``` 190 - 191 -You can also use specify this setting on the command line: 192 - 193 -> mvn fc-server:ms -DappDir=target/apps/xfc-server 194 - 195 -### Use a different servlet container 196 - 197 -By default, Jetty is used, but this can be changed: 198 - 199 -```xml 200 -<plugin> 201 - <groupId>de.xima.fc.maven.plugin</groupId> 202 - <artifactId>fc-server-maven-plugin</artifactId> 203 - <version>${fc-server-maven-plugin.version}</version> 204 - <configuration> 205 - <container>tomcat:9</container> 206 - </configuration> 207 -</plugin> 208 -``` 209 - 210 -You can also use specify this setting on the command line: 211 - 212 -> mvn fc-server:ms -Dcontainer=tomcat:9 213 - 214 -By default, supported values are currently 215 - 216 -* `jetty:10` - Jetty Servlet Container Version 10.x 217 -* `tomcat:9` - Apache Tomcat Version 9.x 218 - 219 -To use a custom container, include a `de.xima.servletcontainer.api.IServletContainerProvider` in 220 -the classpath and specify the corresponding name. 221 - 222 -### Use in-memory H2 database 223 - 224 -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: 225 - 226 -```xml 227 -<plugin> 228 - <groupId>de.xima.fc.maven.plugin</groupId> 229 - <artifactId>fc-server-maven-plugin</artifactId> 230 - <version>${fc-server-maven-plugin.version}</version> 231 - <configuration> 232 - <h2Storage>ram</h2Storage> 233 - </configuration> 234 -</plugin> 235 -``` 236 - 237 -You can also use specify this setting on the command line: 238 - 239 -> mvn fc-server:ms -Dh2Storage=ram 240 - 241 -### Use a different database 242 - 243 -Include the driver via `dbDrivers` and configure the `database.properties`: 244 - 245 -```xml 246 -<plugin> 247 - <groupId>de.xima.fc.maven.plugin</groupId> 248 - <artifactId>fc-server-maven-plugin</artifactId> 249 - <version>${fc-server-maven-plugin.version}</version> 250 - <configuration> 251 - <dbDrivers> 252 - <dbDriver>postgresql</dbDriver> 253 - </dbDrivers> 254 - <databaseProperties> 255 - <properties> 256 - <property> 257 - <name>db.connection.dbms.shortname</name> 258 - <value>postgresql</value> 259 - </property> 260 - <property> 261 - <name>db.connection.jdbcurl</name> 262 - <value>jdbc:postgresql://localhost:5432/my_database</value> 263 - </property> 264 - <property> 265 - <name>db.connection.login.username</name> 266 - <value>USERNAME</value> 267 - </property> 268 - <property> 269 - <name>db.connection.login.password</name> 270 - <value>PASSWORD</value> 271 - </property> 272 - </properties> 273 - </databaseProperties> 274 - </configuration> 275 -</plugin> 276 -``` 277 - 278 -You can also use specify this setting on the command line (separate multiple drivers with a comma): 279 - 280 -> mvn fc-server:ms -DaddDbDrivers=postgresql,h2 -DdbShortname=postgresql -DdbJdbcUrl=jdbc:postgresql://localhost:5432/my_database -DdbUsername=USERNAME -DdbPassword=PASSWORD 281 - 282 -Supported database drivers are 283 - 284 -* `h2` 285 -* `mariadb` 286 -* `mysql` 287 -* `oracle` 288 -* `postgresql` 289 -* `sqlserver` 290 -* `custom` (does not add any driver, add your own driver via `dependencies`) 291 - 292 -### Create default clients 293 - 294 -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`. 295 - 296 -```xml 297 -<plugin> 298 - <groupId>de.xima.fc.maven.plugin</groupId> 299 - <artifactId>fc-server-maven-plugin</artifactId> 300 - <version>${fc-server-maven-plugin.version}</version> 301 - <configuration> 302 - <bootstrap> 303 - <clientManagement> 304 - <!-- Do not create the default client --> 305 - <excludeDefaults>true</excludeDefaults> 306 - <clients> 307 - <!-- Create a default client --> 308 - <client> 309 - <baseSettings> 310 - <name>myforms</name> 311 - <alias>Formular</alias> 312 - <languageTag>de</languageTag> 313 - <baseUrl>http://10.42.42.50/form-server</baseUrl> 314 - <description>Client for testing forms</description> 315 - </baseSettings> 316 - <adminUser> 317 - <userName>awa</userName> 318 - <email>awa@xima.de</email> 319 - <givenName>Andre</givenName> 320 - <lastName>Wachsmuth</lastName> 321 - <password>12345678</password> 322 - </adminUser> 323 - </client> 324 - </clients> 325 - </clientManagement> 326 - </bootstrap> 327 - </configuration> 328 -</plugin> 329 -``` 330 - 331 -### Including additional plugins 332 - 333 -You can include additional plugins that should be installed after the FORMYCLE app was started: 334 - 335 -```xml 336 -<plugin> 337 - <groupId>de.xima.fc.maven.plugin</groupId> 338 - <artifactId>fc-server-maven-plugin</artifactId> 339 - <version>${fc-server-maven-plugin.version}</version> 340 - <configuration> 341 - <bootstrap> 342 - <pluginManagement> 343 - <plugins> 344 - <!-- You can specify a Maven coordinate when the plugin is available via Maven --> 345 - <plugin> 346 - <location>de.xima.fc.plugin:fc-plugin-bundle-leitfaden:2.0.22</location> 347 - </plugin> 348 - <!-- You can also specify a local path --> 349 - <plugin> 350 - <location>/path/to/some-plugin.jar</location> 351 - </plugin> 352 - </plugins> 353 - </pluginManagement> 354 - </bootstrap> 355 - </configuration> 356 -</plugin> 357 -``` 358 - 359 -You can also use specify this setting on the command line: 360 - 361 -> mvn fc-server:ms -DaddSystemPlugins=de.xima.fc.plugin:fc-plugin-bundle-leitfaden:2.0.22 362 - 363 -Supported plugin sources: 364 - 365 -* Store coordinate: 366 - * `store:/1ce83c47-7b8d-4da8-844e-723cf5e3c426/2.0.7`(no double slash!) 367 - * in general: `store://[itemKey]/[version]/[fileName]?store=[storeKey]&server=[baseUrl]` 368 - * only the `itemKey` and `version` are required 369 -* Maven coordinate 370 - * `-DaddSystemPlugins=de.xima.fc.plugin:fc-plugin-bundle-leitfaden:2.0.22` 371 -* File: 372 - * `-DaddSystemPlugins=/home/user/Downloads/myPlugin.jar` 373 -* URL: 374 - * `-DaddSystemPlugins=https://example.com/plugin.jar` 375 - 376 -### Use a different or no license 377 - 378 -By default, a demo license is used. To use a different license: 379 - 380 -```xml 381 -<plugin> 382 - <groupId>de.xima.fc.maven.plugin</groupId> 383 - <artifactId>fc-server-maven-plugin</artifactId> 384 - <version>${fc-server-maven-plugin.version}</version> 385 - <configuration> 386 - <licenseFile>/path/to/license.lic</licenseFile> 387 - </configuration> 388 -</plugin> 389 -``` 390 - 391 -You can also use specify this setting on the command line: 392 - 393 -> mvn fc-server:ms -DlicenseFile=/path/to/license.lic 394 - 395 -Sometimes you may want to start the server without a preinstalled license: 396 - 397 -```xml 398 -<plugin> 399 - <groupId>de.xima.fc.maven.plugin</groupId> 400 - <artifactId>fc-server-maven-plugin</artifactId> 401 - <version>${fc-server-maven-plugin.version}</version> 402 - <configuration> 403 - <licenseFile>builtin:none</licenseFile> 404 - </configuration> 405 -</plugin> 406 -``` 407 - 408 -The value for `licenseFile` can be either 409 -* a file path 410 - * `file:/path/to/license.lic` 411 -* a file URI 412 - * `file:/path/to/license.lic` 413 -* a builtin URI: 414 - * `builtin:<name>` 415 - * `builtin:demo` Uses a simple demo license. 416 - * `builtin:none` Uses no license. 417 - 418 -### Deploy current plugin project on startup 419 - 420 -By default, the `run-ms-war` goal checks whether the current Maven project is a 421 -[FORMCYCLE plugin project](#terms). If so, it automatically picks up the main artifact file 422 -of the project and installs the plugin after the FORMCYCLE app was started. 423 - 424 -To configure this behavior, add the following configuration in your pom: 425 - 426 -```xml 427 -<plugin> 428 - <groupId>de.xima.fc.maven.plugin</groupId> 429 - <artifactId>fc-server-maven-plugin</artifactId> 430 - <version>${fc-server-maven-plugin.version}</version> 431 - <configuration> 432 - <deployMavenProject>true</deployMavenProject> 433 - </configuration> 434 -</plugin> 435 -``` 436 - 437 -You can also use specify this setting on the command line: 438 - 439 -> mvn fc-server:run-ms-war -DdeployMavenProject=false 440 - 441 -### Include additional dependencies 442 - 443 -Sometimes you may want to include additional dependencies in the classpath, e.g. for custom servlet container 444 -providers or database drivers. 445 - 446 -You can add additional dependencies on a per-execution basis like this: 447 - 448 -```xml 449 -<plugin> 450 - <groupId>de.xima.fc.maven.plugin</groupId> 451 - <artifactId>fc-server-maven-plugin</artifactId> 452 - <version>${fc-server-maven-plugin.version}</version> 453 - <executions> 454 - <execution> 455 - <goals> 456 - <goal>run-ms-war</goal> 457 - </goals> 458 - <phase>package</phase> 459 - <configuration> 460 - <dependencies> 461 - <dependency> 462 - <groupId>com.ibm.db2</groupId> 463 - <artifactId>jcc</artifactId> 464 - <version>11.5.8.0</version> 465 - </dependency> 466 - </dependencies> 467 - </configuration> 468 - </execution> 469 - </executions> 470 -</plugin> 471 -``` 472 - 473 -You can also use specify this setting on the command line (separate multiple dependenies with a comma): 474 - 475 -> mvn fc-server:run-ms-war -DaddDependencies=com.ibm.db2:jcc:com.ibm.db2 476 - 477 -### Skip execution for multi-module projects 478 - 479 -By default, the `run-ms-war` goal skips execution when run on a Maven project that is not a 480 -[FORMCYCLE plugin project](#terms). This can be useful e.g. when you have a multi-module project 481 -where only one project is a FORMYCLE plugin. You can then simply invoke `mvn fc-server:run-ms-war` 482 -on the parent project. This builds the entire project until it reaches the FORMCYCE plugin, at which 483 -point it starts the server and installs the built plugin. 484 - 485 -To disable this default behavior, use `-DskipNonPluginProject=false` or use the following configuration in your pom: 486 - 487 -```xml 488 -<plugin> 489 - <groupId>de.xima.fc.maven.plugin</groupId> 490 - <artifactId>fc-server-maven-plugin</artifactId> 491 - <version>${fc-server-maven-plugin.version}</version> 492 - <configuration> 493 - <skipNonPluginProject>true</skipNonPluginProject> 494 - </configuration> 495 -</plugin> 496 -``` 497 - 498 -You can also force the execution to be always skipped via the `skip` parameter in your pom: 499 - 500 - 501 -```xml 502 -<plugin> 503 - <groupId>de.xima.fc.maven.plugin</groupId> 504 - <artifactId>fc-server-maven-plugin</artifactId> 505 - <version>${fc-server-maven-plugin.version}</version> 506 - <configuration> 507 - <skip>true</skip> 508 - </configuration> 509 -</plugin> 510 -``` 511 - 512 -You can also use specify this setting on the command line: 513 - 514 -> mvn fc-server:run-ms-war -Dskip.fc.server 515 - 516 -### Remote debugging 517 - 518 -To remote debug the the application server, start it with 519 - 520 -> MAVEN_OPTS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=1044 mvn fc-server:ms 521 - 522 -Then attach the debugger to port 1044. 523 - 524 -Note: When you start this goal from within your IDE, you usually do no need to specify this manually 525 -as your IDE will usually attach to the JVM process automatically already. 526 -
- README-FC-SERVER.md
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +XWiki.awa - Größe
-
... ... @@ -1,0 +1,1 @@ 1 +15.2 KB - Inhalt
-
... ... @@ -1,0 +1,497 @@ 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 +See [changelog](./CHANGELOG.md) for a list of versions. 20 + 21 +## Versioning 22 + 23 +* The major and minor version are always equal to the FORMCYCLE major version against which the project was built. 24 +* The patch version is for the plugin. 25 + 26 +## Terms 27 + 28 +A "FORMCYCLE plugin project" is Maven project packaged as a fat jar, with a (possibly transitive) 29 +compile dependency on `de.xima.fc:fc-plugin-common` in the `provided` scope. 30 + 31 +A Maven project "packaged as a fat jar" is Maven project with its `packaging` set to `jar` and 32 +that includes a plugin execution for either the `maven-assembly-plugin` or the `maven-shade-plugin`. 33 + 34 +## Goals 35 + 36 +See the site above for more in-depth info. 37 + 38 +* `ms` Intended for use as a command line tool to start a server without a Maven project: 39 + `mvn fc-server:ms`. 40 +* `run-ms-war` Intended for use as a command line tool to start a server on an existing 41 + [FORMCYCLE plugin project](#terms): `mvn fc-server:ms`. 42 +* `start-ms-war` Goal for integration into an existing lifecycle defined in a pom.xml, should be 43 + bound to a particular phase. Does not block by default. 44 + 45 +## Usage 46 + 47 +This is a Maven plugin with several goals. You can run it via the command line: 48 + 49 +```bash 50 +# When you have no Maven project 51 +mvn fc-server:ms 52 + 53 +# When you have an existing FORMYCLE plugin project 54 +mvn fc-server:run-ms-war 55 +``` 56 + 57 +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. 58 + 59 +The first command can be used in a directory without a Maven project. 60 + 61 +If the second command is run on an existing [FORMCYCLE plugin project](#terms), it first packages that project, then 62 +starts the server and finally installs the main artifact file of the Maven project automatically into the started 63 +FORMCYCLE instance. 64 + 65 +If Maven cannot find the plugin or you need to run a specific version of the plugin, you have to use the full coordinates: 66 + 67 +> mvn de.xima.fc.maven.plugin:fc-server-maven-plugin:8.0.0-SNAPSHOT:run-ms-war 68 + 69 +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`: 70 + 71 +```xml 72 +<settings> 73 + <pluginGroups> 74 + <pluginGroup>de.xima.fc.maven.plugin</pluginGroup> 75 + </pluginGroups> 76 +</settings> 77 +``` 78 + 79 +If you want to configure the plugin, you can do so via a `<plugin>` section in the `pom.xml`. See the 80 +site above for documentation. Below are some example configurations. 81 + 82 +### Use a different FORMCYCLE version 83 + 84 +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. 85 + 86 +To set the version of the FORMCYCLE app: 87 + 88 +```xml 89 +<plugin> 90 + <groupId>de.xima.fc.maven.plugin</groupId> 91 + <artifactId>fc-server-maven-plugin</artifactId> 92 + <version>${fc-server-maven-plugin.version}</version> 93 + <configuration> 94 + <xfcVersion>7.0.7</xfcVersion> 95 + </configuration> 96 +</plugin> 97 +``` 98 + 99 +Note that you can also use: 100 + 101 +> mvn fc-server:ms -DxfcVersion=7.0.7 102 + 103 +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) 104 + 105 +> mvn de.xima.fc.maven.plugin:fc-server-maven-plugin:7.0.4:ms -DxfcVersion=7.0.16 106 + 107 +### Use a custom FORMCYCLE war file 108 + 109 +If you need to, you can also use a custom FORMCYCLE WAR file, e.g. a local build etc. 110 + 111 + 112 +```xml 113 +<plugin> 114 + <groupId>de.xima.fc.maven.plugin</groupId> 115 + <artifactId>fc-server-maven-plugin</artifactId> 116 + <version>${fc-server-maven-plugin.version}</version> 117 + <configuration> 118 + <warFile>/path/to/formcycle.war</warFile> 119 + </configuration> 120 +</plugin> 121 +``` 122 + 123 +You can also use specify this setting on the command line: 124 + 125 +> mvn fc-server:ms -DwarFile=/path/to/formcycle.war 126 + 127 +### Change servlet container settings 128 + 129 +You can change the server context path and port: 130 + 131 +```xml 132 +<plugin> 133 + <groupId>de.xima.fc.maven.plugin</groupId> 134 + <artifactId>fc-server-maven-plugin</artifactId> 135 + <version>${fc-server-maven-plugin.version}</version> 136 + <configuration> 137 + <contextPath>form-server</contextPath> 138 + <port>8099</port> 139 + </configuration> 140 +</plugin> 141 +``` 142 + 143 +You can also use specify these settings on the command line: 144 + 145 +> mvn fc-server:ms -DcontextPath=form-server -Dport=8090 146 + 147 +### Change app persistence directory 148 + 149 +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. 150 + 151 +```xml 152 +<plugin> 153 + <groupId>de.xima.fc.maven.plugin</groupId> 154 + <artifactId>fc-server-maven-plugin</artifactId> 155 + <version>${fc-server-maven-plugin.version}</version> 156 + <configuration> 157 + <appDir>${project.basedir}/xfc-server</appDir> 158 + </configuration> 159 +</plugin> 160 +``` 161 + 162 +You can also use specify this setting on the command line: 163 + 164 +> mvn fc-server:ms -DappDir=target/apps/xfc-server 165 + 166 +### Use a different servlet container 167 + 168 +By default, Jetty is used, but this can be changed: 169 + 170 +```xml 171 +<plugin> 172 + <groupId>de.xima.fc.maven.plugin</groupId> 173 + <artifactId>fc-server-maven-plugin</artifactId> 174 + <version>${fc-server-maven-plugin.version}</version> 175 + <configuration> 176 + <container>tomcat:9</container> 177 + </configuration> 178 +</plugin> 179 +``` 180 + 181 +You can also use specify this setting on the command line: 182 + 183 +> mvn fc-server:ms -Dcontainer=tomcat:9 184 + 185 +By default, supported values are currently 186 + 187 +* `jetty:10` - Jetty Servlet Container Version 10.x 188 +* `tomcat:9` - Apache Tomcat Version 9.x 189 + 190 +To use a custom container, include a `de.xima.servletcontainer.api.IServletContainerProvider` in 191 +the classpath and specify the corresponding name. 192 + 193 +### Use in-memory H2 database 194 + 195 +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: 196 + 197 +```xml 198 +<plugin> 199 + <groupId>de.xima.fc.maven.plugin</groupId> 200 + <artifactId>fc-server-maven-plugin</artifactId> 201 + <version>${fc-server-maven-plugin.version}</version> 202 + <configuration> 203 + <h2Storage>ram</h2Storage> 204 + </configuration> 205 +</plugin> 206 +``` 207 + 208 +You can also use specify this setting on the command line: 209 + 210 +> mvn fc-server:ms -Dh2Storage=ram 211 + 212 +### Use a different database 213 + 214 +Include the driver via `dbDrivers` and configure the `database.properties`: 215 + 216 +```xml 217 +<plugin> 218 + <groupId>de.xima.fc.maven.plugin</groupId> 219 + <artifactId>fc-server-maven-plugin</artifactId> 220 + <version>${fc-server-maven-plugin.version}</version> 221 + <configuration> 222 + <dbDrivers> 223 + <dbDriver>postgresql</dbDriver> 224 + </dbDrivers> 225 + <databaseProperties> 226 + <properties> 227 + <property> 228 + <name>db.connection.dbms.shortname</name> 229 + <value>postgresql</value> 230 + </property> 231 + <property> 232 + <name>db.connection.jdbcurl</name> 233 + <value>jdbc:postgresql://localhost:5432/my_database</value> 234 + </property> 235 + <property> 236 + <name>db.connection.login.username</name> 237 + <value>USERNAME</value> 238 + </property> 239 + <property> 240 + <name>db.connection.login.password</name> 241 + <value>PASSWORD</value> 242 + </property> 243 + </properties> 244 + </databaseProperties> 245 + </configuration> 246 +</plugin> 247 +``` 248 + 249 +You can also use specify this setting on the command line (separate multiple drivers with a comma): 250 + 251 +> mvn fc-server:ms -DaddDbDrivers=postgresql,h2 -DdbShortname=postgresql -DdbJdbcUrl=jdbc:postgresql://localhost:5432/my_database -DdbUsername=USERNAME -DdbPassword=PASSWORD 252 + 253 +Supported database drivers are 254 + 255 +* `h2` 256 +* `mariadb` 257 +* `mysql` 258 +* `oracle` 259 +* `postgresql` 260 +* `sqlserver` 261 +* `custom` (does not add any driver, add your own driver via `dependencies`) 262 + 263 +### Create default clients 264 + 265 +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`. 266 + 267 +```xml 268 +<plugin> 269 + <groupId>de.xima.fc.maven.plugin</groupId> 270 + <artifactId>fc-server-maven-plugin</artifactId> 271 + <version>${fc-server-maven-plugin.version}</version> 272 + <configuration> 273 + <bootstrap> 274 + <clientManagement> 275 + <!-- Do not create the default client --> 276 + <excludeDefaults>true</excludeDefaults> 277 + <clients> 278 + <!-- Create a default client --> 279 + <client> 280 + <baseSettings> 281 + <name>myforms</name> 282 + <alias>Formular</alias> 283 + <languageTag>de</languageTag> 284 + <baseUrl>http://10.42.42.50/form-server</baseUrl> 285 + <description>Client for testing forms</description> 286 + </baseSettings> 287 + <adminUser> 288 + <userName>awa</userName> 289 + <email>awa@xima.de</email> 290 + <givenName>Andre</givenName> 291 + <lastName>Wachsmuth</lastName> 292 + <password>12345678</password> 293 + </adminUser> 294 + </client> 295 + </clients> 296 + </clientManagement> 297 + </bootstrap> 298 + </configuration> 299 +</plugin> 300 +``` 301 + 302 +### Including additional plugins 303 + 304 +You can include additional plugins that should be installed after the FORMYCLE app was started: 305 + 306 +```xml 307 +<plugin> 308 + <groupId>de.xima.fc.maven.plugin</groupId> 309 + <artifactId>fc-server-maven-plugin</artifactId> 310 + <version>${fc-server-maven-plugin.version}</version> 311 + <configuration> 312 + <bootstrap> 313 + <pluginManagement> 314 + <plugins> 315 + <!-- You can specify a Maven coordinate when the plugin is available via Maven --> 316 + <plugin> 317 + <location>de.xima.fc.plugin:fc-plugin-bundle-leitfaden:2.0.22</location> 318 + </plugin> 319 + <!-- You can also specify a local path --> 320 + <plugin> 321 + <location>/path/to/some-plugin.jar</location> 322 + </plugin> 323 + </plugins> 324 + </pluginManagement> 325 + </bootstrap> 326 + </configuration> 327 +</plugin> 328 +``` 329 + 330 +You can also use specify this setting on the command line: 331 + 332 +> mvn fc-server:ms -DaddSystemPlugins=de.xima.fc.plugin:fc-plugin-bundle-leitfaden:2.0.22 333 + 334 +Supported plugin sources: 335 + 336 +* Store coordinate: 337 + * `store:/1ce83c47-7b8d-4da8-844e-723cf5e3c426/2.0.7`(no double slash!) 338 + * in general: `store://[itemKey]/[version]/[fileName]?store=[storeKey]&server=[baseUrl]` 339 + * only the `itemKey` and `version` are required 340 +* Maven coordinate 341 + * `-DaddSystemPlugins=de.xima.fc.plugin:fc-plugin-bundle-leitfaden:2.0.22` 342 +* File: 343 + * `-DaddSystemPlugins=/home/user/Downloads/myPlugin.jar` 344 +* URL: 345 + * `-DaddSystemPlugins=https://example.com/plugin.jar` 346 + 347 +### Use a different or no license 348 + 349 +By default, a demo license is used. To use a different license: 350 + 351 +```xml 352 +<plugin> 353 + <groupId>de.xima.fc.maven.plugin</groupId> 354 + <artifactId>fc-server-maven-plugin</artifactId> 355 + <version>${fc-server-maven-plugin.version}</version> 356 + <configuration> 357 + <licenseFile>/path/to/license.lic</licenseFile> 358 + </configuration> 359 +</plugin> 360 +``` 361 + 362 +You can also use specify this setting on the command line: 363 + 364 +> mvn fc-server:ms -DlicenseFile=/path/to/license.lic 365 + 366 +Sometimes you may want to start the server without a preinstalled license: 367 + 368 +```xml 369 +<plugin> 370 + <groupId>de.xima.fc.maven.plugin</groupId> 371 + <artifactId>fc-server-maven-plugin</artifactId> 372 + <version>${fc-server-maven-plugin.version}</version> 373 + <configuration> 374 + <licenseFile>builtin:none</licenseFile> 375 + </configuration> 376 +</plugin> 377 +``` 378 + 379 +The value for `licenseFile` can be either 380 +* a file path 381 + * `file:/path/to/license.lic` 382 +* a file URI 383 + * `file:/path/to/license.lic` 384 +* a builtin URI: 385 + * `builtin:<name>` 386 + * `builtin:demo` Uses a simple demo license. 387 + * `builtin:none` Uses no license. 388 + 389 +### Deploy current plugin project on startup 390 + 391 +By default, the `run-ms-war` goal checks whether the current Maven project is a 392 +[FORMCYCLE plugin project](#terms). If so, it automatically picks up the main artifact file 393 +of the project and installs the plugin after the FORMCYCLE app was started. 394 + 395 +To configure this behavior, add the following configuration in your pom: 396 + 397 +```xml 398 +<plugin> 399 + <groupId>de.xima.fc.maven.plugin</groupId> 400 + <artifactId>fc-server-maven-plugin</artifactId> 401 + <version>${fc-server-maven-plugin.version}</version> 402 + <configuration> 403 + <deployMavenProject>true</deployMavenProject> 404 + </configuration> 405 +</plugin> 406 +``` 407 + 408 +You can also use specify this setting on the command line: 409 + 410 +> mvn fc-server:run-ms-war -DdeployMavenProject=false 411 + 412 +### Include additional dependencies 413 + 414 +Sometimes you may want to include additional dependencies in the classpath, e.g. for custom servlet container 415 +providers or database drivers. 416 + 417 +You can add additional dependencies on a per-execution basis like this: 418 + 419 +```xml 420 +<plugin> 421 + <groupId>de.xima.fc.maven.plugin</groupId> 422 + <artifactId>fc-server-maven-plugin</artifactId> 423 + <version>${fc-server-maven-plugin.version}</version> 424 + <executions> 425 + <execution> 426 + <goals> 427 + <goal>run-ms-war</goal> 428 + </goals> 429 + <phase>package</phase> 430 + <configuration> 431 + <dependencies> 432 + <dependency> 433 + <groupId>com.ibm.db2</groupId> 434 + <artifactId>jcc</artifactId> 435 + <version>11.5.8.0</version> 436 + </dependency> 437 + </dependencies> 438 + </configuration> 439 + </execution> 440 + </executions> 441 +</plugin> 442 +``` 443 + 444 +You can also use specify this setting on the command line (separate multiple dependenies with a comma): 445 + 446 +> mvn fc-server:run-ms-war -DaddDependencies=com.ibm.db2:jcc:com.ibm.db2 447 + 448 +### Skip execution for multi-module projects 449 + 450 +By default, the `run-ms-war` goal skips execution when run on a Maven project that is not a 451 +[FORMCYCLE plugin project](#terms). This can be useful e.g. when you have a multi-module project 452 +where only one project is a FORMYCLE plugin. You can then simply invoke `mvn fc-server:run-ms-war` 453 +on the parent project. This builds the entire project until it reaches the FORMCYCE plugin, at which 454 +point it starts the server and installs the built plugin. 455 + 456 +To disable this default behavior, use `-DskipNonPluginProject=false` or use the following configuration in your pom: 457 + 458 +```xml 459 +<plugin> 460 + <groupId>de.xima.fc.maven.plugin</groupId> 461 + <artifactId>fc-server-maven-plugin</artifactId> 462 + <version>${fc-server-maven-plugin.version}</version> 463 + <configuration> 464 + <skipNonPluginProject>true</skipNonPluginProject> 465 + </configuration> 466 +</plugin> 467 +``` 468 + 469 +You can also force the execution to be always skipped via the `skip` parameter in your pom: 470 + 471 + 472 +```xml 473 +<plugin> 474 + <groupId>de.xima.fc.maven.plugin</groupId> 475 + <artifactId>fc-server-maven-plugin</artifactId> 476 + <version>${fc-server-maven-plugin.version}</version> 477 + <configuration> 478 + <skip>true</skip> 479 + </configuration> 480 +</plugin> 481 +``` 482 + 483 +You can also use specify this setting on the command line: 484 + 485 +> mvn fc-server:run-ms-war -Dskip.fc.server 486 + 487 +### Remote debugging 488 + 489 +To remote debug the the application server, start it with 490 + 491 +> MAVEN_OPTS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=1044 mvn fc-server:ms 492 + 493 +Then attach the debugger to port 1044. 494 + 495 +Note: When you start this goal from within your IDE, you usually do no need to specify this manually 496 +as your IDE will usually attach to the JVM process automatically already. 497 +