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
FieldsModifier and TypeFieldDescriptionprotected Fileprotected BooleanIf 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 IntegerConfigures the maximum amount of time to wait for the server to start a test resource.protected IntegerBy 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.LogInstance logger.protected Map<?,?> Plugin container context.protected IntegerConfigures 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.System properties that will be passed to the Test Resources service, e.g.protected StringMicronaut Test Resources version.Fields inherited from class io.micronaut.maven.testresources.TestResourcesConfiguration
CONFIG_PROPERTY_PREFIX, debugServer, DISABLED, foreground, shared, sharedServerNamespace, TEST_RESOURCES_ENABLED_PROPERTY, testResourcesEnabledFields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.maven.plugin.logging.LoggetLog()Map<?,?> static PathserverSettingsDirectoryOf(Path buildDir) voidsetLog(org.apache.maven.plugin.logging.Log log) voidsetPluginContext(Map pluginContext) Methods inherited from class io.micronaut.maven.testresources.TestResourcesConfiguration
getSharedServerNamespace, isShared, isTestResourcesEnabled, setDebugServer, setShared, setSharedServerNamespace, setTestResourcesEnabledMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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
-
testResourcesSystemProperties
System properties that will be passed to the Test Resources service, e.g.<testResourcesSystemProperties> <docker.check.timeout.seconds>30</docker.check.timeout.seconds> </testResourcesSystemProperties>- Since:
- 4.7.2
-
-
Constructor Details
-
AbstractTestResourcesMojo
public AbstractTestResourcesMojo()
-
-
Method Details
-
serverSettingsDirectoryOf
-
setLog
- Specified by:
setLogin interfaceorg.apache.maven.plugin.Mojo
-
getLog
- Specified by:
getLogin interfaceorg.apache.maven.plugin.Mojo
-
getPluginContext
- Specified by:
getPluginContextin interfaceorg.apache.maven.plugin.ContextEnabled
-
setPluginContext
- Specified by:
setPluginContextin interfaceorg.apache.maven.plugin.ContextEnabled
-