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

#387: make runOnlyOnce run on the first project (and make it work when maven's --projects param are specified) #443

Merged
merged 2 commits into from Oct 12, 2019

Conversation

TheSnoozer
Copy link
Collaborator

Context

see: #387

In most cases this doesn't change much, however for some this might be considered a behavioral change (and thus fits a major version change). In specific when runOnlyOnce is specified the plugin will run on the first project as specified in the Reactor Build Order.

As per debugging project:

$ mvn clean package -Pgit-with-parent
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO] 
[INFO] Git Commit Id Plugin Maven Mojo Debugging
[INFO] submodule-one
[INFO] submodule-two

or with --projects

$ mvn clean package -Pgit-with-parent --projects submodule-one,submodule-two
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO] 
[INFO] submodule-one
[INFO] submodule-two

or vice versa (the pom.xml seems to take precedence):

$ mvn clean package -Pgit-with-parent --projects submodule-two,submodule-one
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO] 
[INFO] submodule-one
[INFO] submodule-two

Inspired by sonar-scanner-maven plugin

Contributor Checklist

  • Added relevant integration or unit tests to verify the changes
  • Update the Readme or any other documentation (including relevant Javadoc)
  • Ensured that tests pass locally: mvn clean package
  • Ensured that the code meets the current checkstyle coding style definition: mvn clean verify -Pcheckstyle -Dmaven.test.skip=true -B

…e it work when maven's --projects param are specified)
@TheSnoozer TheSnoozer added this to the 4.0.0 milestone Oct 12, 2019
@TheSnoozer
Copy link
Collaborator Author

Perhaps think about this more: how should this interact with <skipPoms>true</skipPoms>?

@TheSnoozer
Copy link
Collaborator Author

Essentially the idea is that if skipPoms == true then the plugin attempts to find the first not pom project. If the skipPoms == false then the plugin retrieves the first project.

Note that whenever specifying the Maven's --projects param the order does not seem to make a difference (it seems that whatever is in the pom defined as order takes precedence).

e.g. this is the same:

mvn clean package -Pgit-with-parent --projects submodule-one,submodule-two
mvn clean package -Pgit-with-parent --projects submodule-two,submodule-one

Check also the Reactor Build Order at the start of the build:

[INFO] Reactor Build Order:
[INFO] 
[INFO] Git Commit Id Plugin Maven Mojo Debugging
[INFO] submodule-one
[INFO] submodule-two

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.

None yet

1 participant