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 Details

    • log

      protected org.apache.maven.plugin.logging.Log log
      Instance logger.
    • pluginContext

      protected Map<?,?> pluginContext
      Plugin container context.
    • buildDirectory

      @Parameter(defaultValue="${project.build.directory}", required=true) protected File buildDirectory
    • testResourcesVersion

      @Parameter(property="micronaut.test.resources.version", required=true) protected String testResourcesVersion
      Micronaut Test Resources version. Should be defined by the Micronaut BOM, but this parameter can be used to define a different version.
    • classpathInference

      @Parameter(defaultValue="true") 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. 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

      @Parameter 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.
    • explicitPort

      @Parameter(property="micronaut.test.resources.port") 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.
    • clientTimeout

      @Parameter(property="micronaut.test.resources.client-timeout", defaultValue="60") protected Integer clientTimeout
      Configures the maximum amount of time to wait for the server to start a test resource. Some containeres 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 serverIdleTimeoutMinutes
      Configures 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

  • Method Details

    • serverSettingsDirectoryOf

      public static Path serverSettingsDirectoryOf(Path buildDir)
    • setLog

      public void setLog(org.apache.maven.plugin.logging.Log log)
      Specified by:
      setLog in interface org.apache.maven.plugin.Mojo
    • getLog

      public org.apache.maven.plugin.logging.Log getLog()
      Specified by:
      getLog in interface org.apache.maven.plugin.Mojo
    • getPluginContext

      public Map<?,?> getPluginContext()
      Specified by:
      getPluginContext in interface org.apache.maven.plugin.ContextEnabled
    • setPluginContext

      public void setPluginContext(Map pluginContext)
      Specified by:
      setPluginContext in interface org.apache.maven.plugin.ContextEnabled