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

<profile><activation><file><exists/> does not work in a multi-project build

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0-alpha-3
    • Component/s: Profiles
    • Labels:
      None

      Description

      I would expect each subproject to have the profile turned on or off depending on whether ${basedir}/file-to-check-for exists.

      Instead, during a multi-project build the profile is either on or off depending on whether the file exists relative to the aggregator pom. The decision is made once.

      Variable substitution doesn't work, so I can't explicitly use <exists>${basedir}/file-to-check-for</exists> or any variation on this theme to workaround the bug.

      Some background to my particular problem. I have 10 modules to build. Some of them are GUI modules and contain a file called plugin.xml in the subproject directory. I want to package these up specially and sign them, ready for deployment to webstart. The other modules are shared and server code and I don't want these packaged in the same way. So, I've got a dependency in my parent pom file which activates a profile called "guibundle" if a plugin.xml file exists in the subproject directory.

        Attachments

        1. DefaultMavenProjectBuilder.java.diff
          3 kB
          Jan Labrie
        2. DefaultMavenProjectBuilder.java
          74 kB
          Jan Labrie
        3. DefaultMavenProjectBuilder.java
          74 kB
          Jan Labrie
        4. screenshot-1.jpg
          50 kB
          David Boden
        5. problemactivation.zip
          2 kB
          David Boden

          Issue Links

            Activity

              People

              • Assignee:
                bentmann Benjamin Bentmann
                Reporter:
                daveboden David Boden
              • Votes:
                19 Vote for this issue
                Watchers:
                24 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: