Maven 1

artifact relative path not correctly computed when override is on

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Cannot Reproduce
  • Affects Version/s: 1.0-rc3
  • Fix Version/s: 1.0-rc3
  • Component/s: core
  • Labels:
    None
  • Number of attachments :
    0

Description

line 77 in ArtifactListBuilder is :
artifact.setPath( new File( mavenJarProperty ).getAbsolutePath() );

this assumes project.xml is located in user.dir. thus if running from elsewhere, we have to explicitely change, then restore, user.dir property.

i think this should be corrected by something like :
artifact.setPath( new File( project.getFile().getParentFile(), mavenJarProperty ).getAbsolutePath() );

– gd

Activity

Hide
Brett Porter added a comment -

not sure this covers all cases - what if the property was defined in a parent directory? Will need to set up some tests, probably want to resolve these values in the context like for MAVEN_REPO_LOCAL etc

Show
Brett Porter added a comment - not sure this covers all cases - what if the property was defined in a parent directory? Will need to set up some tests, probably want to resolve these values in the context like for MAVEN_REPO_LOCAL etc
Hide
Brett Porter added a comment -

cannot reproduce: run
maven -p src/test/touchstone-tests/project.xml touchstone-tests
and it works

how are you making the directory change without changing user.dir?

Show
Brett Porter added a comment - cannot reproduce: run maven -p src/test/touchstone-tests/project.xml touchstone-tests and it works how are you making the directory change without changing user.dir?
Hide
gilles dodinet added a comment -

actually, i explicitely set user.dir (via a call to System.setProperty(..)) and restore it back later, i compute the user.dir property from pom.getFile().

I encountered this issue while writing the mevenide synchronizer [1]. if i dont set user.dir i end up with such a file : E:/eclipse/<overrideValue> where E:/eclipse is the original user.dir

also this indeed doesnot cover all use cases, f.i. if the value defined in properties is an absolute path it obviously wont work, on the other hand if the property is defined in the context of the parent pom, then is not project variable refering to the parent or does it still refer to the current project ?

[1] :pserver:anonymous@cvs.mevenide.codehaus.org/home/projects/scm/mevenide-ui-eclipse : /src/java/org/mevenide/ui/eclipse/sync/model/MavenProjectNode.java

Show
gilles dodinet added a comment - actually, i explicitely set user.dir (via a call to System.setProperty(..)) and restore it back later, i compute the user.dir property from pom.getFile(). I encountered this issue while writing the mevenide synchronizer [1]. if i dont set user.dir i end up with such a file : E:/eclipse/<overrideValue> where E:/eclipse is the original user.dir also this indeed doesnot cover all use cases, f.i. if the value defined in properties is an absolute path it obviously wont work, on the other hand if the property is defined in the context of the parent pom, then is not project variable refering to the parent or does it still refer to the current project ? [1] :pserver:anonymous@cvs.mevenide.codehaus.org/home/projects/scm/mevenide-ui-eclipse : /src/java/org/mevenide/ui/eclipse/sync/model/MavenProjectNode.java

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: