
[id='thorntail-maven-plugin-configuration-options_{context}']
= {Thorntail} Maven plugin configuration options

The {Thorntail} Maven plugin accepts the following configuration options:

bundleDependencies::
If true, dependencies will be included in the `-thorntail.jar` file.
Otherwise, they will be resolved from `$M2_REPO` or the network at runtime.
+
[cols="1,2a"]
|===
|Property
|`swarm.bundleDependencies`

|Default
|true

|Used by
|`package`
|===

debug::
The port to use for debugging.
If set, the swarm process will suspend on start and open a debugger on this port.
+
[cols="1,2a"]
|===
|Property
|`swarm.debug.port`

|Default
|

|Used by
|`run`, `start`
|===

environment::
A properties-style list of environment variables to use when executing the application.
+
[cols="1,2a"]
|===
|Property
|_none_

|Default
|

|Used by
|`multistart`, `run`, `start`
|===

environmentFile::
A `.properties` file with environment variables to use when executing the application.
+
[cols="1,2a"]
|===
|Property
|`swarm.environmentFile`

|Default
|

|Used by
|`multistart`, `run`, `start`
|===

fractionDetectMode::
+
--
The mode of fraction detection. The available options are:

* `when_missing`: Runs only when no {Thorntail} dependencies are found.
* `force`: Always run, and merge any detected fractions with the existing dependencies. Existing dependencies take precedence.
* `never`: Disable fraction detection.

[cols="1,2a"]
|===
|Property
|`swarm.detect.mode`

|Default
|`when_missing`

|Used by
|`package`, `run`, `start`
|===
--

fractions::
+
--
A list of extra fractions to include when auto-detection is used. It is useful for fractions that cannot be detected or user-provided fractions.

The format of specifying a fraction can be:
* `group:artifact:version`
* `artifact:version`
* `artifact`

If no group is provided, `io.thorntail` is assumed.

If no version is provided, the version is taken from the {Thorntail} BOM for the version of the plugin you are using.

If the value starts with the character `!` a corresponding auto-detected fraction is not installed (unless it's a dependency of any other fraction).
In the following example the Undertow fraction is not installed even if your application references a class from the `javax.servlet` package:

[source,xml]
----
<plugin>
  <groupId>io.thorntail</groupId>
  <artifactId>thorntail-maven-plugin</artifactId>
  <version>${version.thorntail}</version>
  <executions>
    <execution>
      <goals>
        <goal>package</goal>
      </goals>
      <configuration>
       <fractions>
         <fraction>!undertow</fraction>
       </fractions>
      </configuration>
    </execution>
  </executions>
</plugin>
----

[cols="1,2a"]
|===
|Property
|_none_

|Default
|

|Used by
|`package`, `run`, `start`
|===
--

ifndef::product[]
hollow::
Specifies if the resulting executable JAR should be hollow, and therefore not include the default deployment.
+
[cols="1,2a"]
|===
|Property
|`swarm.hollow`

|Default
|`false`

|Used by
|`package`
|===
endif::[]

jvmArguments::
A list of `<jvmArgument>` elements specifying additional JVM arguments (such as `-Xmx32m`).
+
[cols="1,2a"]
|===
|Property
|`swarm.jvmArguments`

|Default
|

|Used by
|`multistart`, `run`, `start`
|===

modules::
Paths to a directory containing additional module definitions.
+
[cols="1,2a"]
|===
|Property
|_none_

|Default
|./modules

|Used by
|`package`, `run`, `start`
|===

processes::
Application configurations to start (see xref:maven-plugin-multistart-goal[multistart]).
+
[cols="1,2a"]
|===
|Property
|_none_

|Default
|

|Used by
|`multistart`
|===

properties::
See xref:thorntail-maven-plugin-configuration-properties_{context}[].
+
[cols="1,2a"]
|===
|Property
|_none_

|Default
|

|Used by
|`package`, `run`, `start`
|===

propertiesFile::
See xref:thorntail-maven-plugin-configuration-properties_{context}[].
+
[cols="1,2a"]
|===
|Property
|`swarm.propertiesFile`

|Default
|

|Used by
|`package`, `run`, `start`
|===

stderrFile::
A file path where to store the `stderr` output instead of sending it to the `stderr` output of the launching process.
+
[cols="1,2a"]
|===
|Property
|`swarm.stderr`

|Default
|

|Used by
|`run`, `start`
|===

stdoutFile::
A file path where to store the `stdout` output instead of sending it to the `stdout` output of the launching process.
+
[cols="1,2a"]
|===
|Property
|`swarm.stdout`

|Default
|

|Used by
|`run`, `start`
|===

useUberJar::
If true, the `-thorntail.jar` file specified at `${project.build.directory}` is used.
This JAR is not created automatically, so make sure you execute the `package` goal first.
+
[cols="1,2a"]
|===
|Property
|`wildfly-swarm.useUberJar`

|Default
|false

|Used by
|`run`, `start`
|===

