Open wilkinsona opened 1 year ago
@wilkinsona do we need something like
dependencies {
compileOnly 'org.projectlombok:lombok:1.18.22'
annotationProcessor 'org.projectlombok:lombok:1.18.22'
testCompileOnly 'org.projectlombok:lombok:1.18.22'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.22'
}
As per Issue 1379 we don't need to add the annotation processors to both compileOnly
and annotationProcessor
. We can do the same for testCompileOnly
and testAnnotationProcessor
Gradle has more finely grained classpath separation than Maven, particularly for annotation processors. While generally a good thing, it makes it more cumbersome when you want to use an annotation processor in both your main code and in your tests. It would be useful if an annotation processor dependency could indicate that it should be available for use with test code as well as main code. I don't think we'd want to do this for all annotation processors (for example, I can see no need to use
spring-boot-configuration-processor
in tests) so I think it would need to be opt-in on a per-dependency basis. Lombok is one example of an annotation processor that may be useful in tests.