I am generating a project site with
mvn site
Linkcheck is activated as a reporting plugin
<reporting>
<plugins>
(...)
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-linkcheck-plugin</artifactId>
<version>1.2</version>
</plugin>
</plugins>
</reporting>
The code is in Java.
The comment header of class files contains links to StackOverflow questions, for example
/**
* Example written by Bruno Lowagie in answer to:
* https://stackoverflow.com/questions/26853894/continue-field-output-on-second-page-with-itextsharp
*/
During the link checking phase of the site generation, I get warnings like these:
[ WARN] Cookie rejected: "$Version=0; __cfduid=dab443ca4b7fc1de5130856b7401f83cb1455551507; $Path=/; $Domain=.stackoverflow.com". Illegal domain attribute ".stackoverflow.com". Domain of origin: "stackoverflow.com"
[ WARN] Cookie rejected: "$Version=0; logged_in=no; $Path=/; $Domain=.github.com". Illegal domain attribute ".github.com". Domain of origin: "github.com"
I already looked at some other SO questions about "Cookie rejected: Illegal domain attribute". According to this aswer, the issue is not at my end, it's StackOverflow and GitHub that are setting a cookie that it they aren't allowed to send and the underlying http library of maven-linkcheck-plugin
is telling me that. This behavior is exactly as specified by RFC 2109.
The linked question gives a workaround: set a cookie policy in httpclient
that essentially says, I don't care about bad cookies, gimme gimme gimme. I need tolerance for non-compliant servers, so I need to use the browser compatibility cookie spec as described in the cookie guide.
My question is: since I'm not working with httpclient
but with maven
, what do I put in my pom.xml
to get rid of these cookie warnings? I didn find anything useful in
- maven-linkcheck-plugin documentation
- Doxia LinkCheck documentation (the Maven plugin uses Doxia)
- This Doxia JIRA query is an interesting read as background information, but still no Maven solution