hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1033873 - /httpcomponents/maven-notice-plugin/trunk/src/main/java/org/apache/httpcomponents/maven/plugin/notice/NoticeMojo.java
Date Thu, 11 Nov 2010 10:32:31 GMT
Author: olegk
Date: Thu Nov 11 10:32:31 2010
New Revision: 1033873

URL: http://svn.apache.org/viewvc?rev=1033873&view=rev
Log:
Made the project title and copyright holder entries in NOTICE configurable

Modified:
    httpcomponents/maven-notice-plugin/trunk/src/main/java/org/apache/httpcomponents/maven/plugin/notice/NoticeMojo.java

Modified: httpcomponents/maven-notice-plugin/trunk/src/main/java/org/apache/httpcomponents/maven/plugin/notice/NoticeMojo.java
URL: http://svn.apache.org/viewvc/httpcomponents/maven-notice-plugin/trunk/src/main/java/org/apache/httpcomponents/maven/plugin/notice/NoticeMojo.java?rev=1033873&r1=1033872&r2=1033873&view=diff
==============================================================================
--- httpcomponents/maven-notice-plugin/trunk/src/main/java/org/apache/httpcomponents/maven/plugin/notice/NoticeMojo.java
(original)
+++ httpcomponents/maven-notice-plugin/trunk/src/main/java/org/apache/httpcomponents/maven/plugin/notice/NoticeMojo.java
Thu Nov 11 10:32:31 2010
@@ -71,6 +71,20 @@ public final class NoticeMojo extends Ab
      */
     private File directory;
 
+    /**
+     * The project title in NOTICE. Optional.
+     *
+     * @parameter expression="${projectTitle}"
+     */
+    private String projectTitle;
+
+    /**
+     * The copyright holder in NOTICE. Optional.
+     *
+     * @parameter expression="${copyrightHolder}"
+     */
+    private String copyrightHolder;
+
     public NoticeMojo() {
         super();
         this.project = new MavenProject();
@@ -153,7 +167,10 @@ public final class NoticeMojo extends Ab
             BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(
                     new FileOutputStream(out), UTF_8));
             try {
-                writer.write("Apache HttpComponent ");
+                if (this.projectTitle != null) {
+                    writer.write(this.projectTitle);
+                    writer.write(" ");
+                }
                 writer.write(this.project.getName());
                 writer.write("\r\n");
                 writer.write("Copyright ");
@@ -165,7 +182,18 @@ public final class NoticeMojo extends Ab
                 Calendar cal = Calendar.getInstance();
                 String toYear = Integer.toString(cal.get(Calendar.YEAR));
                 writer.write(toYear);
-                writer.write(" The Apache Software Foundation\r\n");
+
+                String copyrightHolder = this.copyrightHolder;
+                if (copyrightHolder == null) {
+                    if (this.project.getOrganization() != null) {
+                        copyrightHolder = this.project.getOrganization().getName();
+                    }
+                }
+                if (copyrightHolder != null) {
+                    writer.write(" ");
+                    writer.write(copyrightHolder);
+                }
+                writer.write("\r\n");
 
                 int count = 0;
                 String line;



Mime
View raw message