Not sure why Maven Javadoc Plugin reports:
[ERROR] /project/src/main/a/b/SomeClass.java:3: error: package com.x does not exist
[ERROR] import com.x.y;
The plugin related part in pom.xml
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
<configuration>
<encoding>UTF-8</encoding>
<sourcepath>${project.basedir}/src/main/java</sourcepath>
<excludePackageNames>com.x.*</excludePackageNames>
<dependencySourceExcludes>com.x.*</dependencySourceExcludes>
</configuration>
</plugin>
As can be seen from the above code I tried to include the project sources that I want to be processed by JavaDoc in <sourcepath>
and exclude the problematic package
The problem may be caused by the fact that package com.x.y
is contained within an external jar which is added to the project in the following configuration:
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.3</version>
<executions>
<execution>
<phase>generate-sources</phase>
<configuration>
<tasks>
<echo>Unpack JAR archive with JNI interface</echo>
<unjar src="${project.basedir}/x/lib63.jar" dest="${project.build.directory}/classes">
<patternset>
<include name="**/*.class"/>
</patternset>
</unjar>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
How to ignore those import errors?
I don't use the plugin on daily basis so I may not understand all the nuances. But I don't understand why it even tries to analyze the imports. Shouldn't it just analyze my sources and create html files based on javadoc comments?
P.S. Without javadoc plugin the build is successful