Skip to content

Commit 945cf61

Browse files
authored
Fixes for Javadoc when building on Java 26 EA (helidon-io#11174)
* Move config metadata annotations to source retention to avoid strange warnings with javadoc on Java 26 * Fixed Grpc client blueprint javadoc reference to a valid method * Added Grpc javadoc link
1 parent cd3d383 commit 945cf61

9 files changed

Lines changed: 48 additions & 12 deletions

File tree

config/metadata/README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,19 +84,22 @@ To add meta configuration:
8484
<dependency>
8585
<groupId>io.helidon.config</groupId>
8686
<artifactId>helidon-config-metadata</artifactId>
87-
<optional>true</optional>
8887
</dependency>
8988
```
9089
2. Update the `module-info.java` by adding
9190
```java
92-
requires static io.helidon.config.metadata;
91+
requires io.helidon.config.metadata;
9392
```
9493
3. Annotate the configured class using `@Configured` - usually the builder class. If there is only a factory method, annotate the class containing the factory method
9594
4. Annotate builder methods using `@ConfiguredOption` - the type of the parameter will be used as type of the property, provides full customization using annotation properties
9695
5. In case a factory method is the only one available, annotate it with repeating `@ConfiguredOption` to list all annotations
9796
6. Look at existing examples if in doubt
9897
7. Check the output in `target/classes/META-INF/helidon` to see what was generated
9998

99+
NOTE: you can use `optional` dependency and `requires static` if you never use an enum constant from the metadata module.
100+
In case an enum constant (such as `Kind.LIST`) is used, the dependency must be transitive, and you must use `requires` without
101+
static
102+
100103
## Generate Config Reference Documentation
101104

102105
There are two ways to do this:

config/metadata/metadata/src/main/java/io/helidon/config/metadata/Configured.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2021, 2024 Oracle and/or its affiliates.
2+
* Copyright (c) 2021, 2026 Oracle and/or its affiliates.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -31,7 +31,7 @@
3131
* using an annotation processor.
3232
*/
3333
@Target(ElementType.TYPE)
34-
@Retention(RetentionPolicy.CLASS)
34+
@Retention(RetentionPolicy.SOURCE)
3535
public @interface Configured {
3636
/**
3737
* Whether this is a root configuration object.

config/metadata/metadata/src/main/java/io/helidon/config/metadata/ConfiguredOption.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2021, 2024 Oracle and/or its affiliates.
2+
* Copyright (c) 2021, 2026 Oracle and/or its affiliates.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -46,7 +46,7 @@
4646
*/
4747
@Target(ElementType.METHOD)
4848
@Inherited
49-
@Retention(RetentionPolicy.CLASS)
49+
@Retention(RetentionPolicy.SOURCE)
5050
@Repeatable(ConfiguredOptions.class)
5151
public @interface ConfiguredOption {
5252
/**

config/metadata/metadata/src/main/java/io/helidon/config/metadata/ConfiguredOptions.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2021, 2024 Oracle and/or its affiliates.
2+
* Copyright (c) 2021, 2026 Oracle and/or its affiliates.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -27,7 +27,7 @@
2727
*/
2828
@Target(ElementType.METHOD)
2929
@Inherited
30-
@Retention(RetentionPolicy.CLASS)
30+
@Retention(RetentionPolicy.SOURCE)
3131
public @interface ConfiguredOptions {
3232
/**
3333
* Group of options when used on a type.

config/metadata/metadata/src/main/java/io/helidon/config/metadata/ConfiguredValue.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2021, 2024 Oracle and/or its affiliates.
2+
* Copyright (c) 2021, 2026 Oracle and/or its affiliates.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -22,7 +22,7 @@
2222
/**
2323
* Can be used to define a list of possible values of an option.
2424
*/
25-
@Retention(RetentionPolicy.CLASS)
25+
@Retention(RetentionPolicy.SOURCE)
2626
public @interface ConfiguredValue {
2727
/**
2828
* Value of the option.

etc/javadoc/grpc-api/element-list

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
io.grpc
2+
io.grpc.auth
3+
io.grpc.binarylog.v1
4+
io.grpc.channelz.v1
5+
io.grpc.gcp.csm.observability
6+
io.grpc.grpclb
7+
io.grpc.health.v1
8+
io.grpc.inprocess
9+
io.grpc.lb.v1
10+
io.grpc.netty
11+
io.grpc.okhttp
12+
io.grpc.opentelemetry
13+
io.grpc.protobuf
14+
io.grpc.protobuf.lite
15+
io.grpc.protobuf.services
16+
io.grpc.reflection.v1
17+
io.grpc.reflection.v1alpha
18+
io.grpc.services
19+
io.grpc.servlet
20+
io.grpc.servlet.jakarta
21+
io.grpc.stub
22+
io.grpc.stub.annotations
23+
io.grpc.testing
24+
io.grpc.util
25+
io.grpc.xds
26+
io.grpc.xds.orca

http/http/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
<groupId>io.helidon.config</groupId>
8181
<artifactId>helidon-config-metadata</artifactId>
8282
<optional>true</optional>
83+
<scope>provided</scope>
8384
</dependency>
8485
<dependency>
8586
<groupId>io.helidon.config</groupId>

pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@
200200
<javadoc.link.opentracing>https://static.javadoc.io/io.opentracing/opentracing-api/${version.lib.opentracing}</javadoc.link.opentracing>
201201
<javadoc.link.prometheus>https://static.javadoc.io/io.prometheus/simpleclient/${version.lib.prometheus}</javadoc.link.prometheus>
202202
<javadoc.link.zipkin>https://static.javadoc.io/io.zipkin.reporter2/zipkin-reporter/2.12.3</javadoc.link.zipkin>
203+
<javadoc.link.grpc-api>https://grpc.github.io/grpc-java/javadoc</javadoc.link.grpc-api>
203204

204205
<!--suppress UnresolvedMavenProperty -->
205206
<javadoc.pkg.dir>${top.parent.basedir}/etc/javadoc</javadoc.pkg.dir>
@@ -452,6 +453,10 @@
452453
<url>${javadoc.link.oci-addons-oke-workload-identity}</url>
453454
<location>${javadoc.pkg.dir}/oci-addons-oke-workload-identity</location>
454455
</offlineLink>
456+
<offlineLink>
457+
<url>${javadoc.link.grpc-api}</url>
458+
<location>${javadoc.pkg.dir}/grpc-api</location>
459+
</offlineLink>
455460
</offlineLinks>
456461
<additionalJOptions combine.children="append">
457462
<additionalJOption>-J-Dhttp.agent=maven-javadoc-plugin</additionalJOption>
@@ -577,6 +582,7 @@
577582
<failOnWarning>true</failOnWarning>
578583
<ignoredDependencies>
579584
<dependency>io.helidon.common.features:helidon-common-features-api:*</dependency>
585+
<dependency>io.helidon.config:helidon-config-metadata:*</dependency>
580586
</ignoredDependencies>
581587
</configuration>
582588
</execution>

webclient/grpc/src/main/java/io/helidon/webclient/grpc/GrpcClientProtocolConfigBlueprint.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2024, 2025 Oracle and/or its affiliates.
2+
* Copyright (c) 2024, 2026 Oracle and/or its affiliates.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -102,7 +102,7 @@ default String type() {
102102
* {@link io.grpc.ClientCall.Listener#onClose(io.grpc.Status, io.grpc.Metadata)}.
103103
*
104104
* @return duration to wait for the next data request from listener
105-
* @see io.grpc.ClientCall.Listener#request(int)
105+
* @see io.grpc.ClientCall#request(int)
106106
*/
107107
@Option.Configured
108108
@Option.Default("PT1S")

0 commit comments

Comments
 (0)