You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Ittay Dror (JIRA)" <ji...@codehaus.org> on 2008/07/03 08:27:27 UTC

[jira] Created: (MNG-3646) project's output directory cannot be set to absolute path

project's output directory cannot be set to absolute path
---------------------------------------------------------

                 Key: MNG-3646
                 URL: http://jira.codehaus.org/browse/MNG-3646
             Project: Maven 2
          Issue Type: Bug
    Affects Versions: 2.0.8
            Reporter: Ittay Dror


I want to be able to set the output (target) directory to some absolute path outside of the source tree. What I'm trying to do is set <build><directory> to ${output}/${project.artifactId}/${project.groupId}, where 'output' is passed from the command line. 

Looking at the 2.0.8 code, this is what happens:
* DefaultMavenProjectBuilder.buildInternal calls pathTranslator.alignToBaseDirectory( project.getModel(), projectDescriptor.getParentFile() );
* DefaultPathTranslagor.alignToBaseDirectory calles build.setDirectory,  build.setSourceDirectory and build.setTestSourceDirectory all with calling the method alignToBaseDirectory(String, File) where the string is the current value of the above and File is the base directory
* alignToBaseDirectory(String, File) calls requiresBaseDirectoryAlignment with the string
* requiresBaseDirectoryAlignment constructs a File on top of the string and then calls File.isAbsolute to find if the path is absolute
* since a path in the form of "${something}" is not considered by File to be absolute, alignToBaseDirectory adds basedir to the path.

So the final result is that passing -Doutput=/tmp results in the output directory being set to something like /home/ittayd/dev/tmp/com.company/artifact which is not what I intended. 

I can go around this in linux by using '/${output}/${project.artifactId}/${project.groupId}', but this won't work in windows (for two reasons: 1. '/' is not interpreted as a path separator (in Win32FileSystem) and 2. even if it did, it will not allow setting output to 'D:\TEMP')



-- 
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-3646) project's output directory cannot be set to absolute path

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

Brett Porter closed MNG-3646.
-----------------------------

       Resolution: Cannot Reproduce
    Fix Version/s:     (was: 2.2.x)

this works for me in 2.2.1

> project's output directory cannot be set to absolute path
> ---------------------------------------------------------
>
>                 Key: MNG-3646
>                 URL: http://jira.codehaus.org/browse/MNG-3646
>             Project: Maven 2 & 3
>          Issue Type: Bug
>    Affects Versions: 2.0.8
>            Reporter: Ittay Dror
>
> I want to be able to set the output (target) directory to some absolute path outside of the source tree. What I'm trying to do is set <build><directory> to ${output}/${project.artifactId}/${project.groupId}, where 'output' is passed from the command line. 
> Looking at the 2.0.8 code, this is what happens:
> * DefaultMavenProjectBuilder.buildInternal calls pathTranslator.alignToBaseDirectory( project.getModel(), projectDescriptor.getParentFile() );
> * DefaultPathTranslagor.alignToBaseDirectory calles build.setDirectory,  build.setSourceDirectory and build.setTestSourceDirectory all with calling the method alignToBaseDirectory(String, File) where the string is the current value of the above and File is the base directory
> * alignToBaseDirectory(String, File) calls requiresBaseDirectoryAlignment with the string
> * requiresBaseDirectoryAlignment constructs a File on top of the string and then calls File.isAbsolute to find if the path is absolute
> * since a path in the form of "${something}" is not considered by File to be absolute, alignToBaseDirectory adds basedir to the path.
> So the final result is that passing -Doutput=/tmp results in the output directory being set to something like /home/ittayd/dev/tmp/com.company/artifact which is not what I intended. 
> I can go around this in linux by using '/${output}/${project.artifactId}/${project.groupId}', but this won't work in windows (for two reasons: 1. '/' is not interpreted as a path separator (in Win32FileSystem) and 2. even if it did, it will not allow setting output to 'D:\TEMP')

-- 
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-3646) project's output directory cannot be set to absolute path

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

Brett Porter updated MNG-3646:
------------------------------

    Fix Version/s: 2.0.x

please review if this use case works for you in 2.0.10 as the order of interpolation and alignment has been corrected in some cases.

> project's output directory cannot be set to absolute path
> ---------------------------------------------------------
>
>                 Key: MNG-3646
>                 URL: http://jira.codehaus.org/browse/MNG-3646
>             Project: Maven 2
>          Issue Type: Bug
>    Affects Versions: 2.0.8
>            Reporter: Ittay Dror
>             Fix For: 2.0.x
>
>
> I want to be able to set the output (target) directory to some absolute path outside of the source tree. What I'm trying to do is set <build><directory> to ${output}/${project.artifactId}/${project.groupId}, where 'output' is passed from the command line. 
> Looking at the 2.0.8 code, this is what happens:
> * DefaultMavenProjectBuilder.buildInternal calls pathTranslator.alignToBaseDirectory( project.getModel(), projectDescriptor.getParentFile() );
> * DefaultPathTranslagor.alignToBaseDirectory calles build.setDirectory,  build.setSourceDirectory and build.setTestSourceDirectory all with calling the method alignToBaseDirectory(String, File) where the string is the current value of the above and File is the base directory
> * alignToBaseDirectory(String, File) calls requiresBaseDirectoryAlignment with the string
> * requiresBaseDirectoryAlignment constructs a File on top of the string and then calls File.isAbsolute to find if the path is absolute
> * since a path in the form of "${something}" is not considered by File to be absolute, alignToBaseDirectory adds basedir to the path.
> So the final result is that passing -Doutput=/tmp results in the output directory being set to something like /home/ittayd/dev/tmp/com.company/artifact which is not what I intended. 
> I can go around this in linux by using '/${output}/${project.artifactId}/${project.groupId}', but this won't work in windows (for two reasons: 1. '/' is not interpreted as a path separator (in Win32FileSystem) and 2. even if it did, it will not allow setting output to 'D:\TEMP')

-- 
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