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

[BEAM-2080]: Add a custom enforcer rule to check for banned classes. #2688

Closed
wants to merge 1 commit into from

Conversation

vikkyrk
Copy link
Contributor

@vikkyrk vikkyrk commented Apr 25, 2017

Be sure to do all of the following to help us incorporate your contribution
quickly and easily:

  • Make sure the PR title is formatted like:
    [BEAM-<Jira issue #>] Description of pull request
  • Make sure tests pass via mvn clean verify. (Even better, enable
    Travis-CI on your fork and ensure the whole test matrix passes).
  • Replace <Jira issue #> in the title with the actual Jira issue
    number, if there is one.
  • If this contribution is large, please file an Apache
    Individual Contributor License Agreement.

  • Add a custom rule to catch banned classes which can be specified using full path like org/apache/beam/Foo.class or using wildcards like org/apache/maven/**
  • Disable enforcer plugin in parent pom to avoid circular dependency issues with the custom rule
  • Move enforcer executions to pluginManagement and explicitly include them in sdks, examples and runners.

@vikkyrk
Copy link
Contributor Author

vikkyrk commented Apr 25, 2017

R: @davorbonaci . Feel free to add other maven experts in the team for review if needed.

@jbonofre
Copy link
Member

Thanks for the contribution ! Can you provide a quick abstract about the enforcer rule ?

@vikkyrk
Copy link
Contributor Author

vikkyrk commented Apr 27, 2017

@jbonofre The enforcer rule that I have added in this PR basically looks at all the classes within the artifacts generated by Beam (like sdks-core-*.jar, examples-*.jar etc.) and makes sure that we do not included unintended classes like com.google.guava or org.apache.maven etc. (configurable from the pom file). This is particularly useful for when using shade plugin to build a uber bundled jar but accidentally forget to shade libraries like guava.

@vikkyrk
Copy link
Contributor Author

vikkyrk commented May 10, 2017

Retest this please

@vikkyrk
Copy link
Contributor Author

vikkyrk commented May 11, 2017

Retest this please

@vikkyrk vikkyrk force-pushed the mvn_enforcer branch 2 times, most recently from 7728f07 to 4f2137c Compare May 12, 2017 01:35
@coveralls
Copy link

Coverage Status

Coverage increased (+0.007%) to 70.2% when pulling 827c6e4 on vikkyrk:mvn_enforcer into 13c06bf on apache:master.

@kennknowles
Copy link
Member

Since development here, we've started migrating to Gradle. This same functionality might be handy in a Gradle task of some sort. Are you planning on working on this any more?

@stale
Copy link

stale bot commented Jun 7, 2018

This pull request has been marked as stale due to 60 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@beam.apache.org list. Thank you for your contributions.

@stale stale bot added the wontfix label Jun 7, 2018
@kennknowles kennknowles added stale and removed wontfix labels Jun 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants