Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-8095

Usage of session.rootDirectory / session.topDirectory does not work

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Not A Problem
    • 3.9.2, 3.9.3, 3.9.4, 3.9.5, 3.9.6
    • None
    • Core
    • None

    Description

      I have setup a project which uses the following parts (https://maven.apache.org/docs/3.9.2/release-notes.html)

      • ${session.topDirectory}
      • ${session.rootDirectory}
      • ${project.rootDirectory}
        but unfortately they are not being replaced during the run of the project... A small excerpt from the project... using the following simple configuration:
              <plugin>
                <groupId>com.soebes.maven.plugins</groupId>
                <artifactId>echo-maven-plugin</artifactId>
                <version>0.5.0</version>
                <executions>
                  <execution>
                    <phase>initialize</phase>
                    <goals>
                      <goal>echo</goal>
                    </goals>
                    <configuration>
                      <echos>
        </echo>
                        <echo>project.rootDirectory: '${project.rootDirectory}'</echo>
                        <echo>session.rootDirectory: '${session.rootDirectory}'</echo>
                        <echo>session.topDirectory: '${session.topDirectory}'</echo>
                        <echo>project.basedir: '${project.basedir}'</echo>
                        <echo>project.build.directory: '${project.build.directory}'</echo>
        </echo>
                      </echos>
                    </configuration>
                  </execution>
                </executions>
              </plugin>
        

      My expectation is that during the build the values should be replaced with the appropriate values which works with Maven 4 (Tested with Maven 4-alpha-13) like this:

      [INFO] --- echo:0.5.0:echo (default) @ sub-mod-2 ---
      [INFO] =========================================================
      [INFO] project.rootDirectory: '/projects/props'
      [INFO] session.rootDirectory: '/projects/props'
      [INFO] session.topDirectory: '/projects/props'
      [INFO] project.basedir: '/projects/props/sub-mod-2'
      [INFO] project.build.directory: '/projects/props/sub-mod-2/target'
      [INFO] =========================================================
      

      But the run with Maven 3.9.X it looks like this:

      [INFO] --- echo:0.5.0:echo (default) @ sub-mod-2 ---
      [INFO] =========================================================
      [INFO] project.rootDirectory: '${project.rootDirectory}'
      [INFO] session.rootDirectory: '${session.rootDirectory}'
      [INFO] session.topDirectory: '${session.topDirectory}'
      [INFO] project.basedir: '/projects/props/sub-mod-2'
      [INFO] project.build.directory: '/projects/props/sub-mod-2/target'
      [INFO] =========================================================
      

      I have setup a full working example here:
      https://github.com/khmarbaise/maven-bugs/tree/master/MNG-8095

      Attachments

        Issue Links

          Activity

            People

              khmarbaise Karl Heinz Marbaise
              khmarbaise Karl Heinz Marbaise
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: