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

[build] Use absolute path to locate license and checkstyle plugin config #8918

Merged
merged 1 commit into from Dec 13, 2020

Conversation

lhotari
Copy link
Member

@lhotari lhotari commented Dec 11, 2020

Motivation

Fixes #8911, compiling a sub module individually in the sub module directory
Previously, the maven build failed if executed in other than the root directory if the license or checkstyle checks were run since
those plugins weren't able to find their configuration.

Modifications

  • use proposed solution of https://stackoverflow.com/a/37965143
    to set a property pulsar.basedir which contains the absolute path
    to the root directory

    • all other solutions don't seem to work universally in all projects,
      for example project.parent.basedir isn't available in the
      root project and not all projects necessarily have the root project
      as their parent project.
  • when running license:check or checkstyle:checkstyle directly,
    it is necessary to add initialize phase to the command line,
    since the pulsar.basedir property gets set in the initialize phase.
    for example:
    mvn initialize license:check or
    mvn initialize checkstyle:checkstyle

    • This should be fine since the maven best practice is to use lifecycle phases such
      as mvn verify instead of listing plugin goals on the command line.

@lhotari lhotari marked this pull request as draft December 11, 2020 11:49
@lhotari lhotari marked this pull request as ready for review December 11, 2020 13:11
@lhotari
Copy link
Member Author

lhotari commented Dec 11, 2020

/pulsarbot run-failure-checks

2 similar comments
@lhotari
Copy link
Member Author

lhotari commented Dec 11, 2020

/pulsarbot run-failure-checks

@lhotari
Copy link
Member Author

lhotari commented Dec 11, 2020

/pulsarbot run-failure-checks

@sijie sijie added this to the 2.8.0 milestone Dec 11, 2020
@lhotari
Copy link
Member Author

lhotari commented Dec 11, 2020

/pulsarbot run-failure-checks

1 similar comment
@lhotari
Copy link
Member Author

lhotari commented Dec 11, 2020

/pulsarbot run-failure-checks

@sijie
Copy link
Member

sijie commented Dec 12, 2020

@lhotari I pushed a change to make sql integration become more stable. otherwise, CI will not pass.

Fixes apache#8911, compiling a sub module individually in the sub module directory

- use proposed solution of https://stackoverflow.com/a/37965143
  to set a property "pulsar.basedir" which contains the absolute path
  to the root directory
  - all other solutions don't seem to work universally in all projects,
    for example "project.parent.basedir" isn't available in the
    root project and not all projects necessarily have the root project
    as their parent project.

- when running "license:check" or "checkstyle:checkstyle" directly,
  it is necessary to add "initialize" phase to the command line,
  for example:
  "mvn initialize license:check" or
  "mvn initialize checkstyle:checkstyle"
  - maven isn't intended to be used for calling individual tasks,
    it's recommended to use phases such as "mvn verify"
Copy link
Contributor

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! Thank you very much

@lhotari
Copy link
Member Author

lhotari commented Dec 12, 2020

/pulsarbot rerun-failure-checks

@sijie sijie merged commit ab35e2d into apache:master Dec 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compile individual module failed
3 participants