Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow annotation processors to be made available to tests when using Gradle #1380

Open
wilkinsona opened this issue Feb 23, 2023 · 2 comments

Comments

@wilkinsona
Copy link
Contributor

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.

@bclozel bclozel added this to the 0.20.0 milestone Apr 3, 2023
@prithvitewatia
Copy link
Contributor

@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'
}

@snicoll snicoll modified the milestones: 0.20.0, 0.20.1 Jul 7, 2023
@snicoll snicoll modified the milestones: 0.20.1, General Backlog Sep 8, 2023
@plat2eau
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants