Added: maven/plugins/trunk/maven-javadoc-plugin/src/it/projects/output-encoding/invoker.properties URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/it/projects/output-encoding/invoker.properties?rev=1814274&view=auto ============================================================================== --- maven/plugins/trunk/maven-javadoc-plugin/src/it/projects/output-encoding/invoker.properties (added) +++ maven/plugins/trunk/maven-javadoc-plugin/src/it/projects/output-encoding/invoker.properties Sat Nov 4 11:01:38 2017 @@ -0,0 +1,18 @@ +# 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. + +invoker.goals=clean javadoc:javadoc
Added: maven/plugins/trunk/maven-javadoc-plugin/src/it/projects/output-encoding/pom.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/it/projects/output-encoding/pom.xml?rev=1814274&view=auto ============================================================================== --- maven/plugins/trunk/maven-javadoc-plugin/src/it/projects/output-encoding/pom.xml (added) +++ maven/plugins/trunk/maven-javadoc-plugin/src/it/projects/output-encoding/pom.xml Sat Nov 4 11:01:38 2017 @@ -0,0 +1,57 @@ +<!-- + 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/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.plugins.maven-javadoc-plugin.it</groupId> + <artifactId>MJAVADOC-206</artifactId> + <version>1.0-SNAPSHOT</version> + <packaging>pom</packaging> + + <name>Maven Javadoc output encoding Test</name> + + <modules> + <module>default</module> + <module>encoding</module> + <module>docencoding</module> + </modules> + + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + </properties> + + <build> + <pluginManagement> + <plugins> + <plugin> + <artifactId>maven-javadoc-plugin</artifactId> + <version>@pom.version@</version> + <configuration> + <debug>true</debug> + </configuration> + </plugin> + <plugin> + <artifactId>maven-site-plugin</artifactId> + <version>@sitePluginVersion@</version> + </plugin> + </plugins> + </pluginManagement> + </build> +</project> \ No newline at end of file Added: maven/plugins/trunk/maven-javadoc-plugin/src/it/projects/output-encoding/verify.bsh URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/it/projects/output-encoding/verify.bsh?rev=1814274&view=auto ============================================================================== --- maven/plugins/trunk/maven-javadoc-plugin/src/it/projects/output-encoding/verify.bsh (added) +++ maven/plugins/trunk/maven-javadoc-plugin/src/it/projects/output-encoding/verify.bsh Sat Nov 4 11:01:38 2017 @@ -0,0 +1,63 @@ +/* + * 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 org.codehaus.plexus.util.*; + +boolean result = true; + +boolean checkEncoding( String module, String sourceEncoding, String reportingEncoding ) +{ + print( "module " + module + ", source encoding " + sourceEncoding + + ", expected reporting encoding " + reportingEncoding ); + + File source = new File( basedir, module + "/src/main/java/Test.java" ); + File javadoc = new File( basedir, module + "/target/site/apidocs/Test.html" ); + + String java = FileUtils.fileRead( source, sourceEncoding ); + String html = FileUtils.fileRead( javadoc, reportingEncoding ); + + if ( html.indexOf( "text/html; charset=" + reportingEncoding ) < 0 ) + { + System.err.println( "charset not specified in content-type of " + javadoc ); + return false; + } + + String javaChars = StringUtils.getNestedString( java, "{non-ascii chars delimiter}" ); + String htmlChars = StringUtils.getNestedString( html, "{non-ascii chars delimiter}" ); + + print( "javaChars = " + javaChars ); + print( "htmlChars = " + htmlChars ); + + return javaChars.equals( htmlChars ); +} + +try +{ + result = checkEncoding( "default", "ISO-8859-15", "UTF-8") + && checkEncoding( "encoding", "UTF-8", "UTF-16" ) + && checkEncoding( "docencoding", "UTF-8", "UTF-16" ); +} +catch( IOException e ) +{ + e.printStackTrace(); + result = false; +} + +return result; Added: maven/plugins/trunk/maven-javadoc-plugin/src/it/projects/site-failOnError/invoker.properties URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/it/projects/site-failOnError/invoker.properties?rev=1814274&view=auto ============================================================================== --- maven/plugins/trunk/maven-javadoc-plugin/src/it/projects/site-failOnError/invoker.properties (added) +++ maven/plugins/trunk/maven-javadoc-plugin/src/it/projects/site-failOnError/invoker.properties Sat Nov 4 11:01:38 2017 @@ -0,0 +1,18 @@ +# 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. + +invoker.goals=clean site Added: maven/plugins/trunk/maven-javadoc-plugin/src/it/projects/site-failOnError/pom.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/it/projects/site-failOnError/pom.xml?rev=1814274&view=auto ============================================================================== --- maven/plugins/trunk/maven-javadoc-plugin/src/it/projects/site-failOnError/pom.xml (added) +++ maven/plugins/trunk/maven-javadoc-plugin/src/it/projects/site-failOnError/pom.xml Sat Nov 4 11:01:38 2017 @@ -0,0 +1,85 @@ +<?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/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.apache.maven.plugins.maven-javadoc-plugin.it</groupId> + <artifactId>MJAVADOC-304</artifactId> + <packaging>jar</packaging> + <version>1.0-SNAPSHOT</version> + <name>MJAVADOC-304: failOnError=false in site</name> + + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + </properties> + + <build> + <pluginManagement> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-site-plugin</artifactId> + <version>@sitePluginVersion@</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-javadoc-plugin</artifactId> + <version>@pom.version@</version> + <configuration> + <failOnError>false</failOnError> + </configuration> + </plugin> + </plugins> + </pluginManagement> + </build> + + <reporting> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-javadoc-plugin</artifactId> + <version>@pom.version@</version> + <configuration> + <failOnError>false</failOnError> + </configuration> + <reportSets> + <reportSet> + <reports> + <report>javadoc</report> + </reports> + </reportSet> + </reportSets> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-project-info-reports-plugin</artifactId> + <version>2.9</version> + <reportSets> + <reportSet> + <reports> + <report>index</report> + </reports> + </reportSet> + </reportSets> + </plugin> + </plugins> + </reporting> +</project> Added: maven/plugins/trunk/maven-javadoc-plugin/src/it/projects/site-failOnError/src/main/java/App.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/it/projects/site-failOnError/src/main/java/App.java?rev=1814274&view=auto ============================================================================== --- maven/plugins/trunk/maven-javadoc-plugin/src/it/projects/site-failOnError/src/main/java/App.java (added) +++ maven/plugins/trunk/maven-javadoc-plugin/src/it/projects/site-failOnError/src/main/java/App.java Sat Nov 4 11:01:38 2017 @@ -0,0 +1,29 @@ +/* + * 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. + */ + +/** + * Hello world! + */ +class App +{ + public static void main( String[] args ) + { + System.out.println( "Hello World!" ); + } +} Modified: maven/plugins/trunk/maven-javadoc-plugin/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java?rev=1814274&r1=1814273&r2=1814274&view=diff ============================================================================== --- maven/plugins/trunk/maven-javadoc-plugin/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java (original) +++ maven/plugins/trunk/maven-javadoc-plugin/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java Sat Nov 4 11:01:38 2017 @@ -93,6 +93,7 @@ import org.apache.maven.plugins.javadoc. import org.apache.maven.project.MavenProject; import org.apache.maven.project.ProjectBuilder; import org.apache.maven.project.ProjectBuildingException; +import org.apache.maven.project.ProjectBuildingRequest; import org.apache.maven.reporting.MavenReportException; import org.apache.maven.settings.Proxy; import org.apache.maven.settings.Settings; @@ -1885,6 +1886,7 @@ public abstract class AbstractJavadocMoj public void execute() throws MojoExecutionException, MojoFailureException { + getLog().debug( "verify removed parameter" ); verifyRemovedParameter( "aggregator" ); verifyRemovedParameter( "proxyHost" ); verifyRemovedParameter( "proxyPort" ); @@ -2577,8 +2579,12 @@ public abstract class AbstractJavadocMoj sb.append( subProject.getArtifactId() ).append( ":" ); sb.append( subProject.getVersion() ).append( '\n' ); + ProjectBuildingRequest buildingRequest = session.getProjectBuildingRequest(); + buildingRequest = + buildingRequest.setRemoteRepositories( subProject.getRemoteArtifactRepositories() ); + for ( ArtifactResult artifactResult - : dependencyResolver.resolveDependencies( session.getProjectBuildingRequest(), + : dependencyResolver.resolveDependencies( buildingRequest, subProject.getDependencies(), null, dependencyFilter ) )