Package io.micronaut.maven.testresources
Class AbstractTestResourcesMojo
java.lang.Object
io.micronaut.maven.testresources.TestResourcesConfiguration
io.micronaut.maven.testresources.AbstractTestResourcesMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
RunMojo
,StartTestResourcesServerMojo
,StopTestResourcesServerMojo
public abstract class AbstractTestResourcesMojo
extends TestResourcesConfiguration
implements org.apache.maven.plugin.Mojo, org.apache.maven.plugin.ContextEnabled
Base mojo for Micronaut test resources service handling.
-
Field Summary
Modifier and TypeFieldDescriptionprotected File
protected 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.protected Integer
Configures the maximum amount of time to wait for the server to start a test resource.protected 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.protected org.apache.maven.plugin.logging.Log
Instance logger.protected Map<?,
?> Plugin container context.protected Integer
Configures the duration after which the test resources service will automatically shut down if it doesn't get any request.protected List<org.apache.maven.model.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.protected String
Micronaut Test Resources version.Fields inherited from class io.micronaut.maven.testresources.TestResourcesConfiguration
CONFIG_PROPERTY_PREFIX, debugServer, DISABLED, foreground, shared, sharedServerNamespace, TEST_RESOURCES_ENABLED_PROPERTY, testResourcesEnabled
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionorg.apache.maven.plugin.logging.Log
getLog()
Map<?,
?> static Path
serverSettingsDirectoryOf
(Path buildDir) void
setLog
(org.apache.maven.plugin.logging.Log log) void
setPluginContext
(Map pluginContext) Methods inherited from class io.micronaut.maven.testresources.TestResourcesConfiguration
getSharedServerNamespace, isShared, isTestResourcesEnabled, setDebugServer, setShared, setSharedServerNamespace, setTestResourcesEnabled
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.maven.plugin.Mojo
execute
-
Field Details
-
log
Instance logger. -
pluginContext
Plugin container context. -
buildDirectory
-
testResourcesVersion
@Parameter(property="micronaut.test.resources.version", required=true) protected String testResourcesVersionMicronaut Test Resources version. Should be defined by the Micronaut BOM, but this parameter can be used to define a different version. -
classpathInference
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. -
testResourcesDependencies
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. -
explicitPort
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. -
clientTimeout
@Parameter(property="micronaut.test.resources.client-timeout", defaultValue="60") protected Integer clientTimeoutConfigures 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. -
serverIdleTimeoutMinutes
@Parameter(property="micronaut.test.resources.server-idle-timeout-minutes") protected Integer serverIdleTimeoutMinutesConfigures the duration after which the test resources service will automatically shut down if it doesn't get any request.- Since:
- 4.2.0
-
-
Constructor Details
-
AbstractTestResourcesMojo
public AbstractTestResourcesMojo()
-
-
Method Details
-
serverSettingsDirectoryOf
-
setLog
- Specified by:
setLog
in interfaceorg.apache.maven.plugin.Mojo
-
getLog
- Specified by:
getLog
in interfaceorg.apache.maven.plugin.Mojo
-
getPluginContext
- Specified by:
getPluginContext
in interfaceorg.apache.maven.plugin.ContextEnabled
-
setPluginContext
- Specified by:
setPluginContext
in interfaceorg.apache.maven.plugin.ContextEnabled
-