Author: bentmann
Date: Sat Aug  2 01:33:50 2008
New Revision: 681940

URL: http://svn.apache.org/viewvc?rev=681940&view=rev
Log:
[MJAVADOC-206] use ${project.reporting.outputEncoding} as default value for 
"docencoding" and "charset" parameter and default to UTF-8

o Revised handling of default value for charset to fallback to docencoding for 
consistency of HTML charset with actual file encoding

Added:
    maven/plugins/trunk/maven-javadoc-plugin/src/it/MJAVADOC-206/docencoding/
    
maven/plugins/trunk/maven-javadoc-plugin/src/it/MJAVADOC-206/docencoding/pom.xml
   (with props)
    
maven/plugins/trunk/maven-javadoc-plugin/src/it/MJAVADOC-206/docencoding/src/
    
maven/plugins/trunk/maven-javadoc-plugin/src/it/MJAVADOC-206/docencoding/src/main/
    
maven/plugins/trunk/maven-javadoc-plugin/src/it/MJAVADOC-206/docencoding/src/main/java/
    
maven/plugins/trunk/maven-javadoc-plugin/src/it/MJAVADOC-206/docencoding/src/main/java/Test.java
   (with props)
Modified:
    
maven/plugins/trunk/maven-javadoc-plugin/src/it/MJAVADOC-206/encoding/pom.xml
    maven/plugins/trunk/maven-javadoc-plugin/src/it/MJAVADOC-206/pom.xml
    maven/plugins/trunk/maven-javadoc-plugin/src/it/MJAVADOC-206/verify.bsh
    
maven/plugins/trunk/maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/AbstractJavadocMojo.java
    
maven/plugins/trunk/maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/JavadocUtil.java

Added: 
maven/plugins/trunk/maven-javadoc-plugin/src/it/MJAVADOC-206/docencoding/pom.xml
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/it/MJAVADOC-206/docencoding/pom.xml?rev=681940&view=auto
==============================================================================
--- 
maven/plugins/trunk/maven-javadoc-plugin/src/it/MJAVADOC-206/docencoding/pom.xml
 (added)
+++ 
maven/plugins/trunk/maven-javadoc-plugin/src/it/MJAVADOC-206/docencoding/pom.xml
 Sat Aug  2 01:33:50 2008
@@ -0,0 +1,47 @@
+<!--
+  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>
+  <parent>
+    <groupId>test</groupId>
+    <artifactId>MJAVADOC-206</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <artifactId>docencoding</artifactId>
+  <packaging>jar</packaging>
+
+  <name>docencoding set via plugin parameter</name>
+  <description>charset should default to docencoding</description>
+
+  <properties>
+    
<project.reporting.outputEncoding>ISO-8859-1</project.reporting.outputEncoding>
+  </properties>
+
+  <build>
+    <plugins>
+       <plugin>
+               <artifactId>maven-javadoc-plugin</artifactId>
+               <configuration>
+                 <docencoding>UTF-16</docencoding>
+               </configuration>
+       </plugin>
+    </plugins>
+  </build>
+</project>

Propchange: 
maven/plugins/trunk/maven-javadoc-plugin/src/it/MJAVADOC-206/docencoding/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/plugins/trunk/maven-javadoc-plugin/src/it/MJAVADOC-206/docencoding/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: 
maven/plugins/trunk/maven-javadoc-plugin/src/it/MJAVADOC-206/docencoding/src/main/java/Test.java
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/it/MJAVADOC-206/docencoding/src/main/java/Test.java?rev=681940&view=auto
==============================================================================
--- 
maven/plugins/trunk/maven-javadoc-plugin/src/it/MJAVADOC-206/docencoding/src/main/java/Test.java
 (added)
+++ 
maven/plugins/trunk/maven-javadoc-plugin/src/it/MJAVADOC-206/docencoding/src/main/java/Test.java
 Sat Aug  2 01:33:50 2008
@@ -0,0 +1,28 @@
+/*
+ * 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.
+ */
+
+/**
+ * Sample class with non-ascii characters:
+ * {non-ascii chars delimiter}french: äëïöüàèìòù, greek: 
αβγδεζηθ, japanese: あいうえお{non-ascii chars delimiter}
+ *
+ * @author Hervé Boutemy
+ */
+public class Test
+{
+}

Propchange: 
maven/plugins/trunk/maven-javadoc-plugin/src/it/MJAVADOC-206/docencoding/src/main/java/Test.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/plugins/trunk/maven-javadoc-plugin/src/it/MJAVADOC-206/docencoding/src/main/java/Test.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: 
maven/plugins/trunk/maven-javadoc-plugin/src/it/MJAVADOC-206/encoding/pom.xml
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/it/MJAVADOC-206/encoding/pom.xml?rev=681940&r1=681939&r2=681940&view=diff
==============================================================================
--- 
maven/plugins/trunk/maven-javadoc-plugin/src/it/MJAVADOC-206/encoding/pom.xml 
(original)
+++ 
maven/plugins/trunk/maven-javadoc-plugin/src/it/MJAVADOC-206/encoding/pom.xml 
Sat Aug  2 01:33:50 2008
@@ -27,7 +27,7 @@
   <artifactId>encoding</artifactId>
   <packaging>jar</packaging>
 
-  <name>encoding set</name>
+  <name>docencoding set via global property</name>
   <description>project.reporting.outputEncoding should be used</description>
 
   <properties>

Modified: maven/plugins/trunk/maven-javadoc-plugin/src/it/MJAVADOC-206/pom.xml
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/it/MJAVADOC-206/pom.xml?rev=681940&r1=681939&r2=681940&view=diff
==============================================================================
--- maven/plugins/trunk/maven-javadoc-plugin/src/it/MJAVADOC-206/pom.xml 
(original)
+++ maven/plugins/trunk/maven-javadoc-plugin/src/it/MJAVADOC-206/pom.xml Sat 
Aug  2 01:33:50 2008
@@ -27,6 +27,7 @@
   <modules>
     <module>default</module>
     <module>encoding</module>
+    <module>docencoding</module>
   </modules>
   <build>
     <pluginManagement>

Modified: 
maven/plugins/trunk/maven-javadoc-plugin/src/it/MJAVADOC-206/verify.bsh
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/it/MJAVADOC-206/verify.bsh?rev=681940&r1=681939&r2=681940&view=diff
==============================================================================
--- maven/plugins/trunk/maven-javadoc-plugin/src/it/MJAVADOC-206/verify.bsh 
(original)
+++ maven/plugins/trunk/maven-javadoc-plugin/src/it/MJAVADOC-206/verify.bsh Sat 
Aug  2 01:33:50 2008
@@ -49,7 +49,7 @@
 
 try
 {
-    result = checkEncoding( "default", "UTF-8") && checkEncoding( "encoding", 
"UTF-16" );
+    result = checkEncoding( "default", "UTF-8") && checkEncoding( "encoding", 
"UTF-16" ) && checkEncoding( "docencoding", "UTF-16" );
 }
 catch( IOException e )
 {

Modified: 
maven/plugins/trunk/maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/AbstractJavadocMojo.java
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/AbstractJavadocMojo.java?rev=681940&r1=681939&r2=681940&view=diff
==============================================================================
--- 
maven/plugins/trunk/maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/AbstractJavadocMojo.java
 (original)
+++ 
maven/plugins/trunk/maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/AbstractJavadocMojo.java
 Sat Aug  2 01:33:50 2008
@@ -734,12 +734,12 @@
     private String bottom;
 
     /**
-     * Specifies the HTML character set for this document.
+     * Specifies the HTML character set for this document. Defaults to the 
value specified by <code>docencoding</code>.
      * <br/>
      * See <a 
href="http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/javadoc.html#charset";>charset</a>.
      * <br/>
      *
-     * @parameter expression="${charset}" 
default-value="${project.reporting.outputEncoding}"
+     * @parameter expression="${charset}"
      */
     private String charset;
 
@@ -1389,11 +1389,11 @@
     }
 
     /**
-     * @return the charset attribute or <code>UTF-8</code> if <code>null</code>
+     * @return the charset attribute or the value of [EMAIL PROTECTED] 
#getDocencoding()} if <code>null</code>
      */
     private String getCharset()
     {
-        return ( charset == null ) ? ReaderFactory.UTF_8 : charset;
+        return ( charset == null ) ? getDocencoding() : charset;
     }
 
     /**

Modified: 
maven/plugins/trunk/maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/JavadocUtil.java
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/JavadocUtil.java?rev=681940&r1=681939&r2=681940&view=diff
==============================================================================
--- 
maven/plugins/trunk/maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/JavadocUtil.java
 (original)
+++ 
maven/plugins/trunk/maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/JavadocUtil.java
 Sat Aug  2 01:33:50 2008
@@ -46,7 +46,6 @@
 import java.util.regex.Pattern;
 import java.util.regex.PatternSyntaxException;
 
-import org.apache.commons.lang.SystemUtils;
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.settings.Proxy;
 import org.apache.maven.settings.Settings;
@@ -148,7 +147,7 @@
     }
 
     /**
-     * Copy from [EMAIL PROTECTED] MavenProject#getCompileArtifacts()}
+     * Copy from [EMAIL PROTECTED] 
org.apache.maven.project.MavenProject#getCompileArtifacts()}
      * @param artifacts not null
      * @return list of compile artifacts with compile scope
      * @deprecated since 2.5, using [EMAIL PROTECTED] 
#getCompileArtifacts(Set, boolean)} instead of.
@@ -159,7 +158,7 @@
     }
 
     /**
-     * Copy from [EMAIL PROTECTED] MavenProject#getCompileArtifacts()}
+     * Copy from [EMAIL PROTECTED] 
org.apache.maven.project.MavenProject#getCompileArtifacts()}
      * @param artifacts not null
      * @param withTestScope flag to include or not the artifacts with test 
scope
      * @return list of compile artifacts with or without test scope.


Reply via email to