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

plugin should not flag all 'provided' scope dependencies as errors #9

Open
hgschmie opened this issue Feb 14, 2018 · 3 comments
Open

Comments

@hgschmie
Copy link

When using google auto (https://github.com/google/auto/tree/master/value), the presto maven plugin flags it with:

[ERROR] Failed to execute goal com.facebook.presto:presto-maven-plugin:0.3:check-spi-dependencies (default-check-spi-dependencies) on project owl-presto-connector:
[ERROR]
[ERROR] Presto plugin dependency com.google.auto.value:auto-value must not have scope 'provided'. It is not part of the SPI and will not be available at runtime.
[ERROR] -> [Help 1]
[ERROR]

Google auto value is an annotation processor that executes at compile time and is not needed at run time. Presto should not flag this dependency as erroneous.

Right now, I need to use version 0.4 of the plugin and add

<configuration
    <allowedProvidedDependencies>com.google.auto.value:auto-value</allowedProvidedDependencies>
</configuration>

to the plugin configuration.

@electrum
Copy link
Contributor

electrum commented Feb 14, 2018 via email

@hgschmie
Copy link
Author

I see that the purpose of this plugin seems to be "the other way around" than I thought: Not to ensure that SPI dependencies are scoped as "provided" and not "compile" but to circumvent the "cut'n'paste dependency, oops I got one that is provided scoped and did not notice). So you want to enforce to only ever the SPI deps are in provide scope, nothing else.

How about introducing a whitelist and add a couple of well known deps? The google auto family seems to be prime candidates. E.g., we are starting to put pressure on teams at $dayjob to not write their own value classes anymore but use AutoValue exclusively. I am planning to use it for all the handle classes in my connector and while the 'allowedProvidedDependencies' config is a workable compromise, it feels kludgy.

@electrum
Copy link
Contributor

The maven-compiler-plugin now has <annotationProcessorPaths> which might be what you want for the AutoValue.

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

No branches or pull requests

2 participants