Maven
  1. Maven
  2. MNG-2103

Inheritance of <plugin> overrides that of <execution>

    Details

    • Complexity:
      Intermediate
    • Testcase included:
      yes
    • Number of attachments :
      2

      Description

      The <inherited> settings of <plugin> overrides that of it's <execution>

      By convention, all top level configuration settings are usually overridden by the settings in the lower levels.

        Issue Links

          Activity

          Hide
          Yann Le Du added a comment -

          Hmm... In this case, I would understand the <plugin><inherited>false as "don't inherit whatever is in <plugin> ". So, in modules, <executions> is not inherited and both <execution> don't even exist. What do you think ?
          You can visualize that by running mvn help:effective-pom in parent project.

          Show
          Yann Le Du added a comment - Hmm... In this case, I would understand the <plugin><inherited>false as "don't inherit whatever is in <plugin> ". So, in modules, <executions> is not inherited and both <execution> don't even exist. What do you think ? You can visualize that by running mvn help:effective-pom in parent project.
          Hide
          Prasad Kashyap added a comment -

          I see what you mean. That makes sense only if the <plugin><inherited> is set to false.

          Now flip the inheritance boolean at the <plugin> level to true. Going by the same logic, all executions now would be inherited even if they were individually set to false. Now since the value of <inherited> is true by default, all executions are always inherited and there's no way of overriding them.

          I think this is what we should do.

          <plugin><inherited> set to true by default.
          <execution><inherited> overrides plugin's setting.

          if <plugin><inherited> changed to false, all executions inside it are also not inherited, no matter what their individual settings are.

          Show
          Prasad Kashyap added a comment - I see what you mean. That makes sense only if the <plugin><inherited> is set to false. Now flip the inheritance boolean at the <plugin> level to true. Going by the same logic, all executions now would be inherited even if they were individually set to false. Now since the value of <inherited> is true by default, all executions are always inherited and there's no way of overriding them. I think this is what we should do. <plugin><inherited> set to true by default. <execution><inherited> overrides plugin's setting. if <plugin><inherited> changed to false, all executions inside it are also not inherited, no matter what their individual settings are.
          Hide
          Yann Le Du added a comment -

          I think you're right. I've attached test-inheritance-true.zip that shows your point.

          Show
          Yann Le Du added a comment - I think you're right. I've attached test-inheritance-true.zip that shows your point.
          Hide
          John Casey added a comment -

          Sorry, just reading over this one more closely, and if we're going to pursue adding a new element to the POM, it should wait for 2.1.

          In the meantime, you can override a single execution within a plugin config by making sure it has a matching <id/>.

          Show
          John Casey added a comment - Sorry, just reading over this one more closely, and if we're going to pursue adding a new element to the POM, it should wait for 2.1. In the meantime, you can override a single execution within a plugin config by making sure it has a matching <id/>.
          Hide
          Benjamin Bentmann added a comment -

          Fixed in r931125.

          Show
          Benjamin Bentmann added a comment - Fixed in r931125 .

            People

            • Assignee:
              Benjamin Bentmann
              Reporter:
              Prasad Kashyap
            • Votes:
              2 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: