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
7
votes
2 answers

Disable 'downloaded' logs in Maven Invoker tests

I'd like to tune down logging during Maven Invoker tests. Right now logs are polluted with sequence of Downloading and Downloaded for every dependency in every test separately. [INFO] [INFO] Downloading:…
Michal Kordas
  • 10,475
  • 7
  • 58
  • 103
6
votes
1 answer

How to solve Maven Invoker API warning: Maven will be executed in interactive mode, but no input stream has been configured

I have a plugin which invokes Maven runs using MavenInvokerAPI. Everything is working fine, but I do have this warning in my Maven console output. [WARN] Maven will be executed in interactive mode, but no input stream has been configured for this…
frdsprtrdr
  • 384
  • 1
  • 2
  • 11
4
votes
1 answer

How to run maven integration tests on shaded artifact?

I have a simple goal: I want to be able to use the maven-failsafe-plugin, or any viable alternative, to run tests against a jar I'm building with the maven-shade-plugin. Specifically, I want to run the tests after shade runs because I want an…
3
votes
1 answer

InvocationRequest.setInteractive() does not exist in maven-invoker-3.0.1

InvocationRequest.setInteractive() is removed in newer versions of maven invoker API, and it is not available after version 2.1.1 is there any alternative for that? how we can disable interactive mode now?
frdsprtrdr
  • 384
  • 1
  • 2
  • 11
3
votes
0 answers

Profile inheritance from main POM to Maven Invoker run

I have some profiles defined in my main POM, e.g. static-analysis ... Then I have some Maven Invoker tests and invoker.properties file: invoker.goals = clean test Is…
Michal Kordas
  • 10,475
  • 7
  • 58
  • 103
3
votes
2 answers

Running a single test with invoker plugin

Following is the directory structure for my integration tests /src/it/first-test -->my-test -->build.log -->inoker.properties -->pom.xml -->verify.groovy When I try to run…
user_mda
  • 18,148
  • 27
  • 82
  • 145
3
votes
1 answer

maven-invoker-plugin: Assert failure of a test build

I am using the maven-invoker-plugin to run integration tests against a Maven plugin. I am able to use a verify.groovy script to assert statements about the artifacts generated by my test projects; this is all working fine. Now I want to test that,…
Neil Bartlett
  • 23,743
  • 4
  • 44
  • 77
3
votes
0 answers

Using Maven Invoker, how can I get the log messages

Is there any way to programmatically inspect process log messages using the Maven Invoker framework? I am using that framework to execute some integration tests against an embedded server (Jetty), and I need to inspect the logs to know when the…
Victor Grazi
  • 15,563
  • 14
  • 61
  • 94
2
votes
1 answer

Maven Invoker - Using MVNW

I use maven invoker to compile generated source code programmatically. I work now inside container and I would like to avoid of embedding MAVEN as well. Currently the code (that runs locally) generally looks like this (I simplified it a…
Yaron
  • 2,209
  • 3
  • 18
  • 33
2
votes
1 answer

Maven Invoker Plugin vs Maven Failsafe Plugin: Which to use for integration-test?

Documentation for both (Failsafe, Invoker) suggests they are useful for running integration-tests. I cannot figure out which one to use for integration-tests. Only difference I can see is that Failsafe plugin is specifically designed for running…
2
votes
1 answer

"Artifact is not fully assembled" error with maven-invoker-plugin in parallel build

According to the docs, maven-invoker-plugin is "thread-safe and supports parallel builds." However, when I build by multi-module project with -T 1C, I get an error like the following: [ERROR] Failed to execute goal…
Tavian Barnes
  • 12,477
  • 4
  • 45
  • 118
1
vote
2 answers

Maven Invoker cannot find MAVEN_HOME environment variable on Tomcat server

I have built a Java web application that receives a url from a form and performs TestNG tests against those URLs using a local Maven installation from the command line. My test classes are in src/main/java which is not conventional, but since my…
Omar
  • 21
  • 2
1
vote
0 answers

Run Maven Invoker from Java fails

I'm using Maven Invoker to run some maven command in Java code. Here are the references I read before doing my own code: maven-invoker-illegal-state-exception, how-to-run-maven-from-java, Maven Invoker Usage And my code is like: InvocationRequest…
Shush
  • 77
  • 1
  • 16
1
vote
0 answers

Weird maven-invoker-plugin exception: java.lang.ClassCastException: Script1 cannot be cast to groovy.lang.GroovyObject

I am using the maven-invoker-plugin. Things were working fine until I started getting the following error (out of nowhere -- there have been no changes to the project itself): [INFO]…
carlspring
  • 31,231
  • 29
  • 115
  • 197
0
votes
0 answers

MavenInvoker hanging when using a lambda OutputHandler in a static initialiser

I'm trying to get the output of a Maven command in a static block - specifically - resolve the location of the local repository location to a static variable. The application hangs only when the OutputHandler is a lambda (not a method reference) and…
Jakg
  • 922
  • 12
  • 39
1
2 3