Questions tagged [maven-invoker-plugin]

Maven Invoker Plugin

The Invoker Plugin is used to run a set of Maven projects. The plugin can determine whether each project execution is successful, and optionally can verify the output generated from a given project execution.

This plugin is in particular handy to perform integration tests for other Maven plugins. The Invoker Plugin can be employed to run a set of test projects that have been designed to assert certain features of the plugin under test.

The plugin has four goals meant to participate in the default build lifecycle:

  • invoker:install copies the project artifacts and dependencies of the main build into a dedicated local repository to prepare the execution of the selected sub projects in an isolated environment.
  • invoker:integration-test runs a set of Maven projects in a directory.
  • invoker:verify verifies the result of invoker:integration-test.
  • invoker:run runs a set of Maven projects in a directory and verifies the result. This is equivalent to running both invoker:integration-test and invoker:verify.

This last goal is intended for usage with the site lifecycle:

  • invoker:report integrates the results from previous builds into the site.

Reference :

https://maven.apache.org/plugins/maven-invoker-plugin/

34 questions
0
votes
2 answers

How to access the console output of invoker integration test in post-build script?

I have a post-build script written in Groovy in my maven-invoker-plugin setup. How can I access the console output of an integration test in this script? I want to check that certain text has been printed.
yegor256
  • 102,010
  • 123
  • 446
  • 597
0
votes
1 answer

How to add Maven Home (M2_HOME) in PATH in Alpine Linux based docker container

I need to use Maven-invoker in my app. I run my app in an Alpine-based docker container. So, I put into Dockerfile commands to install Maven and add the Maven Home directory to the PATH environment variable. When the container is up I can go inside…
0
votes
0 answers

Run maven commands from java

I need to run maven commands from the Spring-boot application directed at another spring-boot application. I am trying to use maven-invoker but it is requiring setMavenHome. Can I download maven as an artifact instead of giving access to my maven…
0
votes
1 answer

Running a Post-Build Script via maven-invoker-plugin

I am trying to run a simple beanshell script to print 'Hello World' after building the war file. I am making references from this. However, I keep getting "No projects were selected for execution." after running mvn clean install. I am unsure if the…
Russ1337
  • 51
  • 1
  • 6
0
votes
0 answers

Invoking maven from inside an uber jar using pom.xml located inside jar

I am running a set of tests using junit and I have created a maven project for it. I use the surefire plugin to run the tests. I wanted to package this project as a self executable jar for the sake of convenience.So I placed all of test classes in…
0
votes
0 answers

Create a maven project with in another java project

As part of small project i need to provide a micro service to create/generate maven based java projects (something similar to Spring Initializr but a basic one ). Since my aim is to just get a maven project, i came across Maven Invoker which looks…
samairtimer
  • 826
  • 2
  • 12
  • 28
0
votes
1 answer

How to set artifact id and other info programmatically using maven invoker

I'm trying to create a maven project programmatically by running a java application. In the application, I have set the pom file as: request.setPomFile(new File(thePomFile)); request.setGoals( Collections.singletonList( "archetype:generate" )…
spinyBabbler
  • 392
  • 5
  • 19
0
votes
1 answer

Invoke maven-invoker-plugin in a specific phase

Is it possible to execute goal of maven-invoker-plugin in a specific phase only? I want the goal to execute only when i run 'mvn verify' and not when 'mvn install' is run.
0
votes
0 answers

how to run a groovy script with maven invoker plugin

I have a groovy script in src/it/first/ver.groovy If I use the exec-maven-plugin I can run it, but if I use the maven-invoker-plugin I cannot. I would prefer to use the invoker... Example of config using exec-maven-plugin :
Jorge Viana
  • 396
  • 5
  • 12
0
votes
1 answer

How to invoke specific execution

I am trying to replace maven exec with MavenInvokerPlugin because of problems on Jenkins with forwarding the maven settings file. So in bash it looks straight: mvn dependency:copy-dependencies@resolve-maven-deps My translation to…
Daniil Iaitskov
  • 5,525
  • 8
  • 39
  • 49
0
votes
2 answers

Maven Invoker Plugin not detecting failed test

As part of a root parent pom project, several integration tests have been added to test it on sample projects. The structure of the project folder is as following: -root-maven-parent-project |- src | |-it | |-sample-project-test1 …
A_Di-Matteo
  • 26,902
  • 7
  • 94
  • 128
0
votes
1 answer

How to update maven pom dynamically

I am using wsImport to create java atrifacts from wsdl files. I have many wsdl files, as of now I am making multiple entries of wsimport plugin in pom for wsdl files which becomes messy. Is it possible to add plugins to maven dynamically at run…
0
votes
1 answer

Location of Maven Home on Cloud Foundry

I have an application that programmatically runs Maven command "clean package" at runtime, using plugin maven-invoker. To be able to run this application on Cloud Foundry, we need to set Maven Home on the invoker. This question is similar to Maven…
0
votes
2 answers

How to use ScriptVariables in Maven-Invoker-Plugin with PostBuildHookScript in Groovy

I am using Maven-Inovker-Plugin to run integration tests. I have a post-build-hook-script called verify.groovy to verify the results of the integration tests. In the groovy script, I need to access some properties from the original POM. How do I do…
dc95
  • 1,319
  • 1
  • 22
  • 44
0
votes
1 answer

when call projects poms using maven-invoker-plugin it throws OutOfMemoryException

I got a multi project setup , which requires to be invoke using one root project pom. When run each project separately all works fine, Tests executed successfully , BUT when projects been invoked using maven-invoker-plugin all projects failed with…