Spring Boot Javadoc is now provided under https://docs.spring.io/spring-boot/<version>/api/java. The version number can be in the format major.minor.patch or major.minor. In both cases, we can issue a redirect which can completely remove the version number.
E.g. If we have released docs for Spring Boot 3.3 and 3.4 we get the following redirects:
https://docs.spring.io/spring-boot/3.3.1/api/java -> https://docs.spring.io/spring-boot/3.3/api/java
https://docs.spring.io/spring-boot/3.4.1/api/java -> https://docs.spring.io/spring-boot/api/java
https://docs.spring.io/spring-boot/3.4/api/java -> https://docs.spring.io/spring-boot/api/java
The last two are problematic because the version has completely disappeared. When Spring Boot 3.5 is released all the links will start to point to the new version.
Ideally we want a way to build javadoc so that the redirects are not actually used in the generated HTML. We'd like the full https://docs.spring.io/spring-boot/3.3.1/api/java URL to remain in the HTML and the redirect to only happen when the user clicks the link.
Comment From: philwebb
/cc @rwinch @odrotbohm
Comment From: odrotbohm
Just for reference: the /java and /api path segments seem to have mixed up positions, i.e., it would need to be /api/java instead of /java/api.
Comment From: philwebb
It looks like Maven is actually resolving the redirects. The javadoc command line tool doesn't change them. See this AbstractJavadocMojo method
Comment From: philwebb
@odrotbohm @rwinch,
I've been looking into this today and I'm not really sure what the best option is.
We could raise an issue with the Maven folks to see if they would be willing to add an option to disable followLinks for certain URLs. That's likely to take some time. I guess we could fork the javadoc plugin in the meantime.
The other option I'm thinking about is some kind of magic permalink URL that doesn't redirect. I think we could do that with a mod_rewrite rule. For example https://docs.spring.io/spring-boot/~3.4/api/java.
Any thoughts?
Comment From: philwebb
See https://issues.apache.org/jira/projects/MJAVADOC/issues/MJAVADOC-796
Comment From: michael-o
The redirect logic in Maven Javadoc Plugin is completely illdesigned. I'll split the fix in two stages. Help would be appreciated.
Comment From: philwebb
@rwinch has done some testing and this issue does indeed seem to be Maven only. Given that a fix is on the way, I don't think we should implement a pinning solution just for Spring Boot (although we should still consider it portfolio wide).
I'm going to close this one since I don't think there's much we can do in Spring Boot itself. The links may be "wrong" for a while, but hopefully a Maven Javadoc Plugin will be released before Spring Boot 3.4 which is when we'll really have a problem.