Maven Changes Plugin
  1. Maven Changes Plugin
  2. MCHANGES-145

Make it possible to run the announcement goals only once for a multi-module project

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1
    • Fix Version/s: 2.3
    • Component/s: announcement
    • Labels:
      None
    • Environment:
      maven 2.0.9
      JDK 1.6.011
      WinXP

      Description

      If the pom.xml is containing some sub-modules, the goal changes:announcement-mail is trying to send it for each module, and fail because it could not find the template.
      Announcement template C:\Dev\MyProject\SubmoduleA\target\announcement\announcement.vm not found...

      Should be possible to configure the pom to send only the email for the root project.
      Working with "mvn --non-recursive" option, but we need to be able to configure this behaviour into the pom.xml

      The same issue for the changes:announcement-generate, but it's only a warning and the build can finish successfully.

      Should include something like:
      /**

      • @parameter expression="$ {project}

        "
        **/
        private MavenProject mavenProject;

      /**

      • If true, will generate the changes only for the root module in case of project with sub-modules.
      • @parameter expression="$ {plugin.aggregate}

        " default-value = "false"
        */
        private boolean aggregate;

      public void execute() {
      if (!mavenProject.isExecutionRoot() && aggregate)

      { // Execute only for the main module in case of project with sub-modules return; }

      ..................
      }

      1. MCHANGES-145.patch
        3 kB
        Gabriele Columbro
      2. MCHANGES-145-CORRECT.patch
        4 kB
        Gabriele Columbro

        Issue Links

          Activity

          Jean-Paul GUIGUI created issue -
          Hide
          Gabriele Columbro added a comment -

          Patch for implementing the described behavior of inhibition for multimodule projects

          Show
          Gabriele Columbro added a comment - Patch for implementing the described behavior of inhibition for multimodule projects
          Gabriele Columbro made changes -
          Field Original Value New Value
          Attachment MCHANGES-145.patch [ 45686 ]
          Hide
          Gabriele Columbro added a comment -

          I implemented and tested the specified "aggregate" behavior and it definitely works, and at least I can use the maven-changes-plugin in my multimodule releases.

          Still, sounds like a workaround as I'd like to be able to send an announcement for each and every of my submodules.

          Once/if this workaround is committed, I suggest to open a related issue for an improvement in the multimodule behavior of the changes plugin.

          WDYT?

          Show
          Gabriele Columbro added a comment - I implemented and tested the specified "aggregate" behavior and it definitely works, and at least I can use the maven-changes-plugin in my multimodule releases. Still, sounds like a workaround as I'd like to be able to send an announcement for each and every of my submodules. Once/if this workaround is committed, I suggest to open a related issue for an improvement in the multimodule behavior of the changes plugin. WDYT?
          Hide
          Gabriele Columbro added a comment -

          This is the correct patch

          Ignore latest one, WDYT?

          Show
          Gabriele Columbro added a comment - This is the correct patch Ignore latest one, WDYT?
          Gabriele Columbro made changes -
          Attachment MCHANGES-145-CORRECT.patch [ 45687 ]
          Dennis Lundberg made changes -
          Assignee Dennis Lundberg [ dennislundberg ]
          Summary Error when trying to send email for multi-module projects Make it possible to run the announcement goals only once for a multi-module project
          Fix Version/s 2.3 [ 15999 ]
          Issue Type Bug [ 1 ] New Feature [ 2 ]
          Hide
          Dennis Lundberg added a comment -

          I opted for a different approach than the attached patch. This is based on the same principle that has been used successfully in the Assembly Plugin. See Brian's blog post about it http://www.sonatype.com/people/2009/05/how-to-make-a-plugin-run-once-during-a-build/

          A little refactoring was required to make it work for both announcement-generate and announcement-mail goals.

          Fixed in r884563.

          Show
          Dennis Lundberg added a comment - I opted for a different approach than the attached patch. This is based on the same principle that has been used successfully in the Assembly Plugin. See Brian's blog post about it http://www.sonatype.com/people/2009/05/how-to-make-a-plugin-run-once-during-a-build/ A little refactoring was required to make it work for both announcement-generate and announcement-mail goals. Fixed in r884563 .
          Dennis Lundberg made changes -
          Status Open [ 1 ] Closed [ 6 ]
          Resolution Fixed [ 1 ]
          Dennis Lundberg made changes -
          Link This issue is duplicated by MCHANGES-153 [ MCHANGES-153 ]
          Dennis Lundberg made changes -
          Link This issue relates to MCHANGES-300 [ MCHANGES-300 ]
          Mark Thomas made changes -
          Project Import Sun Apr 05 09:14:45 UTC 2015 [ 1428225285377 ]
          Mark Thomas made changes -
          Workflow jira [ 12717980 ] Default workflow, editable Closed status [ 12749382 ]
          Mark Thomas made changes -
          Project Import Sun Apr 05 22:40:15 UTC 2015 [ 1428273615853 ]
          Mark Thomas made changes -
          Workflow jira [ 12955314 ] Default workflow, editable Closed status [ 12992386 ]
          Mark Thomas made changes -
          Assignee dennislundberg [ dennislundberg ] Dennis Lundberg [ dennisl@apache.org ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Closed Closed
          328d 7h 10m 1 Dennis Lundberg 26/Nov/09 08:28

            People

            • Assignee:
              Dennis Lundberg
              Reporter:
              Jean-Paul GUIGUI
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development