-
Notifications
You must be signed in to change notification settings - Fork 39
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
Implement workaround for MCOMPILER-503 #149
Implement workaround for MCOMPILER-503 #149
Conversation
4f1d397
to
716b003
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rebased and added a commit. Will approve once we've updated the ticket reference.
pom.xml
Outdated
<!-- This is a dependency of some Error Prone | ||
plugins, but for licensing reasons it is not | ||
packaged with the artifact. --> | ||
<path> | ||
<groupId>com.google.code.findbugs</groupId> | ||
<artifactId>jFormatString</artifactId> | ||
<version>${version.findbugs-format-string}</version> | ||
</path> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems we don't need this anymore; let's drop it :)
pom.xml
Outdated
<path> | ||
<groupId>${groupId.error-prone}</groupId> | ||
<artifactId>error_prone_annotations</artifactId> | ||
<version>${version.error-prone}</version> | ||
</path> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can omit this one now.
pom.xml
Outdated
<!-- XXX: MCOMPILER-XXX: The annotation processor's | ||
dependency resolution results in a highly unintuitive | ||
classpath. We can work around this by listing all | ||
dependencies here, if possible, to be able to control | ||
the resolution order. --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<!-- XXX: MCOMPILER-XXX: The annotation processor's | |
dependency resolution results in a highly unintuitive | |
classpath. We can work around this by listing all | |
dependencies here, if possible, to be able to control | |
the resolution order. --> | |
<!-- XXX: MCOMPILER-YYY: The plugin contructs a highly | |
unintuitive annotation processor classpath, in which | |
some indirect dependencies take precedence over | |
explicitly defined dependencies. This can largely be | |
mitigated through careful ordering of the dependencies, | |
but this prevents (where relevant) declaring these | |
dependencies as part of their corresponding Maven | |
profile. --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for looking into this and opening a ticket upstream (soon) 🙏 I got one question before ✔️
Suggested commit message:
Order `annotationProcessorPaths` for `maven-compiler-plugin` (#149)
To circumvent an issue in which indirect dependencies take precedence over
explicitly defined dependency on the annotation processor's classpath.
<groupId>org.mockito</groupId> | ||
<artifactId>mockito-errorprone</artifactId> | ||
<version>${version.mockito}</version> | ||
</path> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So to my understanding, we just need to have error_prone_core
entry before auto-service
to workaround the compiler issues. Does this also hold for the other artifacts included here? Asking this because now I think some build checks (from guava
, nopen
, nullaway
) will still happen even though verification.skip
is provided. Otherwise, reading the comment, I believe these could just stay in said profile.
I assume error-prone
is still not enabled when providing verification.skip
as configured in the error-prone
profile, so that is nice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
guava-beta-checker
, nopen-checker
, nullaway
, errorprone-slf4j
and mockito-errorprone
are all Error Prone checks, so without the error-prone
profile their declaration is a no-op (and thus they're not active with -Dverification.skip
).
It's true that likely it's safe to keep them in their original location, but this way we have a clearer control over the annotation classpath. The logic is now: declare centrally unless that's really not possible (which applies to the two other annotationProcessorPaths
declarations).
We plan to simply revert this PR once the issue is fixed in maven-compiler-plugin
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tnx for the suggested commit message! I might tweak it a bit when approving :)
<groupId>org.mockito</groupId> | ||
<artifactId>mockito-errorprone</artifactId> | ||
<version>${version.mockito}</version> | ||
</path> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
guava-beta-checker
, nopen-checker
, nullaway
, errorprone-slf4j
and mockito-errorprone
are all Error Prone checks, so without the error-prone
profile their declaration is a no-op (and thus they're not active with -Dverification.skip
).
It's true that likely it's safe to keep them in their original location, but this way we have a clearer control over the annotation classpath. The logic is now: declare centrally unless that's really not possible (which applies to the two other annotationProcessorPaths
declarations).
We plan to simply revert this PR once the issue is fixed in maven-compiler-plugin
.
716b003
to
0f28fc0
Compare
So the ticket is there now: https://issues.apache.org/jira/browse/MCOMPILER-503. |
annotationProcessorPaths
annotationProcessorPaths
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternative suggested commit message:
Implement workaround for MCOMPILER-503 (#149)
By moving around some annotation processor classpath entries we ensure that the
`maven-compiler-plugin` uses the appropriate version of Error Prone.
See https://issues.apache.org/jira/browse/MCOMPILER-503
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternative suggested commit message LGTM. Thanks for the explanation @Stephan202 and @rickie for creating the issue upstream! 🚀
annotationProcessorPaths
Currently used
MCOMIPLER-XXX
as we first need to create the ticket, that is a WIP.