-
Notifications
You must be signed in to change notification settings - Fork 34
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 to silently ignore signatures if the class is not found #164
Conversation
…multi-module builds with common signatures). The old setting failOnUnresolvableSignatures was deprecated in favour of ignoreSignaturesOfMissingClasses. This closes #83
@@ -170,6 +174,9 @@ private void addSignature(final String line, final String defaultMessage, final | |||
try { | |||
c = lookup.getClassFromClassLoader(clazz); | |||
} catch (ClassNotFoundException cnfe) { | |||
if (this.ignoreSignaturesOfMissingClasses) { |
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.
This is the main point doing the magic!
…-apis into dev/issue83-milestone3.0
Hi @uschindler . We found that after replacing the |
Hi @asdf2014, ignoreSignaturesOfMissingClasses only ignores missing classes, but failOnUnresolvableSignatures ignores any wrongly written signature (but it is deprecated now). ignoreSignaturesOfMissingClasses works well when you have a subproject where a dependency is missing and you still want to use the same signatures file. In that case it just ignores all signatures where the class was not found. This should work also for shaded jars. Do you have a simple example or maybe can you tell me how to trigger that after checking out Druid? |
Ah now I understand the problem: [2022-01-15 05:49:23] [build-stdout] [2022-01-15 05:49:23] [autobuild] [ERROR] Failed to execute goal de.thetaphi:forbiddenapis:3.1:check (compile) on project opentelemetry-emitter: Parsing signatures failed: Method not found while parsing signature: com.google.common.util.concurrent.MoreExecutors#sameThreadExecutor() -> [Help 1] So the class is there, but the method is missing (because it is another version of Google Guava). This of course fails. The idea behind the ignoreSignaturesOfMissingClasses is to just ignore signatures where class is missing. But this is not the case here. The old setting was deprecated because it makes parsing signatures files a bit errorprone: If you have a typo in signatures file it won't fail the build. |
(e.g., multi-module builds with common signatures). The old setting failOnUnresolvableSignatures was deprecated in favour of ignoreSignaturesOfMissingClasses. This closes #83