Maven Invoker maven plugin

This is a simple maven plugin wrapper for the Apache Maven Invoker at https://maven.apache.org/shared/maven-invoker/ which allows to invoke a Maven execution on an independent maven project.

License

License

Categories

Categories

Maven Build Tools
GroupId

GroupId

com.github.iarellano
ArtifactId

ArtifactId

iad-maven-invoker-maven-plugin
Last Version

Last Version

1.0.1
Release Date

Release Date

Type

Type

maven-plugin
Description

Description

Maven Invoker maven plugin
This is a simple maven plugin wrapper for the Apache Maven Invoker at https://maven.apache.org/shared/maven-invoker/ which allows to invoke a Maven execution on an independent maven project.
Project URL

Project URL

https://github.com/iarellano/iad-maven-invoker-maven-plugin
Source Code Management

Source Code Management

https://github.com/iarellano/iad-maven-invoker-maven-plugin

Download iad-maven-invoker-maven-plugin

How to add to project

<plugin>
    <groupId>com.github.iarellano</groupId>
    <artifactId>iad-maven-invoker-maven-plugin</artifactId>
    <version>1.0.1</version>
</plugin>

Dependencies

compile (1)

Group / Artifact Type Version
org.apache.maven.shared : maven-invoker jar 3.0.1

provided (4)

Group / Artifact Type Version
org.apache.maven : maven-plugin-api jar 3.3.9
org.apache.maven : maven-core jar 3.3.9
org.apache.maven : maven-artifact jar 3.3.9
org.apache.maven.plugin-tools : maven-plugin-annotations jar 3.6.0

test (3)

Group / Artifact Type Version
org.apache.maven : maven-compat jar 3.3.9
junit : junit jar 4.12
org.apache.maven.plugin-testing : maven-plugin-testing-harness jar 3.3.0

Project Modules

There are no modules declared in this project.

iad-maven-invoker-maven-plugin

License: MIT Maven Central

Maven Invoker maven plugin

This is a simple maven plugin wrapper for the Apache Maven Invoker which allows to invoke a Maven execution on an independent maven project.

Table of contents

Getting started

Check the example at example/invoker-project which builds project example/target-project.

  1. Clone the repo
    git clone [email protected]:iarellano/iad-maven-invoker-maven-plugin.git
  2. From within the cloned directory, change to example project directory
    cd example/invoker-project
  3. Execute the maven goal
    mvn com.github.iarellano:iad-maven-invoker-maven-plugin:1.0:execute

Example

<plugin>
    <groupId>com.github.iarellano</groupId>
    <artifactId>iad-maven-invoker-maven-plugin</artifactId>
    <version>1.0.1</version>
    <executions>
        <id>build-project</id>
        <phase>process-resources</phase>
        <goals>
            <goal>execute</goal>
        </goals>
        <configuration>
            <baseDirectory>/path/to/other/project</baseDirectory>
            <pomFile>pom.xml</pomFile>
            <goals>
                <goal>clean</goal>
                <goal>compile</goal>
                <goal>test</goal>
                <goal>install</goal>
            </goals>
          <debug>true</debug>
        </configuration>
    </executions>
</plugin>

Unit Testing

  1. Clone the repo
    git clone [email protected]:iarellano/iad-maven-invoker-maven-plugin.git
  2. From within the cloned directory, change to example project directory
    mvn clean test

Parameters

localRepository

The path to the base directory of the local repository to use for the Maven invocation. Defaults to ${settings.localRepository}.

Type File path
Default ${settings.localRepository}
Required Yes

Go to parameters list

baseDirectory

The path to the base directory of the POM for the Maven invocation. This setting only affects the working directory for the Maven invocation.

Type File path
Required Yes

Go to parameters list

workingDirectory

The working directory for the Maven invocation.

Type File path
Default Same as baseDirectory
Required Yes

Go to parameters list

pomFile

The name of the POM file for the Maven invocation which is contained in baseDirectory.

Type String
Default pom.xml
Required Yes

Go to parameters list

goals

The goals for the Maven invocation.

Type List of Strings
Required Yes

Go to parameters list

profiles

The profiles for the Maven invocation. Equivalent of -P and --active-profiles.

Type List of Strings
Required No

Go to parameters list

mavenOpts

The value of the MAVEN_OPTS environment variable. Uses the default options if not provided.

Type String
Default Default maven options
Required No

Go to parameters list

recursive

Recursion behavior of a reactor invocation. Inverse equivalent of -N and --non-recursive. Defaults to true.

Type boolean
Default true
Required No

Go to parameters list

alsoMake

Enable the 'also make' mode. Equivalent of -am or --also-make. Defaults to false.

Type boolean
Default false
Required No
Since 2.1

Go to parameters list

alsoMakeDependents

Enable the 'also make dependents' mode. Equivalent of -amd or --also-make-dependents.

Type boolean
Default false
Required No
Since 2.1

Go to parameters list

debug

Enable the debug mode of the Maven invocation. Equivalent of -X and --debug. Defaults to false.

Type boolean
Default false
Required No

Go to parameters list

resumeFrom

Resume reactor from specified project. Equivalent of -rf or --resume-from.

Type String
Required No
Since 2.1

Go to parameters list

globalSettingsFile

The path to the global settings for the Maven invocation. Equivalent of -gs and --global-settings. If not provided then it uses global settings from the default location.

Type File path
Default ${maven.home}/conf/settings.xml
Required No
Since 2.1

Go to parameters list

userSettingsFile

The path to the user settings for the Maven invocation. Equivalent of {@code -s} and {@code --settings}. If not provided then it uses the user settings from the default location.

Type File path
Default ${user.home}/.m2/settings.xml
Required No

Go to parameters list

mavenHome

Sets the path to the base directory of the Maven installation used to invoke Maven. This parameter may be left unspecified to use the default Maven installation which will be discovered by evaluating the system property maven.home and the environment variable M2_HOME. Change it if you want to use a different maven installation.

Type File path
Default ${maven.home}
Required No

Go to parameters list

javaHome

Sets the path to the base directory of the Java installation used to run Maven. If not provided then it uses the default Java home.

Type No
Default ${java.home}
Required No

Go to parameters list

properties

Additional properties to pass to the Maven invocation.

Type Map
Required No

Go to parameters list

environment

Additional environment variables to pass to the Maven invocation.

Type Map
Required No

Go to parameters list

shellEnvironmentInherited

Specifies whether the environment variables of the current process should be propagated to the Maven invocation.

Type boolean
Default true
Required No

Go to parameters list

propertiesFile

Path to external file containing properties to be included in the Maven invocation. Path is relative to the base directory of the project using this plugin, absolute path may be set.

Type File path
Required No

Go to parameters list

projects

Sets the reactor project list. Equivalent of -pl or --projects, ignored if recusive is false.

Type List of Strings
Required No

Go to parameters list

threads

Thread count, for instance 2.0C where <em<C is core multiplied Equivalent of -T or --threads.

Type String
Required No
Since 2.1

Go to parameters list

offline

The network mode of the Maven invocation. Equivalent of -o and --offline, true if Maven should be executed in offline mode, false if the online. Default is false.

Type boolean
Default false
Required No

Go to parameters list

showErrors

Sets the exception output mode of the Maven invocation. Equivalent of -e and --errors. true if Maven should print stack traces, false otherwise. Default is false.

Type boolean
Default false
Required No

Go to parameters list

updateSnapshots

Specifies whether Maven should enforce an update check for plugins and snapshots. Equivalent of -U and --update-snapshots. true if plugins and snapshots should be updated, false otherwise. Default is false.

Type boolen
Default false
Required No

Go to parameters list

toolchainsFile

The alternate path for the user toolchains file Equivalent of -t or --toolchains.

Type File path
Required No
Since 2.1

Go to parameters list

globalToolchainsFile

The alternate path for the global toolchains file Equivalent of -gt or --global-toolchains

Type File path
Required No
Since 3.0.0

Go to parameters list

nonPluginUpdates

Specifies whether Maven should check for plugin updates.

Equivalent of `-npu` or `--no-plugin-updates`

note: Ineffective with Maven3, only kept for backward compatibility

Type boolean
Default false
Required No

Go to parameters list

globalChecksumPolicy

Checksum mode of the Maven invocation. Equivalent of -c or --lax-checksums, -C or --strict-checksums. The checksum mode, must be one of Warn and Fail.

Type String
Possible values Warn, Fail
Required No
Since 3.0.0

Go to parameters list

reactorFailureBehavior

Sets the failure mode of the Maven invocation. Equivalent of -ff and --fail-fast, -fae and --fail-at-end, -fn and --fail-never.

The failure mode, must be one of FailFast, FailAtEnd and FailNever

Type String
Possible values FailFast, FailAtEnd, FailNever
Default FailFast
Required No
Since 3.0.0

Go to parameters list

timeoutInSeconds

The timeout in seconds to execute the project. A value of 0 means no timeout.

Type int
Default 0
Required No
Since 3.0.1

Go to parameters list

Versions

Version
1.0.1
1.0