Interface MavenOptions

All Superinterfaces:
Options
All Known Implementing Classes:
CommonsCliMavenOptions, LayeredMavenOptions

@Experimental public interface MavenOptions extends Options
Defines the options specific to Maven operations. This interface extends the general Options interface, adding Maven-specific configuration options.

These options represent the various flags and settings available through the Maven CLI, as well as those that can be specified in the maven.config file. They provide fine-grained control over Maven's behavior during the build process.

Since:
4.0.0
  • Method Details

    • alternatePomFile

      @Nonnull Optional<String> alternatePomFile()
      Returns the path to an alternate POM file.
      Returns:
      an Optional containing the path to the alternate POM file, or empty if not specified
    • offline

      Indicates whether Maven should operate in offline mode.
      Returns:
      an Optional containing true if offline mode is enabled, false if disabled, or empty if not specified
    • nonRecursive

      @Nonnull Optional<Boolean> nonRecursive()
      Indicates whether Maven should operate in non-recursive mode (i.e., not build child modules).
      Returns:
      an Optional containing true if non-recursive mode is enabled, false if disabled, or empty if not specified
    • updateSnapshots

      @Nonnull Optional<Boolean> updateSnapshots()
      Indicates whether Maven should force a check for updated snapshots on remote repositories.
      Returns:
      an Optional containing true if snapshot updates should be forced, false if not, or empty if not specified
    • activatedProfiles

      @Nonnull Optional<List<String>> activatedProfiles()
      Returns the list of profiles to activate.
      Returns:
      an Optional containing the list of profile names to activate, or empty if not specified
    • suppressSnapshotUpdates

      @Nonnull Optional<Boolean> suppressSnapshotUpdates()
      Indicates whether Maven should suppress SNAPSHOT updates.
      Returns:
      an Optional containing true if SNAPSHOT updates should be suppressed, false if not, or empty if not specified
    • strictChecksums

      @Nonnull Optional<Boolean> strictChecksums()
      Indicates whether Maven should use strict checksum verification.
      Returns:
      an Optional containing true if strict checksum verification is enabled, false if not, or empty if not specified
    • relaxedChecksums

      @Nonnull Optional<Boolean> relaxedChecksums()
      Indicates whether Maven should use relaxed checksum verification.
      Returns:
      an Optional containing true if relaxed checksum verification is enabled, false if not, or empty if not specified
    • failFast

      Indicates whether Maven should stop at the first failure in a multi-module build.
      Returns:
      an Optional containing true if Maven should stop at the first failure, false if not, or empty if not specified
    • failAtEnd

      @Nonnull Optional<Boolean> failAtEnd()
      Indicates whether Maven should run all builds but defer error reporting to the end.
      Returns:
      an Optional containing true if error reporting should be deferred to the end, false if not, or empty if not specified
    • failNever

      @Nonnull Optional<Boolean> failNever()
      Indicates whether Maven should never fail the build, regardless of project result.
      Returns:
      an Optional containing true if the build should never fail, false if it should fail normally, or empty if not specified
    • resume

      Indicates whether Maven should resume from the last failed project in a previous build.
      Returns:
      an Optional containing true if Maven should resume from the last failure, false if not, or empty if not specified
    • resumeFrom

      @Nonnull Optional<String> resumeFrom()
      Returns the project to resume the build from.
      Returns:
      an Optional containing the project name to resume from, or empty if not specified
    • projects

      Returns the list of specified reactor projects to build instead of all projects.
      Returns:
      an Optional containing the list of project names to build, or empty if not specified
    • alsoMake

      Indicates whether Maven should also build the specified projects' dependencies.
      Returns:
      an Optional containing true if dependencies should also be built, false if not, or empty if not specified
    • alsoMakeDependents

      @Nonnull Optional<Boolean> alsoMakeDependents()
      Indicates whether Maven should also build the specified projects' dependents.
      Returns:
      an Optional containing true if dependents should also be built, false if not, or empty if not specified
    • threads

      Returns the number of threads used for parallel builds.
      Returns:
      an Optional containing the number of threads (or "1C" for one thread per CPU core), or empty if not specified
    • builder

      Returns the id of the build strategy to use.
      Returns:
      an Optional containing the id of the build strategy, or empty if not specified
    • noTransferProgress

      @Nonnull Optional<Boolean> noTransferProgress()
      Indicates whether Maven should not display transfer progress when downloading or uploading.
      Returns:
      an Optional containing true if transfer progress should not be displayed, false if it should, or empty if not specified
    • cacheArtifactNotFound

      @Nonnull Optional<Boolean> cacheArtifactNotFound()
      Indicates whether Maven should cache the "not found" status of artifacts that were not found in remote repositories.
      Returns:
      an Optional containing true if "not found" status should be cached, false if not, or empty if not specified
    • strictArtifactDescriptorPolicy

      @Nonnull Optional<Boolean> strictArtifactDescriptorPolicy()
      Indicates whether Maven should use strict artifact descriptor policy.
      Returns:
      an Optional containing true if strict artifact descriptor policy should be used, false if not, or empty if not specified
    • ignoreTransitiveRepositories

      @Nonnull Optional<Boolean> ignoreTransitiveRepositories()
      Indicates whether Maven should ignore transitive repositories.
      Returns:
      an Optional containing true if transitive repositories should be ignored, false if not, or empty if not specified
    • goals

      Returns the list of goals and phases to execute.
      Returns:
      an Optional containing the list of goals and phases to execute, or empty if not specified
    • interpolate

      Returns a new instance of MavenOptions with values interpolated using the given properties.
      Specified by:
      interpolate in interface Options
      Parameters:
      properties - a collection of property maps to use for interpolation
      Returns:
      a new MavenOptions instance with interpolated values