You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Gaurav Chhabra (JIRA)" <ji...@apache.org> on 2015/07/04 15:21:04 UTC

[jira] [Commented] (MNG-5804) mvn.bat does not work in root directory on Windows

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

Gaurav Chhabra commented on MNG-5804:
-------------------------------------

I downloaded apache-maven-3.3.3 today and after setting JAVA_HOME, MAVEN_HOME and Path, when i tried mvn -v in d:\git\ dir,

d:\git>mvn -v
Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22T17:27:37+05:30)
Maven home: C:\apache-maven-3.3.3\bin\..
Java version: 1.7.0_67, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.7.0_67\jre
Default locale: en_IN, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"

However, if i try running the same command in d:\ instead, i get usage hint,

d:\git>cd\

d:\>mvn -v
Usage: java [-options] class [args...]
           (to execute a class)
   or  java [-options] -jar jarfile [args...]
           (to execute a jar file)



> mvn.bat does not work in root directory on Windows
> --------------------------------------------------
>
>                 Key: MNG-5804
>                 URL: https://issues.apache.org/jira/browse/MNG-5804
>             Project: Maven
>          Issue Type: Bug
>          Components: Command Line
>    Affects Versions: 3.3.1
>         Environment: Win7 x64 german
>            Reporter: Bernd Eckenfels
>            Assignee: Robert Scholte
>            Priority: Minor
>              Labels: windows,
>
> On Windows the new `mvn.cmd` script does not work if the current working directory is the root dir of a drive. In that case it will initialize  `%MAVEN_PROJECTBASEDIR%` with a trailing `\` and that will break the java command line as it escapes the following quote of `"-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%"`.
> It works on 3.2.1 and fails with 3.3.1:
> {code}
> c:\> cd /d C:\
> c:\>c:\devenv\apache-maven-3.2.1\bin\mvn --version
> Apache Maven 3.2.1 (ea8b2b07643dbb1b84b6d16e1f08391b666bc1e9; 2014-02-14T18:37:52+01:00)
> Maven home: c:\devenv\apache-maven-3.2.1\bin\..
> ...
> c:\>c:\devenv\apache-maven-3.3.1\bin\mvn --version
> Usage: java [-options] class [args...]
> ...
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)