Reputation: 5042
I am trying to run a maven javadoc command on SpringB oot @Configuration classes without warnings.
Currently, I have a very straightforward Spring Boot configuration class as follows:
/**
* This is Some Configuration. There is ome meaningful doc here.
*/
@Configuration
public class SomeConfiguration {
@Value("${my.host}")
private String host;
/**
* span exporter.
* This is used to send traces to the host.
* Some more meaningful doc here.
*
* @return the span exporter
*/
@Bean
public SpanExporter spanExporter() {
return OtlpGrpcSpanExporter.builder().setEndpoint(host).build();
}
}
and in my pom, to generate Javadoc, I have this:
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<outputDirectory>target/javadoc</outputDirectory>
<reportOutputDirectory>target/javadoc</reportOutputDirectory>
<javadocExecutable>${java.home}/bin/javadoc</javadocExecutable>
</configuration>
</plugin>
When running this command mvn clean install site -U javadoc:javadoc
I am always getting:
[WARNING] C:\Users\me\SomeConfiguration.java:13: warning: use of default constructor, which does not provide a comment
[WARNING] public class SomeConfiguration{
[WARNING] ^
How to fix this without bringing an entire constructor such as this below to the mist?
public class SomeConfiguration {
private String host;
public SomeConfiguration(@Value("${my.host}") String host) {
this.host = host;
}
Upvotes: 2
Views: 1570