maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r387742 [1/3] - in /maven/sandbox/plugins/changes-maven-plugin: ./ src/ src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/maven/ src/main/java/org/apache/maven/announcement/ src/main/java/org/apa...
Date Wed, 22 Mar 2006 05:59:06 GMT
Author: brett
Date: Tue Mar 21 21:59:01 2006
New Revision: 387742

URL: http://svn.apache.org/viewcvs?rev=387742&view=rev
Log:
Import of changes-maven-plugin code from https://svn.codehaus.org/mojo/trunk/mojo/changes-maven-plugin/, r1708

Code authored by people that have an Apache CLA on file: 
* Johnny Ruiz III (Initial contribution derived from code under https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk/changes, /jira and /announcement)
* Allan Ramirez
* Trygve Laugstol
* Brian Fox
* Brett Porter
* Jason van Zyl
* Carlos Sanchez

Contains code donated under the Apache License 2.0 by:
* Brent Worden <brent@worden.org> - r1160, Document the 'desc' attribute of a release.
* Kris Bravo <m2@corridor-software.us> - r1037, update the "How To" document
* Kris Bravo <m2@corridor-software.us> / Julian Wood <woodj@ucalgary.ca> - r1042, update the "How To" document

All code is under the Apache License v2.0

Added:
    maven/sandbox/plugins/changes-maven-plugin/
    maven/sandbox/plugins/changes-maven-plugin/pom.xml   (with props)
    maven/sandbox/plugins/changes-maven-plugin/src/
    maven/sandbox/plugins/changes-maven-plugin/src/main/
    maven/sandbox/plugins/changes-maven-plugin/src/main/java/
    maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/
    maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/
    maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/
    maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/announcement/
    maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/announcement/AnnouncementMailMojo.java   (with props)
    maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/announcement/AnnouncementMojo.java   (with props)
    maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/announcement/JiraAnnouncement.java   (with props)
    maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/announcement/JiraAnnouncementDownloader.java   (with props)
    maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/announcement/JiraAnnouncementParser.java   (with props)
    maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/announcement/mailsender/
    maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/announcement/mailsender/ProjectJavamailMailSender.java   (with props)
    maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/changes/
    maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/changes/Action.java   (with props)
    maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/changes/ChangesMojo.java   (with props)
    maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/changes/ChangesReportGenerator.java   (with props)
    maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/changes/ChangesXML.java   (with props)
    maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/changes/Release.java   (with props)
    maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/jira/
    maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/jira/JiraDownloader2.java   (with props)
    maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/jira/JiraIssue.java   (with props)
    maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/jira/JiraMojo.java   (with props)
    maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/jira/JiraReportGenerator.java   (with props)
    maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/jira/JiraXML.java   (with props)
    maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/resource/
    maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/resource/loader/
    maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/resource/loader/ProjectResourceLoader.java   (with props)
    maven/sandbox/plugins/changes-maven-plugin/src/main/resources/
    maven/sandbox/plugins/changes-maven-plugin/src/main/resources/META-INF/
    maven/sandbox/plugins/changes-maven-plugin/src/main/resources/META-INF/plexus/
    maven/sandbox/plugins/changes-maven-plugin/src/main/resources/META-INF/plexus/components.xml   (with props)
    maven/sandbox/plugins/changes-maven-plugin/src/main/resources/changes-report.properties   (with props)
    maven/sandbox/plugins/changes-maven-plugin/src/main/resources/jira-report.properties   (with props)
    maven/sandbox/plugins/changes-maven-plugin/src/main/resources/org/
    maven/sandbox/plugins/changes-maven-plugin/src/main/resources/org/apache/
    maven/sandbox/plugins/changes-maven-plugin/src/main/resources/org/apache/maven/
    maven/sandbox/plugins/changes-maven-plugin/src/main/resources/org/apache/maven/announcement/
    maven/sandbox/plugins/changes-maven-plugin/src/main/resources/org/apache/maven/announcement/announcement.vm
    maven/sandbox/plugins/changes-maven-plugin/src/site/
    maven/sandbox/plugins/changes-maven-plugin/src/site/apt/
    maven/sandbox/plugins/changes-maven-plugin/src/site/apt/howto.apt   (with props)
    maven/sandbox/plugins/changes-maven-plugin/src/site/resources/
    maven/sandbox/plugins/changes-maven-plugin/src/site/resources/changes-report.html   (with props)
    maven/sandbox/plugins/changes-maven-plugin/src/site/resources/jira-report.html   (with props)
    maven/sandbox/plugins/changes-maven-plugin/src/site/site.xml   (with props)
    maven/sandbox/plugins/changes-maven-plugin/src/test/
    maven/sandbox/plugins/changes-maven-plugin/src/test/java/
    maven/sandbox/plugins/changes-maven-plugin/src/test/java/org/
    maven/sandbox/plugins/changes-maven-plugin/src/test/java/org/apache/
    maven/sandbox/plugins/changes-maven-plugin/src/test/java/org/apache/maven/
    maven/sandbox/plugins/changes-maven-plugin/src/test/java/org/apache/maven/announcement/
    maven/sandbox/plugins/changes-maven-plugin/src/test/java/org/apache/maven/changes/
    maven/sandbox/plugins/changes-maven-plugin/src/test/java/org/apache/maven/changes/ActionTest.java   (with props)
    maven/sandbox/plugins/changes-maven-plugin/src/test/java/org/apache/maven/changes/ReleaseTest.java   (with props)
    maven/sandbox/plugins/changes-maven-plugin/src/test/java/org/apache/maven/jira/
    maven/sandbox/plugins/changes-maven-plugin/src/test/java/org/apache/maven/jira/JiraIssueTest.java   (with props)
    maven/sandbox/plugins/changes-maven-plugin/src/test/resources/
    maven/sandbox/plugins/changes-maven-plugin/src/test/resources/META-INF/
    maven/sandbox/plugins/changes-maven-plugin/src/test/resources/META-INF/plexus/
    maven/sandbox/plugins/changes-maven-plugin/src/test/resources/META-INF/plexus/components.xml   (with props)
    maven/sandbox/plugins/changes-maven-plugin/src/test/resources/changes.xml   (with props)
    maven/sandbox/plugins/changes-maven-plugin/src/test/resources/org/
    maven/sandbox/plugins/changes-maven-plugin/src/test/resources/org/apache/
    maven/sandbox/plugins/changes-maven-plugin/src/test/resources/org/apache/maven/
    maven/sandbox/plugins/changes-maven-plugin/src/test/resources/org/apache/maven/announcement/
    maven/sandbox/plugins/changes-maven-plugin/src/test/resources/org/apache/maven/announcement/announcement.vm

Added: maven/sandbox/plugins/changes-maven-plugin/pom.xml
URL: http://svn.apache.org/viewcvs/maven/sandbox/plugins/changes-maven-plugin/pom.xml?rev=387742&view=auto
==============================================================================
--- maven/sandbox/plugins/changes-maven-plugin/pom.xml (added)
+++ maven/sandbox/plugins/changes-maven-plugin/pom.xml Tue Mar 21 21:59:01 2006
@@ -0,0 +1,83 @@
+<project>
+  <parent>
+    <artifactId>mojo</artifactId>
+    <groupId>org.codehaus.mojo</groupId>
+    <version>6</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>changes-maven-plugin</artifactId>
+  <packaging>maven-plugin</packaging>
+  <name>Maven Changes Report Plugin</name>
+  <version>2.0-beta-2-SNAPSHOT</version>
+  <developers>
+    <developer>
+      <id>jruiz</id>
+      <name>Johnny Ruiz III</name>
+      <email>jruiz@apache.org</email>
+    </developer>
+    <developer>
+      <id>aramirez</id>
+      <name>Allan Ramirez</name>
+      <email>aramirez@exist.com</email>
+    </developer>    
+  </developers>
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-settings</artifactId>
+      <version>2.0-beta-1</version>
+    </dependency>
+    <dependency>
+      <groupId>plexus</groupId>
+      <artifactId>plexus-velocity</artifactId>
+      <version>1.1.1</version>
+    </dependency>
+    <dependency>
+      <groupId>plexus</groupId>
+      <artifactId>plexus-mail-sender-simple</artifactId>
+      <version>1.0-alpha-2</version>
+    </dependency>
+    <dependency>
+      <groupId>plexus</groupId>
+      <artifactId>plexus-mail-sender-javamail</artifactId>
+      <version>1.0-alpha-2</version>
+    </dependency>    
+    <dependency>
+      <groupId>org.apache.maven.reporting</groupId>
+      <artifactId>maven-reporting-api</artifactId>
+      <version>2.0-beta-1</version>
+    </dependency>
+    <dependency>
+      <groupId>commons-logging</groupId>
+      <artifactId>commons-logging</artifactId>
+      <version>1.0.3</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.reporting</groupId>
+      <artifactId>maven-reporting-impl</artifactId>
+      <version>2.0-beta-1</version>
+    </dependency>
+    <dependency>
+      <groupId>velocity</groupId>
+      <artifactId>velocity</artifactId>
+      <version>1.4</version>
+    </dependency>
+    <dependency>
+      <groupId>doxia</groupId>
+      <artifactId>doxia-sink-api</artifactId>
+      <version>1.0-alpha-4</version>
+    </dependency>
+    <dependency>
+      <groupId>commons-httpclient</groupId>
+      <artifactId>commons-httpclient</artifactId>
+      <version>2.0.2</version>
+    </dependency>
+  </dependencies>
+<distributionManagement>
+    <site>
+      <id>mojo.website</id>
+      <name>Mojo Website</name>
+      <url>scpexe://beaver.codehaus.org/home/projects/mojo/public_html/changes-maven-plugin</url>
+    </site>
+</distributionManagement>
+</project>
\ No newline at end of file

Propchange: maven/sandbox/plugins/changes-maven-plugin/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/sandbox/plugins/changes-maven-plugin/pom.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/announcement/AnnouncementMailMojo.java
URL: http://svn.apache.org/viewcvs/maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/announcement/AnnouncementMailMojo.java?rev=387742&view=auto
==============================================================================
--- maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/announcement/AnnouncementMailMojo.java (added)
+++ maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/announcement/AnnouncementMailMojo.java Tue Mar 21 21:59:01 2006
@@ -0,0 +1,352 @@
+
+package org.apache.maven.announcement;
+
+/*
+ * Copyright 2001-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.maven.announcement.mailsender.ProjectJavamailMailSender;
+import org.apache.maven.model.Developer;
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.project.MavenProject;
+import org.codehaus.plexus.logging.console.ConsoleLogger;
+import org.codehaus.plexus.mailsender.MailSenderException;
+import org.codehaus.plexus.util.IOUtil;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+import java.util.List;
+
+
+
+/**
+ * Maven Announcement mailer goal.
+ * @goal announcement-mail
+ * @execute goal="announcement-generate"
+ * @description Goal which sends the template thru email
+ * @author aramirez@exist.com
+ */
+
+public class AnnouncementMailMojo extends AbstractMojo
+{
+    //=========================================
+    // announcement-mail goal fields
+    //=========================================
+
+    /**
+     * @parameter expression=${project}
+     * @readonly
+     */
+    private MavenProject project;
+    
+    /**
+     * Smtp Server
+     * @parameter
+     * @required
+     */
+    private String smtpHost;
+    
+    /**
+     * Port
+     * @parameter default-value="25";
+     * @required
+     */
+    private int smtpPort;
+    
+    /**
+     * @parameter
+     */
+    private String username;
+    
+    /**
+     * @parameter
+     */
+    private String password;
+    
+    /**
+     * @parameter default-value="false"
+     */
+    private boolean sslMode;
+    
+    /**
+     * Subject for the email
+     * @parameter default-value="[ANNOUNCEMENT] - ${project.artifactId} ${project.version} release!"
+     * @required
+     */
+    private String subject;
+    
+    /**
+     * Recipient email address.
+     * @parameter 
+     * @required
+     */
+    private List toAddresses;
+    
+    /**
+     * Sender
+     * @parameter expression="${project.developers}"
+     * @required
+     */
+    private List from;
+    
+    /**
+     * Directory which contains the template for announcement email.
+     * @parameter expression="${project.build.directory}/announcement"
+     * @required
+     */
+    private String templateOutputDirectory;
+    
+    /**
+     * @parameter default-value="announcement.vm"
+     * @required
+     */
+    private String template;      
+    
+    private ProjectJavamailMailSender mailer = new ProjectJavamailMailSender();
+    
+    
+    public void execute() throws MojoExecutionException
+    {              
+        template = templateOutputDirectory + "/" + template;
+        
+        ConsoleLogger logger = new ConsoleLogger( 0, "base" );      
+        
+        mailer.enableLogging( logger );        
+        
+        mailer.setSmtpHost( getSmtpHost() );
+        
+        mailer.setSmtpPort( getSmtpPort() );
+        
+        mailer.setSslMode( sslMode );
+        
+        if( username != null )
+        {
+            mailer.setUsername( username );
+        }
+        
+        if( password != null )
+        {
+            mailer.setPassword( password );
+        }
+        mailer.initialize();
+        
+        if( isTextFileExisting( template ) )
+        {  
+            getLog().info( "Connecting to Host: " + getSmtpHost() + ":" + getSmtpPort() );
+
+            sendMessage(  );
+        }
+        else
+        {               
+            if( template != null )
+            {
+                if( isTextFileExisting( template ) )
+                {
+                    getLog().info( "Connecting to Host: " + getSmtpHost() + " : " + getSmtpPort() );
+
+                    sendMessage(  );
+                }
+                else
+                {
+                    throw new MojoExecutionException( "Announcement template " + template + " not found..." );
+                }
+            }
+            else
+            {                
+                throw new MojoExecutionException( "Announcement template " + template + " not found..." );
+            }
+        }
+    }
+    
+    /**
+     * Send the email 
+     *
+     * @param recipient receiver of the email
+     * @throws MojoExecutionException
+     */
+    protected void sendMessage() throws MojoExecutionException
+    {
+        String email = "";
+        
+        try
+        {
+            int i=0;
+            
+            String[] from = getFirstDevInfo( getFrom() );
+            
+            while( i < getToAddresses().size() )
+            {   
+                email = getToAddresses().get( i ).toString();
+
+                getLog().info( "Sending mail... " + email );
+
+                mailer.send( getSubject(), IOUtil.toString( readAnnouncement( template ) ), email, "", from[0], from[1] );
+
+                getLog().info("Sent...");                
+                
+                i++;
+            }      
+        }
+        catch( IOException ioe )
+        {
+            throw new MojoExecutionException( "Failed to send email.", ioe );
+        }
+        catch( MailSenderException e )
+        {
+            throw new MojoExecutionException( "Failed to send email < " + email + " >", e );
+        }        
+    }
+    
+    protected boolean isTextFileExisting( String fileName )
+    {
+        boolean found = false;
+        
+        File f = new File( fileName );
+
+        if( f.exists() )
+        {
+            found = true;
+        }
+        return found;
+    }
+    
+    /**
+     * Read the announcement generated file
+     * @param  fileName         Accepts filename to be read.
+     * @return  fileReader      Return the FileReader.
+     */
+    public FileReader readAnnouncement( String fileName ) throws MojoExecutionException
+    {   
+        FileReader fileReader = null;
+        
+        try
+        {
+            File file = new File( fileName );
+            
+            fileReader = new FileReader( file );
+        }
+        catch( FileNotFoundException fnfe )
+        {
+            throw new MojoExecutionException( "File not found. " + fileName );
+        }
+        return fileReader;
+    }
+    
+    /**
+     * Retrieve the 1st name and email address found in the developers list
+     * @param fromNames         Accepts List of developers.
+     * @return fromAddress      Returns the 1st email address found in the list.
+     */
+    public String[] getFirstDevInfo( List fromNames ) throws MojoExecutionException
+    {
+        String fromAddress = "";
+        
+        String fromName = "";
+        
+        String[] info = new String[2];
+        
+        if( fromNames.size() > 0 )
+        {
+            Developer developer = ( Developer ) fromNames.get( 0 );
+
+            fromAddress = developer.getEmail();
+            
+            fromName = developer.getName();
+
+            info[0] = fromAddress;
+            
+            info[1] = fromName;
+            
+            getLog().info( "email retrieved. " + fromAddress + " < " + fromName + " > " );
+
+            if( fromAddress == null  || fromAddress.equals( "" ) )
+            {
+                throw new MojoExecutionException( "Email address in <developers> section is required." );
+            }
+        }
+        else
+        {
+            throw new MojoExecutionException( "Email address in <developers> section is required." );
+        }
+        return info;
+    }
+        
+    //================================
+    // announcement-mail accessors
+    //================================
+    
+    public String getSmtpHost() 
+    {
+        return smtpHost;
+    }
+
+    public void setSmtpHost(String smtpHost) 
+    {
+        this.smtpHost = smtpHost;
+    }
+
+    public int getSmtpPort() 
+    {
+        return smtpPort;
+    }
+
+    public void setSmtpPort(int smtpPort) 
+    {
+        this.smtpPort = smtpPort;
+    }
+
+    public String getSubject() 
+    {
+        return subject;
+    }
+
+    public void setSubject(String subject) 
+    {
+        this.subject = subject;
+    }
+
+    public List getFrom() 
+    {
+        return from;
+    }
+
+    public void setFrom(List from) 
+    {
+        this.from = from;
+    }
+
+    public MavenProject getProject() 
+    {
+        return project;
+    }
+
+    public void setProject(MavenProject project) 
+    {
+        this.project = project;
+    }
+
+    public List getToAddresses() 
+    {
+        return toAddresses;
+    }
+
+    public void setToAddresses(List toAddresses) 
+    {
+        this.toAddresses = toAddresses;
+    }
+}

Propchange: maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/announcement/AnnouncementMailMojo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/announcement/AnnouncementMailMojo.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/announcement/AnnouncementMojo.java
URL: http://svn.apache.org/viewcvs/maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/announcement/AnnouncementMojo.java?rev=387742&view=auto
==============================================================================
--- maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/announcement/AnnouncementMojo.java (added)
+++ maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/announcement/AnnouncementMojo.java Tue Mar 21 21:59:01 2006
@@ -0,0 +1,583 @@
+package org.apache.maven.announcement;
+
+/*
+ * Copyright 2001-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.maven.changes.ChangesXML;
+import org.apache.maven.changes.Release;
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.settings.Settings;
+import org.apache.velocity.VelocityContext;
+import org.apache.velocity.context.Context;
+import org.apache.velocity.exception.ResourceNotFoundException;
+import org.apache.velocity.exception.VelocityException;
+import org.codehaus.plexus.velocity.VelocityComponent;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.Writer;
+import java.util.List;
+
+/**
+ * @goal announcement-generate
+ * @description Goal which generate the template for announcement
+ * @author aramirez@exist.com
+ * @version $Id$
+ * 
+ * @requiresDependencyResolution test
+ */
+public class AnnouncementMojo extends AbstractMojo 
+{             
+    /**
+     * Directory where the template file will be generated
+     * @parameter expression="${project.build.directory}/announcement"
+     * @required
+     */
+    private String outputDirectory;
+    
+    /**
+     * @parameter expression="${project.groupId}"
+     * @readonly
+     */
+    private String groupId;
+    
+    /**
+     * @parameter expression="${project.artifactId}"
+     * @readonly
+     */
+    private String artifactId;
+    
+    /**
+     * Version of the plugin
+     * @parameter expression="${project.version}"
+     * @readonly
+     */
+    private String version;
+    
+    /**
+     * Distribution url of the plugin
+     * @parameter expression="${project.url}"
+     * @required
+     */
+    private String url;
+    
+    /**
+     * Packaging structure based on the pom
+     * @parameter expression="${project.packaging}"
+     * @readonly
+     */
+    private String packaging;
+    
+    /**
+     * @parameter expression="${project.build.finalName}.${project.packaging}"
+     * @required
+     */
+    private String finalName;
+    
+    /**
+     * URL where the plugin can be downloaded
+     * @parameter expression="${project.url}/${project.build.finalName}.jar"
+     */
+    private String urlDownload;
+    
+    /**
+     * Directory which contains the changes.xml file
+     * @parameter expression="${basedir}/src/changes/changes.xml"
+     * @required
+     */
+    private String xmlPath;
+    
+    /**
+     * Name of the team that develops the project
+     * @parameter default-value="${project.artifactId}-team"
+     * @required
+     */
+    private String developmentTeam;
+    
+    /**
+     * Short description or introduction of the released project.
+     * @parameter expression="${project.description}"
+     */
+    private String introduction;
+    
+    /**
+     * Velocity Component
+     * @parameter expression="${component.org.codehaus.plexus.velocity.VelocityComponent}"
+     * @readonly
+     */
+    private VelocityComponent velocity;
+    
+    /**
+     * Name of the tempalte to be generated
+     * @parameter default-value="announcement.vm"
+     * @required
+     */
+    private String template;
+    
+    /**
+     * Directory that contains the template
+     * @parameter default-value="org/apache/maven/announcement"
+     * @required
+     */
+    private String templateDirectory;
+       
+    private ChangesXML xml;
+    
+      //=======================================//
+     //  Jira-Announcement Needed Parameters  //
+    //=======================================//
+    
+    /**
+     * The Maven Project.
+     * @parameter expression="${project}"
+     * @required
+     * @readonly
+     */
+    private MavenProject project;
+    /**
+     * Settings XML configuration.
+     * 
+     * @parameter expression="${settings}"
+     * @required
+     * @readonly
+     */
+    private Settings setting;
+    
+    /**
+     * Flag to determine that the plugin will generate a jira announcement
+     * @parameter expression="${generateJiraAnnouncement}" default-value="false"
+     * @required
+     */
+    private boolean generateJiraAnnouncement;
+    
+    /**
+     * Only closed issues are needed.
+     * @parameter default-value="Closed"
+     */
+    private String statusId;
+    
+    /**
+     * Only fixed issues are needed
+     * @parameter default-value="Fixed"
+     */
+    private String resolutionId;
+    
+    /**
+     * Directory containing the XML file of jira-announcement to be parse
+     * @parameter expression="${project.build.directory}/jira-announcement.xml"
+     * @required
+     * @readonly
+     */
+    private String jiraXML;
+    
+    /**
+     * @parameter default-value="25"
+     * @required
+     */
+    private int nbEntries;
+    
+      //=======================================//
+     //    announcement-generate execution    //
+    //=======================================//
+    
+    /**
+     * Generate the template
+     *
+     * @throws MojoExecutionException
+     */
+    public void execute() throws MojoExecutionException 
+    {
+        if( !generateJiraAnnouncement )
+        {
+            setXml( new ChangesXML( getXmlPath() ) );
+
+            doGenerate( getXml() );
+        }
+        else
+        {
+            doJiraGenerate();
+        }
+    }
+    
+    /**
+     * Add the parameters to velocity context
+     *
+     * @param xml parsed changes.xml
+     * @throws MojoExecutionException
+     */
+    public void doGenerate(ChangesXML xml) throws MojoExecutionException 
+    {
+        try 
+        {
+            Context context = new VelocityContext();
+            
+            List releaseList = xml.getReleaseList();
+            
+            getLog().info( "Creating file..." );
+            
+            if( getIntroduction() == null || getIntroduction().equals( "" ) ) 
+            {
+                setIntroduction( getUrl() );
+            }
+            
+            context.put( "releases"         , releaseList                       );
+            
+            context.put( "groupId"          , getGroupId()                      );
+            
+            context.put( "artifactId"       , getArtifactId()                   );
+            
+            context.put( "version"          , getVersion()                      );
+            
+            context.put( "packaging"        , getPackaging()                    );
+            
+            context.put( "url"              , getUrl()                          );
+            
+            context.put( "release"          , getLatestRelease( releaseList )   );
+            
+            context.put( "introduction"     , getIntroduction()                 );
+            
+            context.put( "developmentTeam"  , getDevelopmentTeam()              );
+            
+            context.put( "finalName"        , getFinalName()                    );
+            
+            context.put( "urlDownload"      , getUrlDownload()                  );
+            
+            processTemplate( context, getOutputDirectory(), template  );
+        } 
+        catch( ResourceNotFoundException rnfe ) 
+        {
+            throw new MojoExecutionException( "resource not found." );
+        } 
+        catch( VelocityException ve ) 
+        {
+            throw new MojoExecutionException( ve.toString() );
+        }
+        catch( IOException ioe ) 
+        {
+            throw new MojoExecutionException( ioe.toString() );
+        }
+    }
+    
+    public void doGenerate( List releases ) throws MojoExecutionException 
+    {
+        try 
+        {   
+            Context context = new VelocityContext();            
+            
+            getLog().info( "Creating file..." );
+            
+            if( getIntroduction() == null || getIntroduction().equals( "" ) ) 
+            {
+                setIntroduction( getUrl() );
+            }
+            
+            context.put( "releases"         , releases                          );
+            
+            context.put( "groupId"          , getGroupId()                      );
+            
+            context.put( "artifactId"       , getArtifactId()                   );
+            
+            context.put( "version"          , getVersion()                      );
+            
+            context.put( "packaging"        , getPackaging()                    );
+            
+            context.put( "url"              , getUrl()                          );
+            
+            context.put( "release"          , getLatestRelease( releases )      );
+            
+            context.put( "introduction"     , getIntroduction()                 );
+            
+            context.put( "developmentTeam"  , getDevelopmentTeam()              );
+            
+            context.put( "finalName"        , getFinalName()                    );
+            
+            context.put( "urlDownload"      , getUrlDownload()                  );
+            
+            processTemplate( context, getOutputDirectory(), template  );
+        } 
+        catch( ResourceNotFoundException rnfe ) 
+        {
+            throw new MojoExecutionException( "resource not found." );
+        } 
+        catch( VelocityException ve ) 
+        {
+            throw new MojoExecutionException( ve.toString() );
+        }
+        catch( IOException ioe ) 
+        {
+            throw new MojoExecutionException( ioe.toString() );
+        }
+    }    
+    
+    /**
+     * Get the latest release by matching the release in
+     * changes.xml and in the version of the pom
+     *
+     * @param releases list of releases in changes.xml
+     * @throws MojoExecutionException
+     */
+    public Release getLatestRelease( List releases ) throws MojoExecutionException 
+    {
+        boolean isFound = false;
+        
+        Release release = null;
+        
+        for( int i=0; i<releases.size(); i++ ) 
+        {
+            release = (Release) releases.get(i);
+            
+            if( release.getVersion().equals( getVersion() ) ) 
+            {
+                isFound = true;
+                return release;
+            }
+        }
+        
+        if( isFound == false )
+        {
+            throw new MojoExecutionException( "Make sure that the latest release version of changes.xml matches the version of the POM." );
+        }
+        return release;
+    }
+    
+    /**
+     * Create the velocity template
+     *
+     * @param context velocity context that has the parameter values
+     * @param outputDirectory directory where the file will be generated
+     * @param template velocity template which will the context be merged
+     * @throws ResourceNotFoundException, VelocityException, IOException
+     */
+    public void processTemplate( Context context, String outputDirectory, String template )
+        throws ResourceNotFoundException, VelocityException, IOException, MojoExecutionException
+    {
+        File f;
+        
+        try
+        {
+            f = new File( outputDirectory, template );
+            
+            if ( !f.getParentFile().exists() ) 
+            {
+                f.getParentFile().mkdirs();
+            } 
+                       
+            Writer writer = new FileWriter( f );
+
+            getVelocity().getEngine().mergeTemplate( templateDirectory + "/" + template, context, writer );
+            
+            writer.flush();
+            
+            writer.close();
+            
+            getLog().info( "File created..." );
+        }
+        
+        catch( ResourceNotFoundException rnfe ) 
+        {
+            throw new ResourceNotFoundException( "Template not found. ( " + templateDirectory + "/" + template + " )" );
+        } 
+        catch( VelocityException ve) 
+        {
+            throw new VelocityException( ve.toString() );
+        }
+   
+        catch( Exception e ) 
+        {
+            throw new MojoExecutionException( e.toString(), e.getCause() );
+        }
+    }
+    
+    public void doJiraGenerate()
+        throws MojoExecutionException
+    {
+            JiraAnnouncementDownloader jiraDownloader = new JiraAnnouncementDownloader();
+            
+            File jiraXMLFile = new File( jiraXML );
+            
+            jiraDownloader.setLog( getLog() );
+            
+            jiraDownloader.setOutput( jiraXMLFile );
+            
+            jiraDownloader.setStatusIds( statusId );
+            
+            jiraDownloader.setResolutionIds( resolutionId );
+            
+            jiraDownloader.setMavenProject( project );
+            
+            jiraDownloader.setSettings( setting );
+            
+            jiraDownloader.setNbEntries( nbEntries );
+            
+            try
+            {
+                jiraDownloader.doExecute();
+                
+                if( jiraXMLFile.exists() )
+                {
+                    JiraAnnouncementParser jiraParser = new JiraAnnouncementParser( jiraXMLFile );
+                    
+                    List issues = jiraParser.getIssues();
+                    
+                    List releases = jiraParser.getReleases( issues );
+                    
+                    doGenerate( releases );
+                }
+            }
+            catch( Exception e )
+            {
+                throw new MojoExecutionException( 
+                        "Failed to download Jira Announcement", e );
+            }        
+    }
+
+    /*
+     * accessors
+     */
+    
+    public String getXmlPath() 
+    {
+        return xmlPath;
+    }
+    
+    public void setXmlPath(String xmlPath)
+    {
+        this.xmlPath = xmlPath;
+    }
+    
+    public String getOutputDirectory()
+    {
+        return outputDirectory;
+    }
+    
+    public void setOutputDirectory(String outputDirectory) 
+    {
+        this.outputDirectory = outputDirectory;
+    }
+    
+    public String getGroupId() 
+    {
+        return groupId;
+    }
+    
+    public void setGroupId(String groupId)
+    {
+        this.groupId = groupId;
+    }
+    
+    public String getArtifactId() 
+    {
+        return artifactId;
+    }
+    
+    public void setArtifactId(String artifactId)
+    {
+        this.artifactId = artifactId;
+    }
+    
+    public String getVersion()
+    {
+        return version;
+    }
+    
+    public void setVersion(String version)
+    {
+        this.version = version;
+    }
+    
+    public String getUrl() 
+    {
+        return url;
+    }
+    
+    public void setUrl(String url) 
+    {
+        this.url = url;
+    }
+    
+    public ChangesXML getXml() 
+    {
+        return xml;
+    }
+    
+    public void setXml(ChangesXML xml) 
+    {
+        this.xml = xml;
+    }
+    
+    public String getPackaging() 
+    {
+        return packaging;
+    }
+    
+    public void setPackaging(String packaging) 
+    {
+        this.packaging = packaging;
+    }
+    
+    public String getDevelopmentTeam() 
+    {
+        return developmentTeam;
+    }
+    
+    public void setDevelopmentTeam(String developmentTeam) 
+    {
+        this.developmentTeam = developmentTeam;
+    }
+    
+    public String getIntroduction() 
+    {
+        return introduction;
+    }
+    
+    public void setIntroduction(String introduction) 
+    {
+        this.introduction = introduction;
+    }
+    
+    public VelocityComponent getVelocity()
+    {
+        return velocity;
+    }
+    
+    public void setVelocity(VelocityComponent velocity) 
+    {
+        this.velocity = velocity;
+    }
+    
+    public String getFinalName() 
+    {
+        return finalName;
+    }
+    
+    public void setFinalName(String finalName) 
+    {
+        this.finalName = finalName;
+    }
+    
+    public String getUrlDownload() 
+    {
+        return urlDownload;
+    }
+            
+    public void setUrlDownload(String urlDownload) 
+    {
+        this.urlDownload = urlDownload;
+    }
+}

Propchange: maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/announcement/AnnouncementMojo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/announcement/AnnouncementMojo.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/announcement/JiraAnnouncement.java
URL: http://svn.apache.org/viewcvs/maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/announcement/JiraAnnouncement.java?rev=387742&view=auto
==============================================================================
--- maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/announcement/JiraAnnouncement.java (added)
+++ maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/announcement/JiraAnnouncement.java Tue Mar 21 21:59:01 2006
@@ -0,0 +1,86 @@
+package org.apache.maven.announcement;
+
+import org.apache.maven.jira.JiraIssue;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class JiraAnnouncement 
+        extends JiraIssue
+{
+    private String type;
+    
+    private String comment;
+    
+    private String title;
+    
+    private String fixVersion;
+    
+    private String reporter;
+    
+    List comments;
+    
+    public void addComment( String comment )
+    {
+        if( comments == null )
+        {
+            comments = new ArrayList();
+        }
+        comments.add( comment );
+    }
+
+    public String getFixVersion()
+    {
+        return fixVersion;
+    }
+
+    public void setFixVersion( String fixVersion ) 
+    {
+        this.fixVersion = fixVersion;
+    }
+    
+    public String getComment() 
+    {
+        return comment;
+    }
+
+    public void setComment( String comment ) 
+    {
+        this.comment = comment;
+    }
+    
+    public String getTitle() 
+    {
+        return title;
+    }
+
+    public void setTitle(String title) 
+    {
+        this.title = title;
+    }    
+    
+    public void setType( String type )
+    {
+        this.type = type;
+    }
+    
+    public String getType()
+    {
+        return this.type;
+    }
+    
+    public void setReporter( String reporter )
+    {
+        this.reporter = reporter;
+    }
+    
+    public String getReporter()
+    {
+        return this.reporter;
+    }
+    
+    public List getComments()
+    {
+        return comments;
+    }    
+}

Propchange: maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/announcement/JiraAnnouncement.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/announcement/JiraAnnouncement.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/announcement/JiraAnnouncementDownloader.java
URL: http://svn.apache.org/viewcvs/maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/announcement/JiraAnnouncementDownloader.java?rev=387742&view=auto
==============================================================================
--- maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/announcement/JiraAnnouncementDownloader.java (added)
+++ maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/announcement/JiraAnnouncementDownloader.java Tue Mar 21 21:59:01 2006
@@ -0,0 +1,635 @@
+package org.apache.maven.announcement;
+
+/* ====================================================================
+ *   Copyright 2001-2004 The Apache Software Foundation.
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ * ====================================================================
+ */
+import org.apache.commons.httpclient.Credentials;
+import org.apache.commons.httpclient.Header;
+import org.apache.commons.httpclient.HostConfiguration;
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.HttpException;
+import org.apache.commons.httpclient.HttpState;
+import org.apache.commons.httpclient.HttpStatus;
+import org.apache.commons.httpclient.StatusLine;
+import org.apache.commons.httpclient.UsernamePasswordCredentials;
+import org.apache.commons.httpclient.methods.GetMethod;
+import org.apache.maven.plugin.logging.Log;
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.settings.Proxy;
+import org.apache.maven.settings.Settings;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Gets relevant issues in RSS from a given JIRA installation.
+ *
+ * Based on version 1.1.2 and patch by Dr. Spock (MPJIRA-8)
+ *
+ * @author mfranken@xebia.com
+ * @author jruiz@exist.com
+ */
+public final class JiraAnnouncementDownloader
+{
+
+    /** Log for debug output. */
+    private org.apache.maven.plugin.logging.Log log;
+
+    /** Output file for xml document. */
+    private File output;
+
+    /** The maximum number of entries to show. */
+    private int nbEntriesMax;
+
+    /** The filter to apply to query to JIRA. */
+    private String filter;
+
+    /** Ids of status to show, as comma separated string. */
+    private String statusIds;
+
+    /** Ids of resolution to show, as comma separated string. */
+    private String resolutionIds;
+
+    /** Ids of priority to show, as comma separated string. */
+    private String priorityIds;
+
+    /** The component to show. */
+    private String component;
+
+    /** The username to log into JIRA. */
+    private String jiraUser;
+
+    /** The password to log into JIRA. */
+    private String jiraPassword;
+
+    /** The username to log into webserver. */
+    private String webUser;
+
+    /** The password to log into webserver. */
+    private String webPassword;
+
+    /** The maven project. */
+    private MavenProject project;
+
+    /** The maven settings. */
+    private Settings settings;
+
+    /** Mapping containing all JIRA status values. */
+    private static Map statusMap = new HashMap();
+
+    /** Mapping containing all JIRA resolution values. */
+    private static Map resolutionMap = new HashMap();
+
+    /** Mapping containing all JIRA priority values. */
+    private static Map priorityMap = new HashMap();
+
+    static
+    {
+        statusMap.put( "Closed", "6" );
+
+        resolutionMap.put( "Fixed", "1" );
+
+        priorityMap.put( "Blocker", "1" );
+        priorityMap.put( "Critical", "2" );
+        priorityMap.put( "Major", "3" );
+        priorityMap.put( "Minor", "4" );
+        priorityMap.put( "Trivial", "5" );
+    }
+
+    /**
+     * Creates a filter given the maven.jira parameters and some defaults.
+     *
+     * @return request parameters to be added to URL used for downloading the JIRA issues
+     */
+    private String createFilter()
+    {
+        if ( ( this.filter != null ) && ( this.filter.length() > 0 ) )
+        {
+            if ( this.filter.charAt( 0 ) == '&' )
+            {
+                return this.filter.substring( 1 );
+            }
+
+            return this.filter;
+        }
+
+        StringBuffer localFilter = new StringBuffer();
+
+        // get the Status Ids
+        if ( statusIds != null )
+        {
+            String[] stats = statusIds.split( "," );
+
+            for ( int i = 0; i < stats.length; i++ )
+            {
+                String statusParam = (String) statusMap.get( stats[i] );
+
+                if ( statusParam != null )
+                {
+                    localFilter.append( "&statusIds=" + statusParam );
+                }
+            }
+        }
+
+        
+        // get the Priority Ids
+        if ( priorityIds != null )
+        {
+            String[] prios = priorityIds.split( "," );
+
+            for ( int i = 0; i < prios.length; i++ )
+            {
+                String priorityParam = (String) priorityMap.get( prios[i] );
+
+                if ( priorityParam != null )
+                {
+                    localFilter.append( "&priorityIds=" + priorityParam );
+                }
+            }
+        }
+
+        if ( resolutionIds != null )
+        {
+            // get the Resolution Ids
+            String[] resos = resolutionIds.split( "," );
+
+            for ( int i = 0; i < resos.length; i++ )
+            {
+                String resoParam = (String) resolutionMap.get( resos[i] );
+
+                if ( resoParam != null )
+                {
+                    localFilter.append( "&resolutionIds=" + resoParam );
+                }
+            }
+        }
+
+        // add all components
+        if ( component != null )
+        {
+            String[] components = component.split( "," );
+
+            for ( int i = 0; i < components.length; i++ )
+            {
+                if ( components[i].length() > 0 )
+                {
+                    localFilter.append( "&component=" + components[i] );
+                }
+            }
+        }
+
+        // add default sorting (by priority and then creation date)
+        String sort = "&sorter/field=created&sorter/order=DESC" + "&sorter/field=priority&sorter/order=DESC";
+
+        return localFilter + sort;
+    }
+
+    /**
+     * Execute the query on the JIRA server.
+     *
+     * @throws Exception on error
+     */
+    public void doExecute()
+        throws Exception
+    {
+        try
+        {            
+            HttpClient cl = new HttpClient();
+            
+            HttpState state = new HttpState();
+            
+            HostConfiguration hc = new HostConfiguration();
+            
+            cl.setHostConfiguration( hc );
+            
+            cl.setState( state );
+
+            determineProxy( cl );
+            
+            Map urlMap = getJiraUrlAndIssueId();
+            
+            String jiraUrl = (String) urlMap.get("url");
+            
+            String jiraId = (String) urlMap.get("id");
+            
+            doAuthentication( cl, jiraUrl );
+
+            // create the URL for getting the proper issues from JIRA
+            String fullURL = jiraUrl + "/secure/IssueNavigator.jspa?view=rss&pid=" + jiraId;
+            
+            //TODO:only for a temporary use case, 
+            //hardcoded of for fix version
+            fullURL += "&fixfor=12000";
+            
+            fullURL += createFilter();
+            
+            fullURL += ( "&tempMax=" + nbEntriesMax + "&reset=true&decorator=none" );
+            
+            // execute the GET
+            download( cl, fullURL );
+        }
+        catch ( Exception e )
+        {
+            getLog().error( "Error accessing " + project.getIssueManagement().getUrl(), e );
+        }
+    }
+    
+    private Map getJiraUrlAndIssueId()
+    {
+        HashMap urlMap = new HashMap();
+        
+        String url = project.getIssueManagement().getUrl();
+        
+        // chop off the parameter part
+        int pos = url.indexOf( "?" );
+
+        // and get the id while we're at it
+        String id = "";
+
+        if ( pos >= 0 )
+        {
+            // url
+            id = url.substring( url.lastIndexOf( "=" ) + 1 );
+        }
+
+        String jiraUrl = url.substring( 0, url.lastIndexOf( "/" ) );
+
+        if ( jiraUrl.endsWith( "secure" ) )
+        {
+            jiraUrl = jiraUrl.substring( 0, jiraUrl.lastIndexOf( "/" ) );
+        }
+        getLog().info( "Jira lives at: " + jiraUrl );   
+        
+        urlMap.put("url", jiraUrl);
+        
+        urlMap.put("id", id);
+        
+        return urlMap;
+    }
+
+    /**
+     * Authenticate against webserver and into JIRA if we have to.
+     *
+     * @param client    the HttpClient
+     * @param jiraUrl   the JIRA installation
+     */
+    private void doAuthentication( HttpClient client, final String jiraUrl )
+    {
+        // check and prepare for basic authentication
+        if ( ( webUser != null ) && ( webUser.length() > 0 ) )
+        {
+            client.getState().setAuthenticationPreemptive( true );
+
+            Credentials defaultcreds = new UsernamePasswordCredentials( webUser, webPassword );
+            
+            getLog().info( "Using username: " + webUser + " for Basic Authentication against the webserver at " + jiraUrl );
+            
+            client.getState().setCredentials( null, null, defaultcreds );
+        }
+
+        // log into JIRA if we have to
+        String loginUrl = null;
+
+        if ( ( jiraUser != null ) && ( jiraUser.length() > 0 ) && ( jiraPassword != null ) )
+        {
+            StringBuffer loginLink = new StringBuffer( jiraUrl );
+            
+            loginLink.append( "/login.jsp?os_destination=/secure/" );
+            
+            loginLink.append( "&os_username=" ).append( jiraUser );
+            
+            getLog().info( "Login URL: " + loginLink + "&os_password=*******" );
+            
+            loginLink.append( "&os_password=" ).append( jiraPassword );
+            
+            loginUrl = loginLink.toString();
+        }
+
+        // execute the login
+        if ( loginUrl != null )
+        {
+            GetMethod loginGet = new GetMethod( loginUrl );
+
+            try
+            {
+                client.executeMethod( loginGet );
+                
+                getLog().info( "Succesfully logged in into JIRA." );
+            }
+            catch ( Exception e )
+            {
+                if ( getLog().isDebugEnabled() )
+                {
+                    getLog().error( "Error trying to login into JIRA:", e );
+                }
+                else
+                {
+                    getLog().error( "Error trying to login into JIRA. Cause is: " + e.getLocalizedMessage() );
+                }
+                // continue any way, probably will fail later if authentication was necesaaray afterall
+            }
+        }
+    }
+
+    /**
+     * Setup proxy access if we have to.
+     *
+     * @param client  the HttpClient
+     */
+    private void determineProxy( HttpClient client )
+    {
+        // see whether there is any proxy defined in maven
+        Proxy proxy = null;
+        
+        String proxyHost = null;
+        
+        int proxyPort = 0;
+        
+        String proxyUser = null;
+        
+        String proxyPass = null;
+
+        if ( project == null )
+        {
+            getLog().error( "No project set. No proxy info available." );
+
+            return;
+        }
+
+        if ( settings != null )
+        {   
+            proxy = settings.getActiveProxy();
+        }
+
+        if ( proxy != null )
+        {   
+            proxyHost = settings.getActiveProxy().getHost();
+            
+            proxyPort = settings.getActiveProxy().getPort();
+            
+            proxyUser = settings.getActiveProxy().getUsername();
+            
+            proxyPass = settings.getActiveProxy().getPassword();
+            
+            getLog().info(proxyPass);
+        }
+
+        if ( proxyHost != null )
+        {
+            client.getHostConfiguration().setProxy( proxyHost, proxyPort );
+            
+            getLog().info( "Using proxy: " + proxyHost + " at port " + proxyPort );
+
+            if ( proxyUser != null )
+            {
+                getLog().info( "Using proxy user: " + proxyUser );
+                
+                client.getState().setProxyCredentials( null, null,
+                                                       new UsernamePasswordCredentials( proxyUser, proxyPass ) );
+            }
+        }
+    }
+
+    /**
+     * Downloads the given link using the configured HttpClient, possibly following redirects.
+     *
+     * @param cl     the HttpClient
+     * @param link   the JiraUrl
+     * @return
+     */
+    private void download( final HttpClient cl, final String link )
+    {
+        try
+        {
+            GetMethod gm = new GetMethod( link );
+            
+            getLog().info( "Downloading " + link );
+            
+            gm.setFollowRedirects( true );
+            
+            cl.executeMethod( gm );
+
+            final String strGetResponseBody = gm.getResponseBodyAsString();
+            
+            // write the reponse to file           
+            PrintWriter pw = new PrintWriter( new FileWriter( getOutput() ) );
+            
+            pw.print( strGetResponseBody );
+            
+            pw.close();
+
+            StatusLine sl = gm.getStatusLine();
+            
+            if ( sl == null )
+            {
+                getLog().info( "Unknown error validating link : " + link );
+
+                return;
+            }
+
+            // if we get a redirect, do so
+            if ( gm.getStatusCode() == HttpStatus.SC_MOVED_TEMPORARILY )
+            {
+                Header locationHeader = gm.getResponseHeader( "Location" );
+
+                if ( locationHeader == null )
+                {
+                    getLog().info( "Site sent redirect, but did not set Location header" );
+                }
+                else
+                {
+                    String newLink = locationHeader.getValue();
+                    
+                    getLog().debug( "Following redirect to " + newLink );
+                    
+                    download( cl, newLink );
+                }
+            }
+
+            if ( gm.getStatusCode() != HttpStatus.SC_OK )
+            {
+                getLog().warn( "Received: [" + gm.getStatusCode() + "]" );
+            }
+        }
+        catch ( HttpException e )
+        {
+            if ( getLog().isDebugEnabled() )
+            {
+                getLog().error( "Error downloading issues from JIRA:", e );
+            }
+            else
+            {
+                getLog().error( "Error downloading issues from JIRA url :  " + e.getLocalizedMessage() );
+                   
+            }
+        }
+        catch ( IOException e )
+        {
+            if ( getLog().isDebugEnabled() )
+            {
+                getLog().error( "Error downloading issues from JIRA :", e );
+            }
+            else
+            {
+                getLog().error( "Error downloading issues from JIRA. Cause is " + e.getLocalizedMessage() );
+            }
+        }
+    }
+
+    /**
+     * Set the output file for the log.
+     *
+     * @param thisOutput the output file
+     */
+    public void setOutput( File thisOutput )
+    {
+        this.output = thisOutput;
+    }
+    
+    public File getOutput()
+    {
+        return this.output;
+    }
+
+    /**
+     * Sets the project.
+     *
+     * @param thisProject  The project to set
+     */
+    public void setMavenProject( Object thisProject )
+    {
+        this.project = (MavenProject) thisProject;
+    }
+
+    /**
+     * Sets the maximum number of Issues to show.
+     *
+     * @param nbEntries  The maximum number of Issues
+     */
+    public void setNbEntries( final int nbEntries )
+    {
+        nbEntriesMax = nbEntries;
+    }
+
+    /**
+     * Sets the statusIds.
+     *
+     * @param thisStatusIds   The id(s) of the status to show, as comma separated string
+     */
+    public void setStatusIds( String thisStatusIds )
+    {
+        statusIds = thisStatusIds;
+    }
+
+    /**
+     * Sets the priorityIds.
+     *
+     * @param thisPriorityIds  The id(s) of the priority to show, as comma separated string
+     */
+    public void setPriorityIds( String thisPriorityIds )
+    {
+        priorityIds = thisPriorityIds;
+    }
+
+    /**
+     * Sets the resolutionIds.
+     *
+     * @param thisResolutionIds  The id(s) of the resolution to show, as comma separated string
+     */
+    public void setResolutionIds( String thisResolutionIds )
+    {
+        resolutionIds = thisResolutionIds;
+    }
+
+    /**
+     * Sets the password for authentication against the webserver.
+     *
+     * @param thisWebPassword  The password of the webserver
+     */
+    public void setWebPassword( String thisWebPassword )
+    {
+        this.webPassword = thisWebPassword;
+    }
+
+    /**
+     * Sets the username for authentication against the webserver.
+     *
+     * @param thisWebUser   The username of the webserver
+     */
+    public void setWebUser( String thisWebUser )
+    {
+        this.webUser = thisWebUser;
+    }
+
+    /**
+     * Sets the password to log into a secured JIRA.
+     *
+     * @param thisJiraPassword  The password for JIRA
+     */
+    public void setJiraPassword( final String thisJiraPassword )
+    {
+        this.jiraPassword = thisJiraPassword;
+    }
+
+    /**
+     * Sets the username to log into a secured JIRA.
+     *
+     * @param thisJiraUser  The username for JIRA
+     */
+    public void setJiraUser( String thisJiraUser )
+    {
+        this.jiraUser = thisJiraUser;
+    }
+
+    /**
+     * Sets the filter to apply to query to JIRA.
+     *
+     * @param thisFilter  The filter to query JIRA
+     */
+    public void setFilter( String thisFilter )
+    {
+        this.filter = thisFilter;
+    }
+
+    /**
+     * Sets the component(s) to apply to query JIRA.
+     *
+     * @param theseComponents   The id(s) of components to show, as comma separated string
+     */
+    public void setComponent( String theseComponents )
+    {
+        this.component = theseComponents;
+    }
+
+    public void setLog( Log log )
+    {
+        this.log = log;
+    }
+
+    private org.apache.maven.plugin.logging.Log getLog()
+    {
+        return log;
+    }
+    
+    public void setSettings(Settings settings)
+    {
+        this.settings = settings;
+    }
+}

Propchange: maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/announcement/JiraAnnouncementDownloader.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/announcement/JiraAnnouncementDownloader.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/announcement/JiraAnnouncementParser.java
URL: http://svn.apache.org/viewcvs/maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/announcement/JiraAnnouncementParser.java?rev=387742&view=auto
==============================================================================
--- maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/announcement/JiraAnnouncementParser.java (added)
+++ maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/announcement/JiraAnnouncementParser.java Tue Mar 21 21:59:01 2006
@@ -0,0 +1,197 @@
+package org.apache.maven.announcement;
+
+import org.apache.maven.changes.Action;
+import org.apache.maven.changes.Release;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
+
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * XML Parser for Jira Announcement
+ *
+ * @author aramirez@exist.com
+ */
+public class JiraAnnouncementParser 
+        extends DefaultHandler
+{
+    private String elementValue;
+    
+    private String parentElement = "";
+    
+    private JiraAnnouncement issue;
+    
+    List issues = new ArrayList();
+    
+    public JiraAnnouncementParser( String xmlPath )
+    {
+        File xml = new File( xmlPath );
+        
+        parseJira( xml );
+    }
+    
+    public JiraAnnouncementParser( File xmlPath )
+    {
+        parseJira( xmlPath );
+    }
+    
+    public void parseJira( File xml )
+    {
+        SAXParserFactory factory = SAXParserFactory.newInstance();
+        
+        try
+        {
+            SAXParser parser = factory.newSAXParser();
+            
+            parser.parse( xml, this );
+        }
+        catch( Throwable t )
+        {
+            t.printStackTrace();
+        }
+    }
+    
+    public void startElement( String namespaceURI, String sName, String qName, Attributes attrs )
+        throws SAXException
+    {
+        if( qName.equals( "item" ) )
+        {
+            issue = new JiraAnnouncement();
+            
+            parentElement = "item";
+        }
+    }
+    
+    public void endElement( String namespaceURI, String sName, String qName )
+        throws SAXException
+    {
+        if( qName.equals( "item" ) )
+        {
+            issues.add( issue ); 
+            
+            parentElement = "";
+        }
+        else if( qName.equals( "title" ) && parentElement.equals( "item" ) )
+        {
+            issue.setTitle( elementValue );
+        }
+        else if( qName.equals( "key" ) )
+        {
+            issue.setKey( elementValue );
+        }
+        else if( qName.equals( "link" ) && parentElement.equals( "item" ) )
+        {
+            issue.setLink( elementValue );
+        }
+        else if( qName.equals( "summary" ) )
+        {
+            issue.setSummary( elementValue );
+        }
+        else if( qName.equals( "type" ) )
+        {
+            issue.setType( elementValue );
+        }
+        else if( qName.equals( "status" ) )
+        {
+            issue.setStatus( elementValue );
+        }
+        else if( qName.equals( "resolution" ) )
+        {
+            issue.setResolution( elementValue );
+        }
+        else if( qName.equals( "assignee" ) )
+        {
+            issue.setAssignee( elementValue );
+        }
+        else if( qName.equals( "reporter" ) )
+        {
+            issue.setReporter( elementValue );
+        }
+        else if( qName.equals( "fixVersion" ) )
+        {
+            issue.setFixVersion( elementValue );
+        }
+        else if( qName.equals( "comment" ) )
+        {
+            issue.addComment( elementValue );
+        }
+    }
+    
+    public void characters( char[] buff, int offset, int len )
+        throws SAXException
+    {
+        String str = new String( buff, offset, len );
+        
+        String string = str.trim();
+        
+        if( !string.equals( "" ) )
+        {
+            elementValue = string;
+        }
+    }
+    
+    public List getIssues()
+    {
+        return this.issues;
+    }
+    
+    public List getReleases( List issues )
+    {
+        List releases = new ArrayList();
+        
+        Release release = new Release();
+        
+        String type = "";
+        
+        for( int i=0; i<issues.size(); i++ )
+        {
+            JiraAnnouncement issue = ( JiraAnnouncement ) issues.get( i );
+            
+            Action action = new Action();
+            
+            action.setIssue( issue.getKey() );
+
+            if( issue.getType().equals( "Bug" ) )
+            {
+                type = "fix";
+            }
+            else if( issue.getType().equals( "New Feature" ) )
+            {
+                type = "add";
+            }
+            else if( issue.getType().equals( "Improvement" ) )
+            {
+                type = "update";
+            }
+            action.setType( type );
+            
+            action.setDev( issue.getAssignee() );
+            
+            //action.setDueTo( issue.getReporter() );
+            
+            if( issue.getComments() != null && !issue.getComments().isEmpty() )
+            {
+                int commentSize = issue.getComments().size();
+           
+                action.setAction( issue.getComments().get( commentSize - 1 ).toString() );
+            }    
+            else
+            {
+                action.setAction( "" );
+            }
+            release.addAction( action );
+            
+            release.setDescription( issue.getSummary() );
+            
+            release.setVersion( issue.getFixVersion() );
+            
+            releases.add( release ); 
+        }
+        return releases;
+    }
+}

Propchange: maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/announcement/JiraAnnouncementParser.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/announcement/JiraAnnouncementParser.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/announcement/mailsender/ProjectJavamailMailSender.java
URL: http://svn.apache.org/viewcvs/maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/announcement/mailsender/ProjectJavamailMailSender.java?rev=387742&view=auto
==============================================================================
--- maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/announcement/mailsender/ProjectJavamailMailSender.java (added)
+++ maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/announcement/mailsender/ProjectJavamailMailSender.java Tue Mar 21 21:59:01 2006
@@ -0,0 +1,201 @@
+package org.apache.maven.announcement.mailsender;
+
+/*
+ * The MIT License
+ *
+ * Copyright (c) 2004, The Codehaus
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+ * of the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+import org.codehaus.plexus.mailsender.AbstractMailSender;
+import org.codehaus.plexus.mailsender.MailMessage;
+import org.codehaus.plexus.mailsender.MailSenderException;
+import org.codehaus.plexus.mailsender.util.DateFormatUtils;
+import org.codehaus.plexus.util.StringUtils;
+
+import javax.mail.Authenticator;
+import javax.mail.Message;
+import javax.mail.MessagingException;
+import javax.mail.PasswordAuthentication;
+import javax.mail.Session;
+import javax.mail.Transport;
+import javax.mail.internet.InternetAddress;
+import javax.mail.internet.MimeMessage;
+import java.security.Security;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.Properties;
+
+public class ProjectJavamailMailSender
+	extends AbstractMailSender
+{
+    private static final String SSL_FACTORY = "javax.net.ssl.SSLSocketFactory";
+
+    // ----------------------------------------------------------------------
+    //
+    // ----------------------------------------------------------------------
+
+    private Properties userProperties;
+
+    private Properties props;
+
+    // ----------------------------------------------------------------------
+    // Component Lifecycle
+    // ----------------------------------------------------------------------
+
+    public void initialize()
+    {      
+        if ( StringUtils.isEmpty( getSmtpHost() ) )
+        {
+            System.out.println( "Error in configuration: Missing smtpHost." );
+        }
+
+        if ( getSmtpPort() == 0 )
+        {
+            setSmtpPort( DEFAULT_SMTP_PORT );
+        }
+
+        props = new Properties();
+
+        props.put( "mail.smtp.host", getSmtpHost() );
+
+        props.put( "mail.smtp.port", String.valueOf( getSmtpPort() ) );
+
+        if ( getUsername() != null )
+        {
+            props.put( "mail.smtp.auth", "true" );
+        }
+
+        props.put( "mail.debug", String.valueOf( getLogger().isDebugEnabled() ) );
+
+        if ( isSslMode() )
+        {
+            Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
+
+            props.put( "mail.smtp.socketFactory.port", String.valueOf( getSmtpPort() ) );
+
+            props.put( "mail.smtp.socketFactory.class", SSL_FACTORY );
+
+            props.put( "mail.smtp.socketFactory.fallback", "false" );
+        }
+
+        if ( userProperties != null )
+        {
+            for ( Iterator i = userProperties.keySet().iterator(); i.hasNext(); )
+            {
+                String key = (String) i.next();
+
+                String value = userProperties.getProperty( key );
+
+                props.put( key, value );
+            }
+        }
+    }
+
+    // ----------------------------------------------------------------------
+    // MailSender Implementation
+    // ----------------------------------------------------------------------
+
+    public void send( MailMessage mail )
+        throws MailSenderException
+	{
+	    verify( mail );
+
+        try
+        {
+            Authenticator auth = null;
+
+            if ( getUsername() != null )
+            {
+                auth = new Authenticator()
+                    {
+                        protected PasswordAuthentication getPasswordAuthentication()
+                        {
+                            return new PasswordAuthentication( getUsername(), getPassword() );
+                        }
+                    };
+            }
+
+            Session session = Session.getDefaultInstance(props, auth );
+
+            session.setDebug( getLogger().isDebugEnabled() );
+
+            Message msg = new MimeMessage( session );
+            InternetAddress addressFrom = new InternetAddress( mail.getFrom().getRfc2822Address() );
+            msg.setFrom( addressFrom );
+
+            if ( mail.getToAddresses().size() > 0 )
+            {
+                InternetAddress[] addressTo = new InternetAddress[mail.getToAddresses().size()];
+                int count = 0;
+                for ( Iterator i = mail.getToAddresses().iterator(); i.hasNext(); )
+                {
+                    String address = ((MailMessage.Address) i.next()).getRfc2822Address();
+                    addressTo[count++] = new InternetAddress( address );
+                }
+                msg.setRecipients( Message.RecipientType.TO, addressTo );
+            }
+
+            if ( mail.getCcAddresses().size() > 0 )
+            {
+                InternetAddress[] addressCc = new InternetAddress[mail.getCcAddresses().size()];
+                int count = 0;
+                for ( Iterator i = mail.getCcAddresses().iterator(); i.hasNext(); )
+                {
+                    String address = ((MailMessage.Address) i.next()).getRfc2822Address();
+                    addressCc[count++] = new InternetAddress( address );
+                }
+                msg.setRecipients( Message.RecipientType.CC, addressCc );
+            }
+
+            if ( mail.getBccAddresses().size() > 0 )
+            {
+                InternetAddress[] addressBcc = new InternetAddress[mail.getBccAddresses().size()];
+                int count = 0;
+                for ( Iterator i = mail.getBccAddresses().iterator(); i.hasNext(); )
+                {
+                    String address = ((MailMessage.Address) i.next()).getRfc2822Address();
+                    addressBcc[count++] = new InternetAddress( address );
+                }
+                msg.setRecipients( Message.RecipientType.BCC, addressBcc );
+            }
+
+            // Setting the Subject and Content Type
+            msg.setSubject( mail.getSubject() );
+            msg.setContent( mail.getContent(), "text/plain" );
+
+            if ( mail.getSendDate() != null )
+            {
+                msg.setHeader( "Date", DateFormatUtils.getDateHeader( mail.getSendDate() ) );
+            }
+            else
+            {
+                msg.setHeader( "Date", DateFormatUtils.getDateHeader( new Date() ) );
+            }
+
+            // Send the message
+            Transport.send( msg );
+        }
+        catch ( MessagingException e )
+        {
+            throw new MailSenderException( "Error while sending mail.", e );
+        }
+    }
+}

Propchange: maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/announcement/mailsender/ProjectJavamailMailSender.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/announcement/mailsender/ProjectJavamailMailSender.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/changes/Action.java
URL: http://svn.apache.org/viewcvs/maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/changes/Action.java?rev=387742&view=auto
==============================================================================
--- maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/changes/Action.java (added)
+++ maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/changes/Action.java Tue Mar 21 21:59:01 2006
@@ -0,0 +1,95 @@
+package org.apache.maven.changes;
+
+/*
+ * Copyright 2001-2005 The Codehaus.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+public class Action
+{
+    private String action;
+
+    private String dev;
+
+    private String dueTo;
+
+    private String dueToEmail;
+
+    private String issue;
+
+    private String type;
+
+    public Action()
+    {
+    }
+
+    public void setAction( String action )
+    {
+        this.action = action;
+    }
+
+    public String getAction()
+    {
+        return action;
+    }
+
+    public void setDev( String dev )
+    {
+        this.dev = dev;
+    }
+
+    public String getDev()
+    {
+        return dev;
+    }
+
+    public void setDueTo( String dueTo )
+    {
+        this.dueTo = dueTo;
+    }
+
+    public String getDueTo()
+    {
+        return dueTo;
+    }
+
+    public void setDueToEmail( String dueToEmail )
+    {
+        this.dueToEmail = dueToEmail;
+    }
+
+    public String getDueToEmail()
+    {
+        return dueToEmail;
+    }
+
+    public void setIssue( String issue )
+    {
+        this.issue = issue;
+    }
+
+    public String getIssue()
+    {
+        return issue;
+    }
+
+    public void setType( String type )
+    {
+        this.type = type;
+    }
+
+    public String getType()
+    {
+        return type;
+    }
+}

Propchange: maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/changes/Action.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/changes/Action.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/changes/ChangesMojo.java
URL: http://svn.apache.org/viewcvs/maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/changes/ChangesMojo.java?rev=387742&view=auto
==============================================================================
--- maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/changes/ChangesMojo.java (added)
+++ maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/changes/ChangesMojo.java Tue Mar 21 21:59:01 2006
@@ -0,0 +1,149 @@
+package org.apache.maven.changes;
+
+/*
+ * Copyright 2001-2005 The Codehaus.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.io.File;
+import java.util.Locale;
+import java.util.ResourceBundle;
+
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.reporting.AbstractMavenReport;
+import org.apache.maven.reporting.MavenReportException;
+import org.codehaus.doxia.site.renderer.SiteRenderer;
+
+/**
+ * @goal changes-report
+ * @description Goal wich creates a nicely formatted Changes Report in html format from changes.xml.
+ * @author <a href="mailto:jruiz@exist.com">Johnny R. Ruiz III</a>
+ * @version $Id$
+ */
+public class ChangesMojo
+    extends AbstractMavenReport
+{
+    /**
+     * Directory where reports will go.
+     * @parameter expression="${project.build.directory}/site "
+     * @required
+     * @readonly
+     */
+    private String outputDirectory;
+
+    /**
+     * @parameter expression="${component.org.codehaus.doxia.site.renderer.SiteRenderer}"
+     * @required
+     * @readonly
+     */
+    private SiteRenderer siteRenderer;
+
+    /**
+     * @parameter expression="${project}"
+     * @required
+     * @readonly
+     */
+    private MavenProject project;
+
+    /**
+     * The changes.xml that will be converted into an html report.
+     * @parameter expression="${basedir}/src/changes/changes.xml"
+     * @required
+     */
+    private String xmlPath;
+
+    /**
+     * Template string that is used to discover the URL to use to display a bug report.
+     * There are 2 template tokens you can use. %URL%: this is computed by getting the
+     * &lt;issueManagement&gt;&lt;url&gt; value from the POM, and removing the context path. %ISSUE% :
+     * this is the issue number.
+     * @parameter expression="%URL%/ViewIssue.jspa?key=%ISSUE%"
+     *
+     */
+    private String link_template;
+
+    /**
+     * @parameter expression="${project.issueManagement.url}"
+     * @readonly
+     */
+    private String url;
+
+    public void executeReport( Locale locale )
+        throws MavenReportException
+    {
+
+        File xmlFile = new File( xmlPath );
+
+        if ( !xmlFile.exists() )
+        {
+            getLog().error( getBundle( locale ).getString( "report.changes.error" ) );
+
+            ChangesReportGenerator report = new ChangesReportGenerator();
+
+            report.doGenerateEmptyReport( getBundle( locale ), getSink(), getBundle( locale )
+                .getString( "report.changes.error" ) );
+        }
+        else
+        {
+            ChangesReportGenerator report = new ChangesReportGenerator( xmlPath );
+
+            if ( ( url == null ) || ( url.trim().equals( "" ) ) )
+            {
+                getLog().warn( getBundle( locale ).getString( "report.changes.warn.url" ) );
+            }
+
+            report.setIssueLink( link_template );
+
+            report.setUrl( url );
+
+            report.doGenerateReport( getBundle( locale ), getSink() );
+        }
+
+    }
+
+    public String getName( Locale locale )
+    {
+        return getBundle( locale ).getString( "report.changes.name" );
+    }
+
+    public String getDescription( Locale locale )
+    {
+        return getBundle( locale ).getString( "report.changes.description" );
+    }
+
+    protected SiteRenderer getSiteRenderer()
+    {
+        return siteRenderer;
+    }
+
+    protected MavenProject getProject()
+    {
+        return project;
+    }
+
+    public String getOutputName()
+    {
+        return "changes-report";
+    }
+
+    protected String getOutputDirectory()
+    {
+        return outputDirectory;
+    }
+
+    private ResourceBundle getBundle( Locale locale )
+    {
+        return ResourceBundle.getBundle( "changes-report", locale, this.getClass().getClassLoader() );
+    }
+}

Propchange: maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/changes/ChangesMojo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/sandbox/plugins/changes-maven-plugin/src/main/java/org/apache/maven/changes/ChangesMojo.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"



Mime
View raw message