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

${project.basedir} in profile activation exists clause strange behavior

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Not A Problem
    • 3.0.5, 3.1.0
    • None
    • Profiles
    • None

    Description

      directory structure:

       pom.xml
       dir
      

      relevant pom part:

      <profiles>
      		<profile>
      		    <id>P1</id>
      		    <activation>
              		<file>
              		    <exists>${project.basedir}/dir/</exists>
      		        </file>
      		    </activation>
      		</profile>
      		<profile>
          		<id>P2</id>
      		    <activation>
      		        <file>
              		    <exists>${basedir}/dir/</exists>
      		        </file>
      		    </activation>
      		</profile>
      	 </profiles>
      
      mvn help:profiles-all
      
        Profile Id: P2 (Active: true , Source: pom)
        Profile Id: P1 (Active: false , Source: pom)
      

      Since dir exists this leads to conclusion that ${project.basedir} in P1 does not resolve properly.

      mvn help:effective-pom relevant part:
      
        <profiles>
          <profile>
            <id>P1</id>
            <activation>
              <file>
                <exists>/home/isipka/NetBeansProjects/test-maven/simple/dir/</exists>
              </file>
            </activation>
          </profile>
          <profile>
            <id>P2</id>
            <activation>
              <file>
                <exists>/home/isipka/NetBeansProjects/test-maven/simple/dir/</exists>
              </file>
            </activation>
          </profile>
        </profiles>
      

      both ${project.basedir} in P1 and ${basedir} in P2 have resolved properly.

      AFAIK this is a bug. If not, or you need additional info please contact me. I have tested this on 3.0.5 the behavior is the same. I have found out about it here http://stackoverflow.com/q/18868772/679982

      Attachments

        1. project.tar.gz
          12 kB
          Ivan ?ipka

        Issue Links

          Activity

            People

              rfscholte Robert Scholte
              linski Ivan ?ipka
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: