I am using Eclipse Oxygen, but this was also the issue in the Neon version. I have started new Maven Project and selected webapp-javaee7 archetype. After the creation of the project is done, pom.xml was configured like this:
<properties>
<endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
<version>7.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<compilerArguments>
<endorseddirs>${endorsed.dir}</endorseddirs>
</compilerArguments>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.3</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<outputDirectory>${endorsed.dir}</outputDirectory>
<silent>true</silent>
<artifactItems>
<artifactItem>
<groupId>javax</groupId>
<artifactId>javaee-endorsed-api</artifactId>
<version>7.0</version>
<type>jar</type>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
So, the javaee-endorsed-api-7.0.jar is added to the Endorsed libraries. As I understood from this post that jar file contains Annotations package javax.annotation.
I have imported package javax.annotation to some of my classes inside this project, and used some annotations. When I hover over some of these annotations I get the message: Note: This element neither has attached source nor attached Javadoc and hence no Javadoc could be found.
When I try to open "attached" Javadoc in the browser I get warning dialog stating: The documentation location for (annotation name) has not been configured. For elements from libraries specify the Javadoc location URL on properties page of the parent JAR ...\target\endorsed\javaee-endorsed-api-7.0.jar
.
It is not possible to attach source code or Javadoc to javaee-endorsed-api-7.0.jar.
When I make plain Java project and use javax.annotation package Javadocs are shown as expected.
How to solve this and make Eclipse show Javadocs for javax.annotation package within this Maven project I am working on?
Thanks.