I had a look at this and it seems that this is a requirement of Velocity, which is used to merge the template with the data. I'll add some text about this in the documentation for the plugin.

Dennis Lundberg wrote:
That is a very good question. I'm afraid I don't know the answer to it. Since the changes-plugin is still in beta, I think that it would be possible to change the default location for the templates. The normal plugin behavior when it comes to configuration, is to start out from ${basedir}.

Steven Rowe wrote:
Hi Dennis,

Why not use /src/changes/ instead of /src/main/resources/ ?

By default, for jar packaging anyway, everything /src/main/resources/
will be put into the artifact, but why would anybody ever want an email
announcement template in the artifact?

Just curious,
Steve

Dennis Lundberg wrote:
Hi Paul,

I committed a new page for the site that explains how to create and use
a custom template for the announcement. As you sort of figured out
already, the templateDirectory starts from /src/main/resources, i.e. not
from ${basedir}.

I have not deployed a new site yet, but you can have a look at the apt
file in svn, until the site is deployed:


http://svn.apache.org/repos/asf/maven/plugins/trunk/maven-changes-plugin/src/site/apt/examples/using-a-custom-announcement-template.apt


Paul Spencer wrote:
I am trying to configure the changes plugin, version 2.0-beta-2, to
use a custom
announcement.vm file.  Setting templateDirectory in to
/src/main/resources does
not work.  The command "mvn changes:announcement-generate" always
fails with the
following error message:

  ResourceManager : unable to find resource
'/src/main/resources/announcement.vm' in any resource loader

Belows is additional information related the the problem:

***
* From POM.XML
***
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-changes-plugin</artifactId>
    <configuration>
          <template>announcement.vm</template>
      <templateDirectory>/src/main/resources</templateDirectory>
        </configuration>
      </plugin>

***
* Directory output
***
 Directory of C:\cvs\reporting-jsf\src\main\resources

04/20/2007  01:45 PM    <DIR>          .
04/20/2007  01:45 PM    <DIR>          ..
04/20/2007  01:45 PM             1,848 announcement.vm
04/18/2007  10:01 AM                69 application.properties
09/20/2006  11:56 AM               206 implementations.properties
04/12/2007  04:40 PM             1,109 log4j.xml
               4 File(s)          3,232 bytes
               2 Dir(s)  67,573,653,504 bytes free

C:\cvs_apms\apms-reporting-jsf>
***
* Maven debug output
***
[INFO] **************************************************************
[INFO] Starting Jakarta Velocity v1.4
[INFO] RuntimeInstance initializing.
[INFO] Default Properties File:
org\apache\velocity\runtime\defaults\velocity.properties
[INFO] Default ResourceManager initializing. (class
org.apache.velocity.runtime.resource.ResourceManagerImpl)
[INFO] Resource Loader Instantiated:
org.apache.maven.plugin.resource.loader.ProjectResourceLoader
[INFO] ProjectResourceLoader : initialization starting.
[INFO] path :C:\cvs\reporting-jsf\src\main\resources\
[INFO] ProjectResourceLoader : adding path
'C:\cvs\reporting-jsf\src\main\resources\'
[INFO] ProjectResourceLoader : initialization complete.
[INFO] Resource Loader Instantiated:
org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
[INFO] ClasspathResourceLoader : initialization starting.
[INFO] ClasspathResourceLoader : initialization complete.
[INFO] ResourceCache : initialized. (class
org.apache.velocity.runtime.resource.ResourceCacheImpl)
[INFO] Default ResourceManager initialization complete.
[INFO] Loaded System Directive:
org.apache.velocity.runtime.directive.Literal
[INFO] Loaded System Directive:
org.apache.velocity.runtime.directive.Macro
[INFO] Loaded System Directive:
org.apache.velocity.runtime.directive.Parse
[INFO] Loaded System Directive:
org.apache.velocity.runtime.directive.Include
[INFO] Loaded System Directive:
org.apache.velocity.runtime.directive.Foreach
[INFO] Created: 20 parsers.
[INFO] Velocimacro : initialization starting.
[INFO] Velocimacro : adding VMs from VM library template :
VM_global_library.vm
[ERROR] ResourceManager : unable to find resource
'VM_global_library.vm' in any resource loader.
[INFO] Velocimacro : error using  VM library template
VM_global_library.vm :
org.apache.velocity.exception.ResourceNotFoundException: Unable to
find resource 'VM_global_library.vm'
[INFO] Velocimacro :  VM library template macro registration complete.
[INFO] Velocimacro : allowInline = true : VMs can be defined inline in
templates
[INFO] Velocimacro : allowInlineToOverride = false : VMs defined
inline may NOT replace previous VM definitions
[INFO] Velocimacro : allowInlineLocal = false : VMs defined inline
will be  global in scope if allowed.
[INFO] Velocimacro : messages on  : VM system will output logging
messages
[INFO] Velocimacro : autoload off  : VM system will not automatically
reload global library macros
[INFO] Velocimacro : initialization complete.
[INFO] Velocity successfully started.
[DEBUG] Configuring mojo
'org.apache.maven.plugins:maven-changes-plugin:2.0-beta-2:announcement-generate'
-->
[DEBUG]   (s) artifactId = reporting-jsf
[DEBUG]   (s) developmentTeam = reporting-jsf-team
[DEBUG]   (s) finalName = reporting-jsf-1.0.2-SNAPSHOT.war
[DEBUG]   (f) generateJiraAnnouncement = false
[DEBUG]   (s) groupId = com.mikon.customer.kc
[DEBUG]   (s) introduction = Generalized web based reporting tool for
data.
[DEBUG] (f) jiraXML = C:\cvs\reporting-jsf\target/jira-announcement.xml
[DEBUG]   (f) nbEntries = 25
[DEBUG] (s) outputDirectory = C:\cvs\reporting-jsf\target/announcement
[DEBUG]   (s) packaging = war
[DEBUG]   (f) project = [EMAIL PROTECTED]
[DEBUG]   (f) resolutionId = Fixed
[DEBUG]   (f) setting = [EMAIL PROTECTED]
[DEBUG]   (f) statusId = Closed
[DEBUG]   (f) template = announcement.vm
[DEBUG]   (f) templateDirectory = /src/main/resources
[DEBUG]   (s) url =
http://developer.foo.com/projects/reporting-jsf/1.0.2-SNAPSHOT/reporting-jsf

[DEBUG]   (s) urlDownload =
http://developer.foo.com/projects/reporting-jsf/1.0.2-SNAPSHOT/reporting-jsf/reporting-jsf-1.0.2-SNAPSHOT.jar

[DEBUG]   (s) version = 1.0.2-SNAPSHOT
[DEBUG]   (s) xmlPath = C:\cvs\reporting-jsf/src/changes/changes.xml
[DEBUG] -- end configuration --
[INFO] [changes:announcement-generate]
[INFO] Creating announcement file from changes.xml...
[ERROR] ResourceManager : unable to find resource
'/src/main/resources/announcement.vm' in any resource loader.
[INFO]
------------------------------------------------------------------------

Is this a bug or a configuration error?

Paul Spencer


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Dennis Lundberg

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to