Skip to content

Commit

Permalink
Error when generating Javadoc due to old JDK7 compiler version
Browse files Browse the repository at this point in the history
The javadoc goal fails since we are trying to create Javadoc for JDK7 while the code has language features of JDK8.
```
mvn org.apache.maven.plugins:maven-javadoc-plugin:javadoc -Prelease
```
There are various errors such as the one shown below.
```
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:3.7.0:javadoc (default-cli) on project xtable-api: An error has occurred in Javadoc report generation:
[ERROR] Exit code: 1
[ERROR] /home/stamatis/Projects/Apache/incubator-xtable/xtable-api/src/main/java/org/apache/xtable/spi/sync/TableFormatSync.java:74: error: lambda expressions are not supported in -source 1.7
[ERROR]                 target -> target.syncFilesForSnapshot(snapshot.getPartitionedDataFiles()),
[ERROR]                        ^
[ERROR]   (use -source 8 or higher to enable lambda expressions)
```

The Apache parent pom sets the `maven.compiler.source` and `maven.compiler.target` to (JDK) 7 and that is being picked up by various plugins including the maven-javadoc-plugin leading to the error below.

1. Override compiler's `target` (and implicitly `source`) property to use JDK 8.
2. Remove explicit `release` configuration from maven-compiler-plugin since it is set by the Apache parent pom.
  • Loading branch information
zabetak authored and vinishjail97 committed Aug 16, 2024
1 parent 15cc0f8 commit d44d9f6
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
</modules>

<properties>
<java.version>8</java.version>
<maven.compiler.target>8</maven.compiler.target>
<avro.version>1.11.3</avro.version>
<log4j.version>2.22.0</log4j.version>
<junit.version>5.9.0</junit.version>
Expand Down Expand Up @@ -605,9 +605,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<release>${java.version}</release>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down

0 comments on commit d44d9f6

Please sign in to comment.