apache / apache/maven-javadoc-plugin

Does not include maven-compiler-plugin's compileSourceRoot configuration

Open
#1,292 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
107
Forks
116
Avg merge
1d 10h
Merged PRs (30d)
16

Description

### Affected version

3.12.0

### Bug description

This happens with JDK 11, 17, & 21. This does not happen with Java 1.8

I have some classes in both of these folders (long story)
```

org.apache.maven.plugins
maven-compiler-plugin


${project.basedir}/src/main/java
${project.basedir}/src/main/java2

```

Running `mvn clean install` and compilation and all the tests work perfectly.

However, running `mvn clean install javadoc:jar` the javadoc plugin fails with:
```
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:3.12.0:jar (default-cli) on project example-project: MavenReportException: Error while generating Javadoc:
[ERROR] Exit code: 1
[ERROR] /home/user/example-project/src/main/java/com/atlassian/example/ExampleFactory.java:14: error: cannot find symbol
[ERROR] public class ExampleFactory extends GenericFactory {
[ERROR] ^
[ERROR] symbol: class ExampleClass
[ERROR] Command line was: /usr/lib/jvm/java-11-openjdk-amd64/bin/javadoc -J-Duser.language= -J-Duser.country= @options @packages
```

`ExampleFactory.java` lives in `/src/main/java`
`ExampleClass.java` lives in `/src/main/java2`

I can see from the `target` folder that all the classes are compiled and present, I would've presumed this would be enough to be on the classpath. Again, I'm not sure why there is a linking difference between JDK 1.8 and 11 either?

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the issue with the shown maven-compiler-plugin configuration by running `mvn clean install javadoc:jar` on JDK 11, 17, or 21. Start at the maven-javadoc-plugin handling for the javadoc:jar goal and its source-root or classpath inputs; done means ExampleFactory.java resolves ExampleClass.java from `/src/main/java2` and the Javadoc build succeeds.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.