Hello,
sorry if this is already explained somewhere, I did a quick search and found no relevant information.
I have started using lombok recently and I am fully satisfied except for one minor detail. I have a maven project, lombok version 1.16.2 and
lombok.accessors.chain=true in lombok.config.
Here is a simple class annotated with lombok annotations
@ToString(of = "id")
@EqualsAndHashCode(of = "id")
public class Flight {
/**
* Flight id.
* @param id new Flight id.
* @return Flight id
*/
@Getter @Setter protected long id;
}
Maven plugins are configured so javadoc and lombok cooperates well.
<plugin>
<groupId>org.projectlombok</groupId>
<artifactId>lombok-maven-plugin</artifactId>
<version>1.16.2.0</version>
<configuration>
<sourceDirectory>${project.basedir}/src/main/java</sourceDirectory>
<outputDirectory>${delombok.output}</outputDirectory>
<addOutputDirectory>false</addOutputDirectory>
</configuration>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>delombok</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9</version>
<configuration>
<sourcepath>${delombok.output}</sourcepath>
</configuration>
</plugin>
However a warning is produced on generating javadoc:
Javadoc Warnings
snip/Flight.java:73: warning: no @return
public Flight setId(final long id) {
^
I would assume that "@return this" would be generated to javadoc of Setters by delombok when using
accessors.chain to prevent this warning. Am I doing something wrong and this can be configured somehow somewhere? Or is this an oversight or still work in progress (as Accessors are still experimental)?
Thanks!