This is an automated email from the ASF dual-hosted git repository. gboue pushed a commit to branch MJAVADOC-528 in repository https://gitbox.apache.org/repos/asf/maven-javadoc-plugin.git
commit b651443bba06fdf469b730024489c3f02629e50c Author: dedabob <[email protected]> AuthorDate: Wed Aug 15 15:09:58 2018 +0200 [MJAVADOC-528] Invalid 'expires' attribute This closes #5. --- src/it/projects/MJAVADOC-528/invoker.properties | 18 +++++++ src/it/projects/MJAVADOC-528/pom.xml | 55 ++++++++++++++++++++++ .../src/main/java/foo/bar/MyClass.java | 24 ++++++++++ src/it/projects/MJAVADOC-528/verify.groovy | 21 +++++++++ .../apache/maven/plugins/javadoc/JavadocUtil.java | 3 ++ 5 files changed, 121 insertions(+) diff --git a/src/it/projects/MJAVADOC-528/invoker.properties b/src/it/projects/MJAVADOC-528/invoker.properties new file mode 100644 index 0000000..a4e250d --- /dev/null +++ b/src/it/projects/MJAVADOC-528/invoker.properties @@ -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 diff --git a/src/it/projects/MJAVADOC-528/pom.xml b/src/it/projects/MJAVADOC-528/pom.xml new file mode 100644 index 0000000..6ee3712 --- /dev/null +++ b/src/it/projects/MJAVADOC-528/pom.xml @@ -0,0 +1,55 @@ +<?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-528</artifactId> + <version>1.0-SNAPSHOT</version> + + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + </properties> + + <build> + <pluginManagement> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-javadoc-plugin</artifactId> + <version>@pom.version@</version> + <configuration> + <detectLinks>true</detectLinks> + </configuration> + </plugin> + </plugins> + </pluginManagement> + </build> + + <dependencies> + <dependency> + <groupId>com.google.code.gson</groupId> + <artifactId>gson</artifactId> + <version>2.5</version> + </dependency> + </dependencies> +</project> diff --git a/src/it/projects/MJAVADOC-528/src/main/java/foo/bar/MyClass.java b/src/it/projects/MJAVADOC-528/src/main/java/foo/bar/MyClass.java new file mode 100644 index 0000000..e5960e3 --- /dev/null +++ b/src/it/projects/MJAVADOC-528/src/main/java/foo/bar/MyClass.java @@ -0,0 +1,24 @@ +package foo.bar; + +/* + * 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. + */ + +public class MyClass +{ +} diff --git a/src/it/projects/MJAVADOC-528/verify.groovy b/src/it/projects/MJAVADOC-528/verify.groovy new file mode 100644 index 0000000..66dfbd1 --- /dev/null +++ b/src/it/projects/MJAVADOC-528/verify.groovy @@ -0,0 +1,21 @@ +/* + * 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. + */ + +File log = new File( basedir, 'build.log' ) +assert !( log.text =~ /.*Invalid cookie header:[^\r\n]+\. Invalid 'expires' attribute:.*/ ) diff --git a/src/main/java/org/apache/maven/plugins/javadoc/JavadocUtil.java b/src/main/java/org/apache/maven/plugins/javadoc/JavadocUtil.java index c7467ae..da72cac 100644 --- a/src/main/java/org/apache/maven/plugins/javadoc/JavadocUtil.java +++ b/src/main/java/org/apache/maven/plugins/javadoc/JavadocUtil.java @@ -29,6 +29,7 @@ import org.apache.http.auth.UsernamePasswordCredentials; import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpGet; import org.apache.http.client.params.ClientPNames; +import org.apache.http.client.params.CookiePolicy; import org.apache.http.client.protocol.HttpClientContext; import org.apache.http.conn.params.ConnRoutePNames; import org.apache.http.impl.client.DefaultHttpClient; @@ -1822,6 +1823,8 @@ public class JavadocUtil httpClient.getParams().setParameter( ClientPNames.DEFAULT_HEADERS, Arrays.asList( new BasicHeader( HttpHeaders.ACCEPT, "*/*" ) ) ); + httpClient.getParams().setParameter( ClientPNames.COOKIE_POLICY, CookiePolicy.BROWSER_COMPATIBILITY ); + if ( settings != null && settings.getActiveProxy() != null ) { Proxy activeProxy = settings.getActiveProxy();
