You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ol...@apache.org on 2008/07/26 21:13:48 UTC

svn commit: r680030 - in /maven/plugins/trunk/maven-changes-plugin: ./ src/it/announcement-generate-custom-template/ src/it/announcement-generate-custom-template/src/ src/it/announcement-generate-custom-template/src/changes/ src/it/announcement-generat...

Author: olamy
Date: Sat Jul 26 12:13:48 2008
New Revision: 680030

URL: http://svn.apache.org/viewvc?rev=680030&view=rev
Log:
[MCHANGES-118] AnnouncementMojo can only load velocity templates from src/main/resources


Added:
    maven/plugins/trunk/maven-changes-plugin/src/it/announcement-generate-custom-template/
    maven/plugins/trunk/maven-changes-plugin/src/it/announcement-generate-custom-template/goals.txt   (with props)
    maven/plugins/trunk/maven-changes-plugin/src/it/announcement-generate-custom-template/pom.xml   (with props)
    maven/plugins/trunk/maven-changes-plugin/src/it/announcement-generate-custom-template/src/
    maven/plugins/trunk/maven-changes-plugin/src/it/announcement-generate-custom-template/src/changes/
    maven/plugins/trunk/maven-changes-plugin/src/it/announcement-generate-custom-template/src/changes/changes.xml   (with props)
    maven/plugins/trunk/maven-changes-plugin/src/it/announcement-generate-custom-template/template-directory/
    maven/plugins/trunk/maven-changes-plugin/src/it/announcement-generate-custom-template/template-directory/test-announce.vm   (with props)
    maven/plugins/trunk/maven-changes-plugin/src/it/announcement-generate-custom-template/verify.bsh   (with props)
Modified:
    maven/plugins/trunk/maven-changes-plugin/pom.xml
    maven/plugins/trunk/maven-changes-plugin/src/it/report-changes-generation/pom.xml
    maven/plugins/trunk/maven-changes-plugin/src/it/report-changes-system/pom.xml
    maven/plugins/trunk/maven-changes-plugin/src/it/report-changes-system/verify.bsh
    maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/announcement/AnnouncementMojo.java
    maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/resource/loader/ProjectResourceLoader.java
    maven/plugins/trunk/maven-changes-plugin/src/main/resources/META-INF/plexus/components.xml

Modified: maven/plugins/trunk/maven-changes-plugin/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/pom.xml?rev=680030&r1=680029&r2=680030&view=diff
==============================================================================
--- maven/plugins/trunk/maven-changes-plugin/pom.xml (original)
+++ maven/plugins/trunk/maven-changes-plugin/pom.xml Sat Jul 26 12:13:48 2008
@@ -243,6 +243,14 @@
       <artifactId>velocity</artifactId>
       <version>1.5</version>
     </dependency>
+    
+    <dependency>
+      <groupId>org.apache.maven.plugin-testing</groupId>
+      <artifactId>maven-plugin-testing-harness</artifactId>
+      <version>1.2</version>
+      <scope>test</scope>
+    </dependency>    
+    
   </dependencies>
 
   <reporting>

Added: maven/plugins/trunk/maven-changes-plugin/src/it/announcement-generate-custom-template/goals.txt
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/it/announcement-generate-custom-template/goals.txt?rev=680030&view=auto
==============================================================================
--- maven/plugins/trunk/maven-changes-plugin/src/it/announcement-generate-custom-template/goals.txt (added)
+++ maven/plugins/trunk/maven-changes-plugin/src/it/announcement-generate-custom-template/goals.txt Sat Jul 26 12:13:48 2008
@@ -0,0 +1 @@
+changes:announcement-generate
\ No newline at end of file

Propchange: maven/plugins/trunk/maven-changes-plugin/src/it/announcement-generate-custom-template/goals.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-changes-plugin/src/it/announcement-generate-custom-template/goals.txt
------------------------------------------------------------------------------
    svn:executable = *

Propchange: maven/plugins/trunk/maven-changes-plugin/src/it/announcement-generate-custom-template/goals.txt
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/plugins/trunk/maven-changes-plugin/src/it/announcement-generate-custom-template/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/it/announcement-generate-custom-template/pom.xml?rev=680030&view=auto
==============================================================================
--- maven/plugins/trunk/maven-changes-plugin/src/it/announcement-generate-custom-template/pom.xml (added)
+++ maven/plugins/trunk/maven-changes-plugin/src/it/announcement-generate-custom-template/pom.xml Sat Jul 26 12:13:48 2008
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you 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.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven.plugins</groupId>
+  <artifactId>maven-changes-plugin-test</artifactId>
+  <version>1.1</version>
+  <name>Maven</name>
+  <packaging>jar</packaging>
+  <description>Test Announcement Custom template</description>
+  <url>http://maven.apache.org/plugins/maven-changes-plugin/</url>
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>3.8.1</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+  <issueManagement>
+    <system>jira</system>
+    <url>http://localhost</url>
+  </issueManagement>
+  <properties>
+    <changesPluginVersion>@pom.version@</changesPluginVersion>
+  </properties>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-changes-plugin</artifactId>
+        <version>${changesPluginVersion}</version>        
+      </plugin>
+    </plugins>
+  </build>
+  <reporting>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-changes-plugin</artifactId>
+        <version>${changesPluginVersion}</version>
+        <configuration>
+          <template>test-announce.vm</template>
+          <templateDirectory>template-directory</templateDirectory>
+        </configuration>
+      </plugin>
+    </plugins>
+  </reporting>
+  
+</project>

Propchange: maven/plugins/trunk/maven-changes-plugin/src/it/announcement-generate-custom-template/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-changes-plugin/src/it/announcement-generate-custom-template/pom.xml
------------------------------------------------------------------------------
    svn:executable = *

Propchange: maven/plugins/trunk/maven-changes-plugin/src/it/announcement-generate-custom-template/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/plugins/trunk/maven-changes-plugin/src/it/announcement-generate-custom-template/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/it/announcement-generate-custom-template/src/changes/changes.xml?rev=680030&view=auto
==============================================================================
--- maven/plugins/trunk/maven-changes-plugin/src/it/announcement-generate-custom-template/src/changes/changes.xml (added)
+++ maven/plugins/trunk/maven-changes-plugin/src/it/announcement-generate-custom-template/src/changes/changes.xml Sat Jul 26 12:13:48 2008
@@ -0,0 +1,45 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you 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.
+-->
+
+<document>
+  <properties>
+    <title>Changes report Project</title>
+    <author email="zloug@toto.com">Mr Zloug</author>
+  </properties>
+  <body>
+    <release version="1.1" date="2005-03-01" description="Subsequent release">
+      <action dev="me" type="add">
+        Added additional documentation on how to configure the plugin.
+      </action>
+      <action dev="me" type="fix" issue="MCHANGES-88">
+        Enable retrieving component-specific issues.
+      </action>
+      <action dev="jruiz" type="remove" due-to="others" due-to-email="users@users.com">
+        The element type " link " must be terminated by the matching end-tag.
+        Deleted the erroneous code.
+      </action>
+    </release>
+
+    <release version="1.0" date="2005-01-01" description="First release">
+      <action dev="me" type="update">
+        Uploaded documentation on how to use the plugin.
+      </action>
+    </release>
+  </body>
+</document>
\ No newline at end of file

Propchange: maven/plugins/trunk/maven-changes-plugin/src/it/announcement-generate-custom-template/src/changes/changes.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-changes-plugin/src/it/announcement-generate-custom-template/src/changes/changes.xml
------------------------------------------------------------------------------
    svn:executable = *

Propchange: maven/plugins/trunk/maven-changes-plugin/src/it/announcement-generate-custom-template/src/changes/changes.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/plugins/trunk/maven-changes-plugin/src/it/announcement-generate-custom-template/template-directory/test-announce.vm
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/it/announcement-generate-custom-template/template-directory/test-announce.vm?rev=680030&view=auto
==============================================================================
--- maven/plugins/trunk/maven-changes-plugin/src/it/announcement-generate-custom-template/template-directory/test-announce.vm (added)
+++ maven/plugins/trunk/maven-changes-plugin/src/it/announcement-generate-custom-template/template-directory/test-announce.vm Sat Jul 26 12:13:48 2008
@@ -0,0 +1,3 @@
+The ${developmentTeam} is pleased to announce the ${finalName} release!
+
+${introduction}
\ No newline at end of file

Propchange: maven/plugins/trunk/maven-changes-plugin/src/it/announcement-generate-custom-template/template-directory/test-announce.vm
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-changes-plugin/src/it/announcement-generate-custom-template/template-directory/test-announce.vm
------------------------------------------------------------------------------
    svn:executable = *

Propchange: maven/plugins/trunk/maven-changes-plugin/src/it/announcement-generate-custom-template/template-directory/test-announce.vm
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/plugins/trunk/maven-changes-plugin/src/it/announcement-generate-custom-template/verify.bsh
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/it/announcement-generate-custom-template/verify.bsh?rev=680030&view=auto
==============================================================================
--- maven/plugins/trunk/maven-changes-plugin/src/it/announcement-generate-custom-template/verify.bsh (added)
+++ maven/plugins/trunk/maven-changes-plugin/src/it/announcement-generate-custom-template/verify.bsh Sat Jul 26 12:13:48 2008
@@ -0,0 +1,60 @@
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.*;
+import java.util.*;
+import java.util.jar.*;
+import org.codehaus.plexus.util.*;
+
+boolean result = true;
+
+try
+{
+    File report = new File( basedir, "target/announcement/test-announce.vm" );
+    if ( !report.exists() || report.isDirectory() )
+    {
+        System.err.println( "report file is missing or a directory." );
+        return false;
+    }
+    FileInputStream fis = new FileInputStream ( report );
+    String reportContent = IOUtil.toString ( fis );    
+    
+    int indexOf = reportContent.indexOf( "maven-changes-plugin-test-1.1 release" );
+    if ( indexOf < 0)
+    {
+      System.err.println( "test-announce.vm doesn't maven-changes-plugin-test-1.1 release" );
+      return false;
+    }    
+    
+    indexOf = reportContent.indexOf( "Test Announcement Custom template" );
+    if ( indexOf < 0)
+    {
+      System.err.println( "Test Announcement Custom template" );
+      return false;
+    }
+    
+}
+catch( Throwable e )
+{
+    e.printStackTrace();
+    result = false;
+}
+
+return result;

Propchange: maven/plugins/trunk/maven-changes-plugin/src/it/announcement-generate-custom-template/verify.bsh
------------------------------------------------------------------------------
    svn:executable = *

Modified: maven/plugins/trunk/maven-changes-plugin/src/it/report-changes-generation/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/it/report-changes-generation/pom.xml?rev=680030&r1=680029&r2=680030&view=diff
==============================================================================
--- maven/plugins/trunk/maven-changes-plugin/src/it/report-changes-generation/pom.xml (original)
+++ maven/plugins/trunk/maven-changes-plugin/src/it/report-changes-generation/pom.xml Sat Jul 26 12:13:48 2008
@@ -40,6 +40,18 @@
     <system>jira</system>
     <url>http://localhost</url>
   </issueManagement>
+  <properties>
+    <changesPluginVersion>@pom.version@</changesPluginVersion>
+  </properties>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-changes-plugin</artifactId>
+        <version>${changesPluginVersion}</version>        
+      </plugin>
+    </plugins>
+  </build>  
   <reporting>
     <plugins>
       <plugin>

Modified: maven/plugins/trunk/maven-changes-plugin/src/it/report-changes-system/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/it/report-changes-system/pom.xml?rev=680030&r1=680029&r2=680030&view=diff
==============================================================================
--- maven/plugins/trunk/maven-changes-plugin/src/it/report-changes-system/pom.xml (original)
+++ maven/plugins/trunk/maven-changes-plugin/src/it/report-changes-system/pom.xml Sat Jul 26 12:13:48 2008
@@ -40,6 +40,18 @@
     <system>jira</system>
     <url>http://localhost</url>
   </issueManagement>
+  <properties>
+    <changesPluginVersion>@pom.version@</changesPluginVersion>
+  </properties>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-changes-plugin</artifactId>
+        <version>${changesPluginVersion}</version>        
+      </plugin>
+    </plugins>
+  </build>  
   <reporting>
     <plugins>
       <plugin>

Modified: maven/plugins/trunk/maven-changes-plugin/src/it/report-changes-system/verify.bsh
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/it/report-changes-system/verify.bsh?rev=680030&r1=680029&r2=680030&view=diff
==============================================================================
--- maven/plugins/trunk/maven-changes-plugin/src/it/report-changes-system/verify.bsh (original)
+++ maven/plugins/trunk/maven-changes-plugin/src/it/report-changes-system/verify.bsh Sat Jul 26 12:13:48 2008
@@ -49,7 +49,7 @@
       System.err.println( "changes-report.html doesn't contains jira issue link" );
       return false;
     }
-    indexOf = reportContent.indexOf( "<a href=\"http://localhost/1212\" class=\"externalLink\">1212</a>" );
+    indexOf = reportContent.indexOf( "href=\"http://localhost/1212\"" );
     if ( indexOf < 0)
     {
       System.err.println( "changes-report.html doesn't contains qc issue link" );

Modified: maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/announcement/AnnouncementMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/announcement/AnnouncementMojo.java?rev=680030&r1=680029&r2=680030&view=diff
==============================================================================
--- maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/announcement/AnnouncementMojo.java (original)
+++ maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/announcement/AnnouncementMojo.java Sat Jul 26 12:13:48 2008
@@ -138,7 +138,7 @@
     /**
      * Velocity Component.
      *
-     * @parameter expression="${component.org.codehaus.plexus.velocity.VelocityComponent}"
+     * @component role="org.codehaus.plexus.velocity.VelocityComponent" roleHint="maven-changes-plugin"
      * @readonly
      */
     private VelocityComponent velocity;

Modified: maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/resource/loader/ProjectResourceLoader.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/resource/loader/ProjectResourceLoader.java?rev=680030&r1=680029&r2=680030&view=diff
==============================================================================
--- maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/resource/loader/ProjectResourceLoader.java (original)
+++ maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/resource/loader/ProjectResourceLoader.java Sat Jul 26 12:13:48 2008
@@ -24,7 +24,9 @@
 import java.io.FileInputStream;
 import java.io.FileNotFoundException;
 import java.io.InputStream;
+import java.util.ArrayList;
 import java.util.Hashtable;
+import java.util.List;
 import java.util.Vector;
 
 import org.apache.commons.collections.ExtendedProperties;
@@ -44,7 +46,7 @@
     /**
      * The paths to search for templates.
      */
-    private Vector paths = null;
+    private List paths = null;
 
     /**
      * Used to map the path that a template was found on
@@ -64,9 +66,13 @@
 
         rsvc.info( "path :" + path );
 
-        paths = new Vector();
+        paths = new ArrayList();
 
         paths.add( path );
+        
+        // MCHANGES-118 adding the user.dir path
+        
+        paths.add( System.getProperty( "user.dir" ) );
 
         int sz = paths.size();
 
@@ -163,6 +169,8 @@
         {
             File file = new File( path, template );
 
+            System.out.println(" search file " + file.getPath() );
+            
             if ( file.canRead() )
             {
                 return new BufferedInputStream( new FileInputStream( file.getAbsolutePath() ) );

Modified: maven/plugins/trunk/maven-changes-plugin/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/main/resources/META-INF/plexus/components.xml?rev=680030&r1=680029&r2=680030&view=diff
==============================================================================
--- maven/plugins/trunk/maven-changes-plugin/src/main/resources/META-INF/plexus/components.xml (original)
+++ maven/plugins/trunk/maven-changes-plugin/src/main/resources/META-INF/plexus/components.xml Sat Jul 26 12:13:48 2008
@@ -16,11 +16,11 @@
 specific language governing permissions and limitations
 under the License.
 -->
-<plexus>
+<component-set>
   <components>
     <component>
       <role>org.codehaus.plexus.velocity.VelocityComponent</role>
-      <role-hint>default</role-hint>
+      <role-hint>maven-changes-plugin</role-hint>
       <implementation>org.codehaus.plexus.velocity.DefaultVelocityComponent</implementation>
       <configuration>
         <properties>
@@ -40,4 +40,4 @@
       </configuration>
     </component>
   </components>
-</plexus>
+</component-set>
\ No newline at end of file