Questions tagged [exec-maven-plugin]

Use this tag for questions specifically related to the usage of the Exec Maven Plugin, which allows to execute arbitrary programs or other Java programs during a Maven build.

The plugin offers two goals: exec:exec and exec:java. The first one can be used to run arbitrary programs. The second to run other Java programs, however the latter does not spawn a new process.

More Info

229 questions
57
votes
3 answers

Maven exec:java goal on a multi-module project

I'm trying to run exec-maven-plugin's exec:java goal on a simple two-module project where one module depends on the other. So far I can't find a configuration that works. Here's a boiled-down test case: + exec-multi-module-test/ + pom.xml +…
Mike Craig
  • 1,677
  • 1
  • 13
  • 22
52
votes
4 answers

From Maven, how do I run a class that lives under src/test/java?

I have inherited a codebase :) Under src/test/java/ there's a file that I need to run (I need to run its public static void main(String[] args), not a @Test method within it). The closest I have got is: mvn -e exec:java…
woddle
  • 1,582
  • 1
  • 18
  • 34
44
votes
5 answers

Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2:java (default-cli)

Im working on Smooks - Camel Integration.Im stuck with an error.The Build Fails when I try to Run it using mvn exec:java [ERROR]: Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2:java (default-cli) on project …
Shrikant Pagar
  • 441
  • 1
  • 4
  • 3
43
votes
6 answers

Maven & Java: The parameters 'mainClass' for goal org.codehaus.mojo:exec-maven-plugin:1.2.1:java are missing or invalid

My Java EE proj builds fine, but when trying to execute get following error: gert@gert-VirtualBox:~/workspace/CDBOOKSTORE$ mvn exec:java [INFO] Scanning for projects... [INFO] [INFO]…
gvanto
  • 1,936
  • 3
  • 21
  • 26
41
votes
2 answers

Running daemon with exec-maven-plugin avoiding `IllegalThreadStateException`

I would like to run a daemon thread which should start on maven package phase. This is what I have in pom.xml: org.codehaus.mojo
drodil
  • 2,292
  • 1
  • 22
  • 37
32
votes
4 answers

Class Not Found exception with exec-maven-plugin when run on Linux

I am trying to run TestNG tests. My Project organization is - src->test->java->com->shn->library The below command works well in Windows but fails in Linux. mvn -X clean exec:java -Dexec.mainClass="com.shn.library.RunSuitesInParallel"…
praneel
  • 1,842
  • 4
  • 19
  • 24
26
votes
4 answers

How to pass systemProperties when invoking exec:java plugin in maven?

I want to use the exec:java plugin to invoke the main class from command line. I can pass arguments from the command line using -Dexec.args="arg0 arg1 arg2", I don't know how to pass system properties. I tried '-Dexec.systemProperties="key=value"`…
Alexandru
  • 25,070
  • 18
  • 69
  • 78
26
votes
2 answers

maven calls external script on both Linux and Windows platforms

I need to run an external script on both Linux and MS-Windows platforms. Do I use the right plugin exec-maven-plugin? Is there a more suitable plugin? What filename should I put in ....?
oHo
  • 51,447
  • 27
  • 165
  • 200
26
votes
5 answers

Launching a windows batch script using Maven exec plugin blocks the build even though the script uses "start"

I am trying to perform integration tasting of the deployment of my application on the top of a custom container. Since my container is custom, I cannot use Maven Cargo plugin to setup the container. My container: Has to be started though a proper…
Edmondo
  • 19,559
  • 13
  • 62
  • 115
23
votes
2 answers

Using Maven 'exec:exec' with Arguments

I have a project configured to build and run with Maven. The project depends on platform specific native libraries, and I'm using the strategy found here to manage those dependencies. Essentially, the .dll or .so files for a particular platform are…
theisenp
  • 8,639
  • 5
  • 39
  • 47
18
votes
4 answers

Process spawned by exec-maven-plugin blocks the maven process

I am trying to execute the following scenario using maven : pre-integration-phase : Start a java based application using a main class (using exec-maven-plugin) integration-phase : Run the integration test cases (using…
Arnab Biswas
  • 4,495
  • 3
  • 42
  • 60
17
votes
2 answers

Maven exec plugin - Executing a python script

I am using maven on Win 7 to build an application. I use the exec plugin to invoke a python script. org.codehaus.mojo exec-maven-plugin 1.2.1
SpikETidE
  • 6,711
  • 15
  • 46
  • 62
15
votes
3 answers

exec-maven-plugin exec:java failing: Cannot assign configuration values to array of type java.lang.String

When executing mvn exec:java it fails to correctly parse the configuration arguments, throwing the following error: [ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:java (default-cli) on project autotest-programmes:…
David Camilleri
  • 205
  • 1
  • 2
  • 6
14
votes
2 answers

How to run maven from eclipse with the -e switch

Is it possible to execute the exec goal with the exec-maven-plugin with the -e switch? I am getting a MojoExecutionException.
MetaChrome
  • 3,210
  • 6
  • 31
  • 48
13
votes
2 answers

Forking Java using the Exec Maven Plugin, without using the `exec` goal

From the documentation: exec:exec execute programs and Java programs in a separate process. exec:java execute Java programs in the same VM. I want to fork a java program. I've already got it working in exec:java but that doesn't fork. So the…
Daniel Kaplan
  • 62,768
  • 50
  • 234
  • 356
1
2 3
15 16