You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Brian Fox (JIRA)" <ji...@codehaus.org> on 2007/07/03 05:19:13 UTC

[jira] Created: (MNG-3085) mvn script isn't setting maven.home correctly with cygwin on xp

mvn script isn't setting maven.home correctly with cygwin on xp
---------------------------------------------------------------

                 Key: MNG-3085
                 URL: http://jira.codehaus.org/browse/MNG-3085
             Project: Maven 2
          Issue Type: Bug
          Components: Command Line
    Affects Versions: 2.0.7
            Reporter: Brian Fox



The script is generating the following execution:
{noformat} 
/cygdrive/c/program files/java/jdk1.5.0_11/bin/java -classpath c:\program files\
maven2/boot/classworlds-1.1.jar -Dclassworlds.conf=c:\program files\maven2/bin/m
2.conf -Dmaven.home=c:\program files\maven2 org.codehaus.classworlds.Launcher
{noformat} 

In the invoker, it attempts to read the env to find the maven executable. Augmented with debug;
{code:title=MavenCommandLineBuilder.java|borderStyle=solid}
   if ( mavenHome == null )
        {
            String mavenHomeProperty = System.getProperty( "maven.home" );
            System.out.println("maven.home="+mavenHomeProperty);
            if ( mavenHomeProperty != null )
            {
                mavenHome = new File( mavenHomeProperty );
                System.out.println("mavenHome="+mavenHome.getAbsolutePath());
                System.out.println("mavenHome.isDirectory="+mavenHome.isDirectory());
                if ( !mavenHome.isDirectory() )
                {
                    File binDir = mavenHome.getParentFile();
                    System.out.println("binDir="+binDir);
                    if ( "bin".equals( binDir.getName() ) )
                    {
                        // ah, they specified the mvn executable instead...
                        mavenHome = binDir.getParentFile();
                    }
                    else
                    {
                        throw new IllegalStateException( "${maven.home} is not specified as a directory: \'"
                            + mavenHomeProperty + "\'." );
                    }
                }
            }
{code}

Results in:
{noformat} 
maven.home=${env.M2_HOME}
mavenHome=e:\svn\maven\maven-plugins\maven-eclipse-plugin\${env.M2_HOME}
mavenHome.isDirectory=false
binDir=null
{noformat} 

And crashes on  if ( "bin".equals( binDir.getName() ) )

I tried modifying the cygpath commands to remove the space and reverse the backslashes in the -Dmaven.home= but none of them seemed to work.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Closed: (MNG-3085) mvn script isn't setting maven.home correctly with cygwin on xp

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-3085?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brett Porter closed MNG-3085.
-----------------------------

       Resolution: Cannot Reproduce
    Fix Version/s:     (was: 2.2.x (to be reviewed))
         Assignee: Brett Porter

help:system shows maven.home set properly on 2.2.1

> mvn script isn't setting maven.home correctly with cygwin on xp
> ---------------------------------------------------------------
>
>                 Key: MNG-3085
>                 URL: http://jira.codehaus.org/browse/MNG-3085
>             Project: Maven 2 & 3
>          Issue Type: Bug
>          Components: Command Line
>    Affects Versions: 2.0.7
>            Reporter: Brian Fox
>            Assignee: Brett Porter
>
> The script is generating the following execution:
> {noformat} 
> /cygdrive/c/program files/java/jdk1.5.0_11/bin/java -classpath c:\program files\
> maven2/boot/classworlds-1.1.jar -Dclassworlds.conf=c:\program files\maven2/bin/m
> 2.conf -Dmaven.home=c:\program files\maven2 org.codehaus.classworlds.Launcher
> {noformat} 
> In the invoker, it attempts to read the env to find the maven executable. Augmented with debug;
> {code:title=MavenCommandLineBuilder.java|borderStyle=solid}
>    if ( mavenHome == null )
>         {
>             String mavenHomeProperty = System.getProperty( "maven.home" );
>             System.out.println("maven.home="+mavenHomeProperty);
>             if ( mavenHomeProperty != null )
>             {
>                 mavenHome = new File( mavenHomeProperty );
>                 System.out.println("mavenHome="+mavenHome.getAbsolutePath());
>                 System.out.println("mavenHome.isDirectory="+mavenHome.isDirectory());
>                 if ( !mavenHome.isDirectory() )
>                 {
>                     File binDir = mavenHome.getParentFile();
>                     System.out.println("binDir="+binDir);
>                     if ( "bin".equals( binDir.getName() ) )
>                     {
>                         // ah, they specified the mvn executable instead...
>                         mavenHome = binDir.getParentFile();
>                     }
>                     else
>                     {
>                         throw new IllegalStateException( "${maven.home} is not specified as a directory: \'"
>                             + mavenHomeProperty + "\'." );
>                     }
>                 }
>             }
> {code}
> Results in:
> {noformat} 
> maven.home=${env.M2_HOME}
> mavenHome=e:\svn\maven\maven-plugins\maven-eclipse-plugin\${env.M2_HOME}
> mavenHome.isDirectory=false
> binDir=null
> {noformat} 
> And crashes on  if ( "bin".equals( binDir.getName() ) )
> I tried modifying the cygpath commands to remove the space and reverse the backslashes in the -Dmaven.home= but none of them seemed to work.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (MNG-3085) mvn script isn't setting maven.home correctly with cygwin on xp

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-3085?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brett Porter updated MNG-3085:
------------------------------

    Fix Version/s: 2.0.x

I think I'd prefer to make the invoker better at handling this if possible?

> mvn script isn't setting maven.home correctly with cygwin on xp
> ---------------------------------------------------------------
>
>                 Key: MNG-3085
>                 URL: http://jira.codehaus.org/browse/MNG-3085
>             Project: Maven 2
>          Issue Type: Bug
>          Components: Command Line
>    Affects Versions: 2.0.7
>            Reporter: Brian Fox
>             Fix For: 2.0.x
>
>
> The script is generating the following execution:
> {noformat} 
> /cygdrive/c/program files/java/jdk1.5.0_11/bin/java -classpath c:\program files\
> maven2/boot/classworlds-1.1.jar -Dclassworlds.conf=c:\program files\maven2/bin/m
> 2.conf -Dmaven.home=c:\program files\maven2 org.codehaus.classworlds.Launcher
> {noformat} 
> In the invoker, it attempts to read the env to find the maven executable. Augmented with debug;
> {code:title=MavenCommandLineBuilder.java|borderStyle=solid}
>    if ( mavenHome == null )
>         {
>             String mavenHomeProperty = System.getProperty( "maven.home" );
>             System.out.println("maven.home="+mavenHomeProperty);
>             if ( mavenHomeProperty != null )
>             {
>                 mavenHome = new File( mavenHomeProperty );
>                 System.out.println("mavenHome="+mavenHome.getAbsolutePath());
>                 System.out.println("mavenHome.isDirectory="+mavenHome.isDirectory());
>                 if ( !mavenHome.isDirectory() )
>                 {
>                     File binDir = mavenHome.getParentFile();
>                     System.out.println("binDir="+binDir);
>                     if ( "bin".equals( binDir.getName() ) )
>                     {
>                         // ah, they specified the mvn executable instead...
>                         mavenHome = binDir.getParentFile();
>                     }
>                     else
>                     {
>                         throw new IllegalStateException( "${maven.home} is not specified as a directory: \'"
>                             + mavenHomeProperty + "\'." );
>                     }
>                 }
>             }
> {code}
> Results in:
> {noformat} 
> maven.home=${env.M2_HOME}
> mavenHome=e:\svn\maven\maven-plugins\maven-eclipse-plugin\${env.M2_HOME}
> mavenHome.isDirectory=false
> binDir=null
> {noformat} 
> And crashes on  if ( "bin".equals( binDir.getName() ) )
> I tried modifying the cygpath commands to remove the space and reverse the backslashes in the -Dmaven.home= but none of them seemed to work.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira