Skip to content

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

Merged
sijie merged 1 commit into
apache:masterfrom
lhotari:lh-fix-submodule-compilation
Dec 13, 2020
Merged

sijie merged 1 commit into
apache:masterfrom
lhotari:lh-fix-submodule-compilation

Conversation

@lhotari

@lhotari lhotari commented Dec 11, 2020 •

Copy link
Copy Markdown
Member

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 force-pushed the lh-fix-submodule-compilation branch from 6c0a619 to f49d954 Compare December 11, 2020 13:06
@lhotari
lhotari marked this pull request as ready for review December 11, 2020 13:11
@lhotari

lhotari commented Dec 11, 2020

Copy link
Copy Markdown
Member Author

/pulsarbot run-failure-checks

2 similar comments
@lhotari

lhotari commented Dec 11, 2020

Copy link
Copy Markdown
Member Author

/pulsarbot run-failure-checks

@lhotari

lhotari commented Dec 11, 2020

Copy link
Copy Markdown
Member Author

/pulsarbot run-failure-checks

@sijie sijie added this to the 2.8.0 milestone Dec 11, 2020
@lhotari

lhotari commented Dec 11, 2020

Copy link
Copy Markdown
Member Author

/pulsarbot run-failure-checks

1 similar comment
@lhotari

lhotari commented Dec 11, 2020

Copy link
Copy Markdown
Member Author

/pulsarbot run-failure-checks

@sijie

sijie commented Dec 12, 2020

Copy link
Copy Markdown
Member

@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"
@lhotari
lhotari force-pushed the lh-fix-submodule-compilation branch from 9315079 to 6e67cb3 Compare December 12, 2020 16:30

@eolivelli eolivelli left a comment

Copy link
Copy Markdown
Contributor

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

lhotari commented Dec 12, 2020

Copy link
Copy Markdown
Member Author

/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