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

FileProfileActivator changes FileProfileActivator.exists which lets flattened resolveCiFriendliesOnly depending fail activating profile

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.2.2, 3.6.2
    • 3.8.5, 4.0.0-alpha-2, 4.0.0
    • Profiles
    • None

    Description

      In my pom.xml I have

       

      ...
       <profile> 
          <profile> 
             <id>cas-mule4-app</id> 
          <activation> 
             <file> 
                <exists>mule-artifact.json</exists> 
             </file>
          </activation> 
      ...

       

      which worked fine.

      After switching to ci-friendly pom.xml with revision and flatten the published .flattened-pom.xml contains absolute path:

       

          <profile>
            <id>cas-mule4-app</id>
            <activation>
              <file>
                <exists>D:\jenkins\workspace\mulestac-multibranch_mule4-DWHLMU7ZMPDNCYK6LVMSYLB6GODEIQS7CUNRQQVSISU47ME72PRQ\mule-artifact.json</exists>
              </file>
            </activation>
      

       

      (which is the temporary path of our jenkins container)

      and so other projects using that pom.xml as parent will fail to activate the profile.

       

      This came in with MNG-1775 or a related issue via adding

              // replace activation value with interpolated value
              if ( missing )
              {
                  file.setMissing( path );
              }
              else
              {
                  file.setExists( path );
              }
      

      in org.apache.maven.model.profile.activation.FileProfileActivator.

       

      Attachments

        Issue Links

          Activity

            People

              michael-o Michael Osipov
              ca-stefan-cordes Stefan Cordes
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: