Closed YounesRahimi closed 8 years ago
Let me know your environment
|&
is a bashism to redirect both stderr and stdout. Try it without &
If that works maybe we can find a posix solution or add both redirections as an feature option (redirect-both) or global option (no-posix)
That was added for detect old java version, so I guess is fair to detect it with bash<4. |&
was introduced on bash 4.
Feel free to reopen if it keeps failing, Thanks.
Hi @albfan. The first bug fixed, but the class cannot run yet. the error is this:
executing ir.iais.activemqtut.salary.ActiveMQMailApp
mvn exec:exec -Dexec.executable=/Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/bin/java -Dexec.workingdir=. -Dexec.args=-cp target/classes:target/test-classes:target/dependency/activemq-all-5.13.3.jar:target/dependency/hamcrest-core-1.3.jar:target/dependency/junit-4.12.jar:target/dependency/log4j-1.2.17.jar:target/dependency/slf4j-api-1.7.7.jar:target/dependency/slf4j-log4j12-1.7.12.jar ir.iais.activemqtut.salary.ActiveMQMailApp
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building ActiveMQ-Tutorial 0.0.1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- exec-maven-plugin:1.2:exec (default-cli) @ ActiveMQ-Tutorial ---
Error: Could not find or load main class ir.iais.activemqtut.salary.ActiveMQMailApp
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.448 s
[INFO] Finished at: 2016-08-10T11:58:21+04:30
[INFO] Final Memory: 9M/309M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2:exec (default-cli) on project ActiveMQ-Tutorial: Command execution failed. Process exited with an error: 1(Exit value: 1) -> [Help 1]
I added a line to mvnexec file to print out the maven command on line 2. I'm on Mac OS X 10.11.6 with jdk1.8.0_65 using Oh My ZSH in iTerm2 v3!
While running ActiveMQMailApp class has problem, another class in this project ( ir.iais.activemqtut.App) can be run nicely.
▶ mvnexec
1) ir.iais.activemqtut.App
2) ir.iais.activemqtut.salary.ActiveMQMailApp
#?
Body of ActiveMQMailApp is as same as before.
I bet MailConsumer.initService();
is crashing in some way. See it exits with a 1 value.
Maybe a try/catch on main method with a printStacktrace() would give you a hint of the problem.
If your code is avaliable would be interesting to see if there's something about plugin exec version configurable, because there's a problem with output flush prior to version 1.3.2 and you (and everybody I guess) use 1.2 version through mvnexec.
https://github.com/mojohaus/exec-maven-plugin/commit/23fe65fbf5bf2b4ffe241d30b754342a2674c80c
The error lines are these;
My class is:
I also commented all body of main method but it still throw the same error.
ActiveMQMailApp class run with this command correctly: