[
https://issues.apache.org/jira/browse/MNG-5815?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15148172#comment-15148172
]
Peter Kjær Guldbæk commented on MNG-5815:
-----------------------------------------
My machine has been upgraded to Windows 10 Pro in the meantime, so that is what
I am using for this example.
I downloaded
https://builds.apache.org/job/maven-3.x/1211/artifact/apache-maven/target/apache-maven-3.4.0-SNAPSHOT-bin.zip
(followed the link from https://builds.apache.org/job/maven-3.x/1211/ as
referenced in MNG-5963) and extracted it to
"c:\temp\apache-maven-3.4.0-SNAPSHOT-bin".
Started "cmd.exe".
Executed the following:
{noformat}
Microsoft Windows [Version 10.0.10586]
(c) 2015 Microsoft Corporation. All rights reserved.
C:\Users\pkg>cd
\temp\apache-maven-3.4.0-SNAPSHOT-bin\apache-maven-3.4.0-SNAPSHOT
C:\Temp\apache-maven-3.4.0-SNAPSHOT-bin\apache-maven-3.4.0-SNAPSHOT>set path=
C:\Temp\apache-maven-3.4.0-SNAPSHOT-bin\apache-maven-3.4.0-SNAPSHOT>mvn
'mvn' is not recognized as an internal or external command,
operable program or batch file.
C:\Temp\apache-maven-3.4.0-SNAPSHOT-bin\apache-maven-3.4.0-SNAPSHOT>set
path=C:\Temp\apache-maven-3.4.0-SNAPSHOT-bin\apache-maven-3.4.0-SNAPSHOT\bin;c:\Program
Files\Java\jdk1.8.0_31\bin
C:\Temp\apache-maven-3.4.0-SNAPSHOT-bin\apache-maven-3.4.0-SNAPSHOT>mvn -version
Apache Maven 3.4.0-SNAPSHOT (314b174e768ac7223fe4ef61b7256376a09e49d1;
2016-02-03T23:17:08+01:00)
Maven home:
C:\Temp\apache-maven-3.4.0-SNAPSHOT-bin\apache-maven-3.4.0-SNAPSHOT\bin\..
Java version: 1.8.0_31, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.8.0_31\jre
Default locale: en_GB, platform encoding: Cp1252
OS name: "windows 8.1", version: "6.3", arch: "amd64", family: "dos"
C:\Temp\apache-maven-3.4.0-SNAPSHOT-bin\apache-maven-3.4.0-SNAPSHOT>dir pom.xml
Volume in drive C is Boot
Volume Serial Number is 64A1-1E24
Directory of
C:\Temp\apache-maven-3.4.0-SNAPSHOT-bin\apache-maven-3.4.0-SNAPSHOT
File Not Found
C:\Temp\apache-maven-3.4.0-SNAPSHOT-bin\apache-maven-3.4.0-SNAPSHOT>mvn fail &&
echo SUCCESS
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.051 s
[INFO] Finished at: 2016-02-16T07:47:42+01:00
[INFO] Final Memory: 14M/491M
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no
POM in this directory
(C:\Temp\apache-maven-3.4.0-SNAPSHOT-bin\apache-maven-3.4.0-SNAPSHOT). Please
verify you invoked Maven from the correct directory. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e
switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please
read the following articles:
[ERROR] [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/MissingProjectException
SUCCESS
{noformat}
As you can see from the above, the result is still the same. "SUCCESS" should
not be output when "mvn" fails.
I get the feeling that I am doing something wrong, but I have tried to be as
thorough as possible in my reproduction of the problem. Can you perform the
same set of steps and not observe the issue I am experiencing?
> "mvn.cmd" does not indicate failure properly when using "&&"
> ------------------------------------------------------------
>
> Key: MNG-5815
> URL: https://issues.apache.org/jira/browse/MNG-5815
> Project: Maven
> Issue Type: Bug
> Components: Command Line
> Affects Versions: 3.3.1
> Environment: Windows 8.1 Pro 64-bit
> Reporter: Peter Kjær Guldbæk
>
> I recently upgraded from Maven 3.0.4 to 3.3.1. It seems as if "mvn.cmd" no
> longer indicates failure properly when using "&&".
> Invoking "mvn foo && echo SUCCESS!" using Maven 3.0.4 on Windows causes the
> following output (notice no trace of "SUCCESS!" as "mvn" fails):
> {noformat}
> c:\Temp>mvn foo && echo SUCCESS!
> [INFO] Scanning for projects...
> [INFO]
> ------------------------------------------------------------------------
> [INFO] BUILD FAILURE
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 0.061s
> [INFO] Finished at: Tue Apr 28 14:08:27 CEST 2015
> [INFO] Final Memory: 10M/491M
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] The goal you specified requires a project to execute but there is no
> POM in this directory (c:\Temp). Please verify you invoked Maven from the
> correct directory. -> [Help 1]
> [ERROR]
> [ERROR] To see the full stack trace of the errors, re-run Maven with the -e
> switch.
> [ERROR] Re-run Maven using the -X switch to enable full debug logging.
> [ERROR]
> [ERROR] For more information about the errors and possible solutions, please
> read the following articles:
> [ERROR] [Help 1]
> http://cwiki.apache.org/confluence/display/MAVEN/MissingProjectException
> {noformat}
> Invoking "mvn foo && echo SUCCESS!" using Maven 3.3.1 on Windows causes the
> following output (notice "SUCCESS!" is echoed even though "mvn" fails):
> {noformat}
> c:\Temp>mvn foo && echo SUCCESS!
> [INFO] Scanning for projects...
> [INFO]
> ------------------------------------------------------------------------
> [INFO] BUILD FAILURE
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 0.053 s
> [INFO] Finished at: 2015-04-28T14:09:19+02:00
> [INFO] Final Memory: 13M/491M
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] The goal you specified requires a project to execute but there is no
> POM in this directory (c:\Temp). Please verify you invoked Maven from the
> correct directory. -> [Help 1]
> [ERROR]
> [ERROR] To see the full stack trace of the errors, re-run Maven with the -e
> switch.
> [ERROR] Re-run Maven using the -X switch to enable full debug logging.
> [ERROR]
> [ERROR] For more information about the errors and possible solutions, please
> read the following articles:
> [ERROR] [Help 1]
> http://cwiki.apache.org/confluence/display/MAVEN/MissingProjectException
> SUCCESS!
> {noformat}
> It is a little strange that it does not work in Maven 3.3.1 as invoking "mvn
> foo" actually causes "%ERRORLEVEL%" to be set to "1":
> {noformat}
> c:\Temp>mvn foo
> [INFO] Scanning for projects...
> [INFO]
> ------------------------------------------------------------------------
> [INFO] BUILD FAILURE
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 0.052 s
> [INFO] Finished at: 2015-04-28T14:09:41+02:00
> [INFO] Final Memory: 13M/491M
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] The goal you specified requires a project to execute but there is no
> POM in this directory (c:\Temp). Please verify you invoked Maven from the
> correct directory. -> [Help 1]
> [ERROR]
> [ERROR] To see the full stack trace of the errors, re-run Maven with the -e
> switch.
> [ERROR] Re-run Maven using the -X switch to enable full debug logging.
> [ERROR]
> [ERROR] For more information about the errors and possible solutions, please
> read the following articles:
> [ERROR] [Help 1]
> http://cwiki.apache.org/confluence/display/MAVEN/MissingProjectException
> c:\Temp>echo %ERRORLEVEL%
> 1
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)