[ 
https://jira.codehaus.org/browse/MCHANGES-280?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=342910#comment-342910
 ] 

Dennis Lundberg commented on MCHANGES-280:
------------------------------------------

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}}.

> announcement generation broken in 2.7, possibly by velocity upgrade
> -------------------------------------------------------------------
>
>                 Key: MCHANGES-280
>                 URL: https://jira.codehaus.org/browse/MCHANGES-280
>             Project: Maven Changes Plugin
>          Issue Type: Bug
>          Components: announcement
>    Affects Versions: 2.7
>            Reporter: Benson Margulies
>             Fix For: 2.10
>
>
> The following is not good at all:
> {noformat}[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{noformat}



--
This message was sent by Atlassian JIRA
(v6.1.6#6162)

Reply via email to