public abstract class AbstractTestResourcesMojo extends TestResourcesConfiguration implements org.apache.maven.plugin.Mojo, org.apache.maven.plugin.ContextEnabled
Modifier and Type | Field and Description |
---|---|
protected File |
buildDirectory |
protected Boolean |
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.
|
protected Integer |
clientTimeout
Configures the maximum amount of time to wait for the server to start a test resource.
|
protected Integer |
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.
|
protected org.apache.maven.plugin.logging.Log |
log
Instance logger.
|
protected Map |
pluginContext
Plugin container context.
|
protected List<org.apache.maven.model.Dependency> |
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.
|
protected String |
testResourcesVersion
Micronaut Test Resources version.
|
CONFIG_PROPERTY_PREFIX, DISABLED, keepAlive, shared, sharedServerNamespace, testResourcesEnabled
Constructor and Description |
---|
AbstractTestResourcesMojo() |
Modifier and Type | Method and Description |
---|---|
org.apache.maven.plugin.logging.Log |
getLog()
Returns the logger that has been injected into this mojo.
|
Map |
getPluginContext() |
static Path |
serverSettingsDirectoryOf(Path buildDir) |
void |
setLog(org.apache.maven.plugin.logging.Log log) |
void |
setPluginContext(Map pluginContext) |
getSharedServerNamespace, isKeepAlive, isShared, isTestResourcesEnabled
protected org.apache.maven.plugin.logging.Log log
protected Map pluginContext
@Parameter(defaultValue="${project.build.directory}", required=true) protected File buildDirectory
@Parameter(property="micronaut.test.resources.version", required=true) protected String testResourcesVersion
@Parameter(defaultValue="true") protected Boolean classpathInference
@Parameter protected List<org.apache.maven.model.Dependency> testResourcesDependencies
@Parameter(property="micronaut.test.resources.port") protected Integer explicitPort
@Parameter(property="micronaut.test.resources.client-timeout", defaultValue="60") protected Integer clientTimeout
public void setLog(org.apache.maven.plugin.logging.Log log)
setLog
in interface org.apache.maven.plugin.Mojo
Mojo.setLog(org.apache.maven.plugin.logging.Log)
public org.apache.maven.plugin.logging.Log getLog()
SystemStreamLog
logger will be created and returned.
Note:
The logger returned by this method must not be cached in an instance field during the construction of the mojo.
This would cause the mojo to use a wrongly configured default logger when being run by Maven. The proper logger
gets injected by the Plexus container after the mojo has been constructed. Therefore, simply call this
method directly whenever you need the logger, it is fast enough and needs no caching.getLog
in interface org.apache.maven.plugin.Mojo
Mojo.getLog()
public Map getPluginContext()
getPluginContext
in interface org.apache.maven.plugin.ContextEnabled
ContextEnabled.getPluginContext()
public void setPluginContext(Map pluginContext)
setPluginContext
in interface org.apache.maven.plugin.ContextEnabled
ContextEnabled.setPluginContext(java.util.Map)
Copyright © 2020–2023 Micronaut. All rights reserved.