Skip to content

Fail clearly when configureLocator has no project POM #275 - #299

Open
AzazelSensei wants to merge 1 commit into
apache:masterfrom
AzazelSensei:fix/275-configure-locator-null-pom
Open

Fail clearly when configureLocator has no project POM #275#299
AzazelSensei wants to merge 1 commit into
apache:masterfrom
AzazelSensei:fix/275-configure-locator-null-pom

Conversation

@AzazelSensei

Copy link
Copy Markdown

Following this checklist to help us incorporate your
contribution quickly and easily:

  • Your pull request should address just one issue, without pulling in other changes.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Each commit in the pull request should have a meaningful subject line and body.
    Note that commits might be squashed by a maintainer on merge.
  • Write unit tests that match behavioral changes, where the tests fail if the changes to the runtime are not applied.
    This may not always be possible but is a best-practice.
  • Run mvn verify to make sure basic checks pass.
    A more thorough check will be performed on your pull request automatically.
  • You have run the integration tests successfully (mvn -Prun-its verify).

configureLocator() ran before the try/finally that restores the context classloader, and it called project.getFile().getParentFile() with no null check.

Moved the call into that block. If the project has no POM file, throw MojoExecutionException instead of a raw NPE.

configureLocator ran outside the execute try/finally and called
project.getFile().getParentFile() without a null check. Move it inside
the guarded block and throw MojoExecutionException when the project has
no POM file.
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

Successfully merging this pull request may close these issues.

2 participants