mn:run
Full name:
io.micronaut.maven:micronaut-maven-plugin:4.7.1:run
Description:
Executes a Micronaut application in development mode.
It watches for changes in the project tree. If there are changes in the pom.xml
file, dependencies will be reloaded. If the changes are anywhere underneath src/main
, it will recompile the project and restart the application.
The plugin can handle changes in all the languages supported by Micronaut: Java, Kotlin and Groovy.
Attributes:
- Requires a Maven project to be executed.
- Executes as an aggregator goal.
- Requires dependency resolution of artifacts in scope:
compile+runtime
. - The goal is not marked as thread-safe and thus does not support parallel builds.
- Since version:
1.0.0
. - Binds by default to the lifecycle phase:
prepare-package
. - Invokes the execution of the following lifecycle phase prior to executing itself:
process-classes
.
Required Parameters
Name | Type | Since | Description |
---|---|---|---|
<buildDirectory> |
File |
- |
No description. Default: ${project.build.directory} |
<testResourcesVersion> |
String |
- |
Micronaut Test Resources version. Should be defined by the Micronaut BOM, but this parameter can be used to define a different version. User Property: micronaut.test.resources.version |
Optional Parameters
Name | Type | Since | Description |
---|---|---|---|
<aotEnabled> |
boolean |
- |
Whether to enable or disable Micronaut AOT. Default: false User Property: micronaut.aot.enabled |
<appArguments> |
String |
- |
List of additional arguments that will be passed to the application, after the class name. User Property: mn.appArgs |
<classpathInference> |
Boolean |
- |
If set to true, Micronaut will attempt to infer which dependencies should be added to the Test Resources server classpath, based on the project dependencies. In general the result will consist of modules from the test-resources project, but it may consist of additional entries, for example database drivers. Default: true |
<clientTimeout> |
Integer |
- |
Configures the maximum amount of time to wait for the server to start a test resource. Some containers may take a long amount of time to start with slow internet connections. Default: 60 User Property: micronaut.test.resources.client-timeout |
<debug> |
boolean |
- |
Whether to start the Micronaut application in debug mode. Default: false User Property: mn.debug |
<debugHost> |
String |
- |
The host where remote debuggers can connect. Default: 127.0.0.1 User Property: mn.debug.host |
<debugPort> |
int |
- |
The port where remote debuggers can be attached to. Default: 5005 User Property: mn.debug.port |
<debugServer> |
boolean |
4.2.0 |
Allows starting the test resources server in debug mode. The server will be started with the ability to attach a remote debugger on port 8000. Default: false User Property: micronaut.test.resources.debug-server |
<debugSuspend> |
boolean |
- |
Whether to suspend the execution of the application when running in debug mode. Default: false User Property: mn.debug.suspend |
<explicitPort> |
Integer |
- |
By default, the Test Resources server will be started on a random (available) port, but it can be set a fixed port by using this parameter. User Property: micronaut.test.resources.port |
<foreground> |
boolean |
4.7.0 |
Whether the test resources server should be started in the foreground. Default: false User Property: micronaut.test.resources.foreground |
<jvmArguments> |
String |
- |
List of additional arguments that will be passed to the JVM process, such as Java agent properties. When using the command line, user properties will be passed through, eg: User Property: mn.jvmArgs |
<mainClass> |
String |
- |
The main class of the application, as defined in the Exec Maven Plugin. Default: ${exec.mainClass} |
<serverIdleTimeoutMinutes> |
Integer |
4.2.0 |
Configures the duration after which the test resources service will automatically shut down if it doesn't get any request. User Property: micronaut.test.resources.server-idle-timeout-minutes |
<shared> |
boolean |
- |
Whether the test resources service should be shared between independent builds (e.g. different projects, even built with different build tools). Default: false User Property: micronaut.test.resources.shared |
<sharedServerNamespace> |
String |
3.5.1 |
Allows configuring a namespace for the shared test-resources server. This can be used in case it makes sense to have different instances of shared services, for example when independent builds sets share different services. User Property: micronaut.test.resources.namespace |
<testResourcesDependencies> |
List<Dependency> |
- |
Additional dependencies to add to the Test Resources server classpath when not using classpath inference, or when the inference doesn't produce the desired result. |
<testResourcesEnabled> |
boolean |
- |
Whether to enable or disable Micronaut test resources support. Default: false User Property: micronaut.test.resources.enabled |
<watchForChanges> |
boolean |
- |
Whether to watch for changes, or finish the execution after the first run. Default: true User Property: mn.watch |
<watches> |
List<FileSet> |
- |
List of inclusion/exclusion paths that should not trigger an application restart. For example, you can exclude a particular directory from being watched by adding the following configuration:
<watches> <watch> <directory>.some-dir</directory> <excludes> <exclude>**/*</exclude> </excludes> </watch> </watches>Check the FileSet documentation for more details. See also: FileSet |
Parameter Details
<aotEnabled>
- Type:
boolean
- Required:
No
- User Property:
micronaut.aot.enabled
- Default:
false
<appArguments>
- Type:
java.lang.String
- Required:
No
- User Property:
mn.appArgs
<buildDirectory>
- Type:
java.io.File
- Required:
Yes
- Default:
${project.build.directory}
<classpathInference>
- Type:
java.lang.Boolean
- Required:
No
- Default:
true
<clientTimeout>
- Type:
java.lang.Integer
- Required:
No
- User Property:
micronaut.test.resources.client-timeout
- Default:
60
<debug>
- Type:
boolean
- Required:
No
- User Property:
mn.debug
- Default:
false
<debugHost>
- Type:
java.lang.String
- Required:
No
- User Property:
mn.debug.host
- Default:
127.0.0.1
<debugPort>
- Type:
int
- Required:
No
- User Property:
mn.debug.port
- Default:
5005
<debugServer>
- Type:
boolean
- Since:
4.2.0
- Required:
No
- User Property:
micronaut.test.resources.debug-server
- Default:
false
<debugSuspend>
- Type:
boolean
- Required:
No
- User Property:
mn.debug.suspend
- Default:
false
<explicitPort>
- Type:
java.lang.Integer
- Required:
No
- User Property:
micronaut.test.resources.port
<foreground>
- Type:
boolean
- Since:
4.7.0
- Required:
No
- User Property:
micronaut.test.resources.foreground
- Default:
false
<jvmArguments>
List of additional arguments that will be passed to the JVM process, such as Java agent properties.
When using the command line, user properties will be passed through, eg: mnv mn:run -Dmicronaut.environments=dev
.
- Type:
java.lang.String
- Required:
No
- User Property:
mn.jvmArgs
<mainClass>
- Type:
java.lang.String
- Required:
No
- Default:
${exec.mainClass}
<serverIdleTimeoutMinutes>
- Type:
java.lang.Integer
- Since:
4.2.0
- Required:
No
- User Property:
micronaut.test.resources.server-idle-timeout-minutes
<shared>
- Type:
boolean
- Required:
No
- User Property:
micronaut.test.resources.shared
- Default:
false
<sharedServerNamespace>
- Type:
java.lang.String
- Since:
3.5.1
- Required:
No
- User Property:
micronaut.test.resources.namespace
<testResourcesDependencies>
- Type:
java.util.List<org.apache.maven.model.Dependency>
- Required:
No
<testResourcesEnabled>
- Type:
boolean
- Required:
No
- User Property:
micronaut.test.resources.enabled
- Default:
false
<testResourcesVersion>
- Type:
java.lang.String
- Required:
Yes
- User Property:
micronaut.test.resources.version
<watchForChanges>
- Type:
boolean
- Required:
No
- User Property:
mn.watch
- Default:
true
<watches>
<watches> <watch> <directory>.some-dir</directory> <excludes> <exclude>**/*</exclude> </excludes> </watch> </watches>Check the FileSet documentation for more details.
See also: FileSet
- Type:
java.util.List<org.apache.maven.model.FileSet>
- Required:
No