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

announcement-mail broken when using the announcementFile parameter

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.7
    • Fix Version/s: 2.10
    • Component/s: announcement
    • Labels:
      None
    • Number of attachments :
      0

      Description

      The following is not good at all:

      [INFO] [changes:announcement-generate {execution: default-cli}]
      Apr 30, 2012 4:40:24 PM org.apache.commons.httpclient.HttpMethodBase getResponseBody
      WARNING: Going to buffer response body of large or unknown size. Using getResponseBodyAsStream instead is recommended.
      [ERROR] maven-changes-plugin: None of the configured sortColumnNames 'null' are correct.
      [INFO] Downloading from JIRA at: http://jira.codehaus.org/secure/IssueNavigator.jspa?view=rss&pid=11212&statusIds=6&resolutionIds=1&tempMax=1000&reset=true&decorator=none
      [INFO] The JIRA version is '4.4.3'
      [INFO] Including issues from JIRA in announcement...
      [debug] Found 10 releases.
      [ERROR] ResourceManager : unable to find resource 'org/apache/maven/plugins/announcement.vm' in any resource loader.
      [INFO] ------------------------------------------------------------------------
      [ERROR] BUILD ERROR
      [INFO] ------------------------------------------------------------------------
      [INFO] Resource not found.
      
      Embedded error: Template not found. ( org/apache/maven/plugins/announcement.vm )
      [INFO] ------------------------------------------------------------------------
      [INFO] For more information, run Maven with the -e switch
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 9 seconds
      [INFO] Finished at: Mon Apr 30 16:40:29 EDT 2012
      [INFO] Final Memory: 23M/81M

        Issue Links

          Activity

          Hide
          Dennis Lundberg added a comment -

          Benson, can you remember which configuration you used for this failing example?

          Show
          Dennis Lundberg added a comment - Benson, can you remember which configuration you used for this failing example?
          Hide
          Benson Margulies added a comment -

          I think I was releasing the release plugin.

          Show
          Benson Margulies added a comment - I think I was releasing the release plugin.
          Hide
          Dennis Lundberg added a comment -

          I just realized that the JIRA URL for fetching the issues is in the issue description...
          Your failed attempt was for the Changes Plugin itself.

          I think this started with http://svn.apache.org/viewvc?view=revision&revision=r1379183 which I believe broke things. I've reverted that change in plugins-parent until this plugin has been fixed.

          Here's the problem. In announcement-generate there are two parameters involved: template and announcementFile. The first one is the Velocity template. The second is the file that contains the result after interpolating properties into the Velocity template. If the second is not specified, the value of the first is used. There are two possible scenarios:

          1. announcementFile not specified
            announcement.vm (the Velocity template available on the classpath) --> announcement-generate --> target/announcement/announcement.vm (a text file containing the finished announcement text)
          2. announcementFile=announcement.txt
            announcement.vm (the Velocity template available on the classpath) --> announcement-generate --> target/announcement/announcement.txt (a text file containing the finished announcement text)

          After this the announcement-mail goal takes over, and this is where things start to fail. announcement-mail only cares about one parameter: template, which in this case is not not the Velocity template, but in fact the file that contains the result after interpolating properties into the Velocity template. The default value for template is announcement.vm.

          template not specified, announcementFile=announcement.txt as per example 2 above (this was our configuration after r1379183)
          announcement.vm (the Velocity template available on the classpath) --> announcement-generate --> target/announcement/announcement.txt (a text file containing the finished announcement text) --> announcement-mail --> Error: file target/announcement/announcement.vm not found!

          My conclusion is that this problem comes from an inappropriately named and documented parameter. The solution is to rename the template parameter in announcement-mail to announcementFile.

          In announcement-generate there is a parameter called outputDirectory which makes sense for that goal, because it which represents the directory where the finished announcement is placed. The corresponding parameter in announcement-mail is called templateOutputDirectory, which is wrong twice: it is not the output directory of this goal and it does not contain a template. It should be renamed to announcementDirectory.

          Show
          Dennis Lundberg added a comment - I just realized that the JIRA URL for fetching the issues is in the issue description... Your failed attempt was for the Changes Plugin itself. I think this started with http://svn.apache.org/viewvc?view=revision&revision=r1379183 which I believe broke things. I've reverted that change in plugins-parent until this plugin has been fixed. Here's the problem. In announcement-generate there are two parameters involved: template and announcementFile . The first one is the Velocity template. The second is the file that contains the result after interpolating properties into the Velocity template. If the second is not specified, the value of the first is used. There are two possible scenarios: announcementFile not specified announcement.vm (the Velocity template available on the classpath) --> announcement-generate --> target/announcement/announcement.vm (a text file containing the finished announcement text) announcementFile=announcement.txt announcement.vm (the Velocity template available on the classpath) --> announcement-generate --> target/announcement/announcement.txt (a text file containing the finished announcement text) After this the announcement-mail goal takes over, and this is where things start to fail. announcement-mail only cares about one parameter: template , which in this case is not not the Velocity template, but in fact the file that contains the result after interpolating properties into the Velocity template. The default value for template is announcement.vm . template not specified, announcementFile=announcement.txt as per example 2 above (this was our configuration after r1379183) announcement.vm (the Velocity template available on the classpath) --> announcement-generate --> target/announcement/announcement.txt (a text file containing the finished announcement text) --> announcement-mail --> Error: file target/announcement/announcement.vm not found! My conclusion is that this problem comes from an inappropriately named and documented parameter. The solution is to rename the template parameter in announcement-mail to announcementFile . In announcement-generate there is a parameter called outputDirectory which makes sense for that goal, because it which represents the directory where the finished announcement is placed. The corresponding parameter in announcement-mail is called templateOutputDirectory , which is wrong twice: it is not the output directory of this goal and it does not contain a template. It should be renamed to announcementDirectory .
          Hide
          Dennis Lundberg added a comment -

          Fixed in r1578498.

          Unfortunately it was not possible to fix this in a completely backwards compatible way. I've included warnings and exception throwing where possible. This may require users to change their configuration when upgrading.

          Show
          Dennis Lundberg added a comment - Fixed in r1578498 . Unfortunately it was not possible to fix this in a completely backwards compatible way. I've included warnings and exception throwing where possible. This may require users to change their configuration when upgrading.

            People

            • Assignee:
              Dennis Lundberg
              Reporter:
              Benson Margulies
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: