• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

maven-javadoc-plugin links to Java 7 instead of Java 8

 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have switched to Java 8 recently, but I found out today that Maven creates links to the Java 7 API instead of the Java 8 API. I have checked my system but all uses Java 8:
- JAVA_HOME point to my Java 8 JDK
- java -version returns 1.8.0_05

The relevant information from my POM:
I have also tried setting javadocVersion to 1.8 explicitly but it still creates links like http://docs.oracle.com/javase/7/docs/api/java/lang/Comparable.html?is-external=true instead of url=http://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html?is-external=true. Did I miss something in my POM, or is this (another) bug in Java 8's javadoc tool?
 
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The Maven javadoc:javadoc goal is supposed to default to the API link for the version of Java that's being run.

There are several configuration options that can adjust that, however. If all else fails, force the link using the "JavaAPILink" option (note that this is a properties element, allowing multiple URLs).

For further info: http://maven.apache.org/plugins/maven-javadoc-plugin/javadoc-mojo.html
 
Rob Spoor
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've read that page, and the javaApiLinks directive led me to the default Java API links. This is from the current version (I've checked the source), so it appears that version 2.9.1 simply has no support for Java 8.

I have tried to specify the javaApiLinks like the default links (using only Java 7 and 8), but api_1.8 didn't work...

Perhaps the only way for now is to disable automatic linking and manually specify the link. The problem with that is that the Java 8 javadoc doesn't support (external) links yet - it can find the classes if you point to the package-list file but then the package-list file becomes part of the URL, or it can't find the package-list file. See this post for more info.
 
Something about .... going for a swim. With this tiny ad ...
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic