[ 
https://issues.apache.org/jira/browse/MNG-6368?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16381199#comment-16381199
 ] 

Gene Smith commented on MNG-6368:
---------------------------------

explicitly checking file permissions on a zip file can be done with (unzip -Z)

checking the Maven 3.5.2 distribution shows a mix of permissions in the bin 
directory:
{quote}{{gsmith@gsmith-pc /tmp/foo}}
{{$ unzip -Z apache-maven-3.5.2-bin.zip  | grep /bin/}}
{{drwxr-xr-x  2.0 unx        0 b- stor 17-Oct-18 08:59 apache-maven-3.5.2/bin/}}
{{-rwxr-xr-x  2.0 unx     5969 bl defN 17-Oct-18 08:55 
apache-maven-3.5.2/bin/mvn}}
{{-rwxr-xr-x  2.0 unx     1532 bl defN 17-Oct-18 08:55 
apache-maven-3.5.2/bin/mvnyjp}}
{{-rwxr-xr-x  2.0 unx     1485 bl defN 17-Oct-18 08:55 
apache-maven-3.5.2/bin/mvnDebug}}
{{-rw-r--r--  2.0 unx      228 bl defN 17-Oct-18 08:55 
apache-maven-3.5.2/bin/m2.conf}}
{{-rw-r--r--  2.0 unx     6354 bl defN 17-Oct-18 08:55 
apache-maven-3.5.2/bin/mvn.cmd}}
{{-rw-r--r--  2.0 unx     1668 bl defN 17-Oct-18 08:55 
apache-maven-3.5.2/bin/mvnDebug.cmd}}
{quote}
Cygwin and Windows Command Prompt may both find an executable file from that (a 
full Cygwin can use the shell "mvn", and "cmd" will use a "mvn.cmd" even 
without the "right" permissions), while Java's process invoker will NOT find an 
executable (it can't use the shell, and wont use fuzzy permissions).

So that mix of permissions on the files causes a slow failure when the 
"maven-invoker-plugin" looks for an executable.  I would probably also see this 
in Ant if I had got to that workflow first, but would have gotten a clearer 
message.

I am not sure there is a good fix for this, because the fundamental issue may 
be Windows.  But it would be good for the invoker to report it can't find an 
executable instead of failing without logging.

> Maven 3.5.2 breaks the Maven Invoker Plugin on Windows
> ------------------------------------------------------
>
>                 Key: MNG-6368
>                 URL: https://issues.apache.org/jira/browse/MNG-6368
>             Project: Maven
>          Issue Type: Bug
>    Affects Versions: 3.5.2
>         Environment: Windows 7
> run from cygwin with January 2017 updates
>            Reporter: Gene Smith
>            Priority: Minor
>         Attachments: test-maven-invoker-plugin.zip
>
>
> *I found a work around (credit Robert Scholte's quetion for the clue)..*
>  * *make sure all files in $MAVEN_HOME/bin are executable***
> Maven 3.5.2 will not tell you why maven-invoker-fails if it can't find an 
> executable.
> ...................
> With Maven 3.5.2 on Windows 7,. the Maven Invoker Plugin breaks:
>  * reporting
>  _The Maven invocation failed. Error while executing process._
>  * leaving empty log files, and streaming nothing from the invoked process
> I have multiple uses in a large project, which have has been working for us 
> through many version of Maven.  They all break, *on Windows with:*
>  * a simple clean attempt to upgrade to Maven 3.5.2.
>  (without changing any plugin versions)
>  * a complex upgrade attempt, advancing forward as many plugin versions as 
> can be pushed.
> The complex upgrade attempt works with Maven 3.5.0.
> And on testing to isolate it, Maven 3.5.2 + Maven Invoker Plugin 2+ breaks 
> even in simplest form invoking:
>  * an empty jar project with no inheritance
>  * an empty pom project with no inheritance
>  * an empty jar project with direct inheritance from the invoker
>  * an empty pom project with direct inheritance from the invoker
> The attached zip very simple test project, which
>  * works with:
>  ** Maven 3.0.5, 3.1.1, 3.2.1, 3.3.3, 3.3.9
>  *** maven-invoker-plugin 1.6, 1.7, 1.8, 1.9, 2.0.0, 3.0.0, 3.0.1
>  ** Maven 3.5.0
>  *** maven-invoker-plugin 2.0.0, 3.0.0, 3.0.1
>  * *breaks with:*
>  ** Maven 3.5.2
>  *** maven-invoker-plugin 1.6, 1.7, 1.8, 1.9, 2.0.0, 3.0.0, 3.0.1
> I looked through sources and was able to test with this built locally (but my 
> task is timeboxed and I have not been able to get Maven built from sources in 
> the time I have):
>  * 
> [http://svn.apache.org/repos/asf/maven/plugins/tags/maven-invoker-plugin-3.0.1]
> and traced it as far as the call to:
>  * org.apache.maven.shared.invoker.Invoker
>                 try
>                 
> {                     result = invoker.execute( request );                 }
>                 catch ( final MavenInvocationException e )
>                 
> {                     getLog().debug( "Error invoking Maven: " + 
> e.getMessage(), e );                     throw new RunFailureException( 
> "Maven invocation failed. " + e.getMessage(),                                 
>                    BuildJob.Result.FAILURE_BUILD );                 }
> but it invoker hides all trace, and I do not have time (I am time boxed this 
> week) to get Maven built from sources to trace it into the Invoker.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to