Maven
  1. Maven
  2. MNG-3597

Using ${project.parent.basedir} in <systemPath/> causes InvalidProjectModelException

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 2.0.8
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Complexity:
      Intermediate
    • Number of attachments :
      0

      Description

      Hi

      although the Anttask <echo message="$

      {project.parent.basedir}" /> prints out the proper path of my multiproject's root directory, I get an InvalidProjectModelException If I try to use it in the <systemPath/> element of a dependency like this:

      <dependency>
      <groupId>org.company.my</groupId>
      <artifactId>xyz</artifactId>
      <version>1.0</version>
      <scope>system</scope>
      <systemPath>${project.parent.basedir}

      /path/to/xyz.jar</systemPath>
      </dependency>

      Also mvn help:effective-pom resolves that property if not used in <systemPath/>

        Activity

        Hide
        Jan Rudert added a comment -

        sorry, forgot the stacktrace:

        [INFO] Trace
        org.apache.maven.reactor.MavenExecutionException: Failed to validate POM for project [...]
        at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:376)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:289)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:126)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:282)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
        Caused by: org.apache.maven.project.InvalidProjectModelException: Failed to validate POM for project [...]
        at org.apache.maven.project.DefaultMavenProjectBuilder.processProjectLogic(DefaultMavenProjectBuilder.java:996)
        at org.apache.maven.project.DefaultMavenProjectBuilder.buildInternal(DefaultMavenProjectBuilder.java:799)
        at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromSourceFileInternal(DefaultMavenProjectBuilder.java:476)
        at org.apache.maven.project.DefaultMavenProjectBuilder.build(DefaultMavenProjectBuilder.java:197)
        at org.apache.maven.DefaultMaven.getProject(DefaultMaven.java:548)
        at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:458)
        at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:524)
        at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:362)
        ... 11 more

        Show
        Jan Rudert added a comment - sorry, forgot the stacktrace: [INFO] Trace org.apache.maven.reactor.MavenExecutionException: Failed to validate POM for project [...] at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:376) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:289) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:126) at org.apache.maven.cli.MavenCli.main(MavenCli.java:282) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) Caused by: org.apache.maven.project.InvalidProjectModelException: Failed to validate POM for project [...] at org.apache.maven.project.DefaultMavenProjectBuilder.processProjectLogic(DefaultMavenProjectBuilder.java:996) at org.apache.maven.project.DefaultMavenProjectBuilder.buildInternal(DefaultMavenProjectBuilder.java:799) at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromSourceFileInternal(DefaultMavenProjectBuilder.java:476) at org.apache.maven.project.DefaultMavenProjectBuilder.build(DefaultMavenProjectBuilder.java:197) at org.apache.maven.DefaultMaven.getProject(DefaultMaven.java:548) at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:458) at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:524) at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:362) ... 11 more
        Hide
        Brett Porter added a comment -

        this isn't a documented expression to my knowledge, and relying on the parent being in the workspace (where it might be in the repository) is unreliable.

        I suggest you might need a pattern like the following: http://brettporter.wordpress.com/2009/06/10/a-maven-friendly-pattern-for-storing-dependencies-in-version-control/

        Show
        Brett Porter added a comment - this isn't a documented expression to my knowledge, and relying on the parent being in the workspace (where it might be in the repository) is unreliable. I suggest you might need a pattern like the following: http://brettporter.wordpress.com/2009/06/10/a-maven-friendly-pattern-for-storing-dependencies-in-version-control/

          People

          • Assignee:
            Unassigned
            Reporter:
            Jan Rudert
          • Votes:
            6 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: