[
https://issues.apache.org/jira/browse/SLING-10673?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17387852#comment-17387852
]
Konrad Windszus commented on SLING-10673:
-----------------------------------------
Both fall back to using the same property (maven.compiler.source), look at the
proposed PR in https://github.com/apache/sling-parent/pull/18
> Derive source for javadoc from property sling.java.version
> ----------------------------------------------------------
>
> Key: SLING-10673
> URL: https://issues.apache.org/jira/browse/SLING-10673
> Project: Sling
> Issue Type: Improvement
> Reporter: Oliver Lietz
> Assignee: Oliver Lietz
> Priority: Major
> Fix For: Parent 45
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> Javadoc build fails due to missing source setting when using newer Java
> features:
> {noformat}
> [INFO] --- maven-javadoc-plugin:3.3.0:javadoc (default-cli) @
> org.apache.sling.commons.messaging.mail ---
> [INFO] No previous run data found, generating javadoc.
> [INFO]
> Loading source files for package org.apache.sling.commons.messaging.mail...
> Loading source files for package
> org.apache.sling.commons.messaging.mail.internal...
> 4 errors
> [INFO]
> ------------------------------------------------------------------------
> [INFO] BUILD FAILURE
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 21.334 s
> [INFO] Finished at: 2021-07-26T21:04:04+02:00
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] Failed to execute goal
> org.apache.maven.plugins:maven-javadoc-plugin:3.3.0:javadoc (default-cli) on
> project org.apache.sling.commons.messaging.mail: An error has occurred in
> Javadoc report generation:
> [ERROR] Exit code: 1 -
> /.../org.apache.sling.commons.messaging.mail/src/main/java/org/apache/sling/commons/messaging/mail/MessageBuilder.java:408:
> error: type annotations are not supported in -source 7
> [ERROR] public abstract @NotNull MessageBuilder attachment(final byte
> @NotNull [] content, @NotNull final String type, @NotNull final String
> filename);
> [ERROR] ^
> [ERROR] (use -source 8 or higher to enable type annotations)
> [ERROR]
> /.../org.apache.sling.commons.messaging.mail/src/main/java/org/apache/sling/commons/messaging/mail/internal/SimpleMessageBuilder.java:332:
> error: type annotations are not supported in -source 7
> [ERROR] public @NotNull MessageBuilder attachment(final byte @NotNull []
> content, @NotNull final String type, @NotNull final String filename) {
> [ERROR] ^
> [ERROR] (use -source 8 or higher to enable type annotations)
> [ERROR]
> /.../org.apache.sling.commons.messaging.mail/src/main/java/org/apache/sling/commons/messaging/mail/internal/SimpleMailService.java:170:
> error: lambda expressions are not supported in -source 7
> [ERROR] return CompletableFuture.runAsync(() -> send(message),
> threadPool::submit);
> [ERROR] ^
> [ERROR] (use -source 8 or higher to enable lambda expressions)
> [ERROR]
> /.../org.apache.sling.commons.messaging.mail/src/main/java/org/apache/sling/commons/messaging/mail/internal/SimpleMailService.java:170:
> error: method references are not supported in -source 7
> [ERROR] return CompletableFuture.runAsync(() -> send(message),
> threadPool::submit);
> [ERROR]
> ^
> [ERROR] (use -source 8 or higher to enable method references)
> [ERROR]
> [ERROR] Command line was:
> /usr/local/Cellar/openjdk@11/11.0.10/libexec/openjdk.jdk/Contents/Home/bin/javadoc
> @options @packages
> [ERROR]
> [ERROR] Refer to the generated Javadoc files in
> '/.../org.apache.sling.commons.messaging.mail/target/site/apidocs' dir.
> [ERROR]
> [ERROR] -> [Help 1]
> [ERROR]
> [ERROR] To see the full stack trace of the errors, re-run Maven with the -e
> switch.
> [ERROR] Re-run Maven using the -X switch to enable full debug logging.
> [ERROR]
> [ERROR] For more information about the errors and possible solutions, please
> read the following articles:
> [ERROR] [Help 1]
> http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
> {noformat}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)