aleksandr-m / gitflow-maven-plugin

The Git-Flow Maven Plugin supports various Git workflows, including GitFlow and GitHub Flow. This plugin runs Git and Maven commands from the command line.
https://aleksandr-m.github.io/gitflow-maven-plugin/
Apache License 2.0
488 stars 180 forks source link

#64 Check for SNAPSHOT dependency in parent project definition #323

Closed stefanseifert closed 2 years ago

stefanseifert commented 2 years ago

add integration tests to cover SNAPSHOT dependency check

please note: when implementing the integration tests i realized that the mvn calls that are done internally by gitflow-maven-plugin to call versions-maven-plugin do not pass over the maven settings that are used for the main maven call. this may create problems in other scenarios as well, in this case a handed over the invoker test maven settings manually via argLine in the integration tests.

Fixes #64

stefanseifert commented 2 years ago

the problem with the maven settings in integration tests could be solved more elegant with #248

aleksandr-m commented 2 years ago

@stefanseifert Why do you need mrm plugin?

stefanseifert commented 2 years ago

to set up a mock maven repository for the integration test - it contains a dummy snapshot parent dependency. without this, the IT cannot run because it cannot resolve the parent.

stefanseifert commented 2 years ago

it's the same test setup as used by https://github.com/mojohaus/versions-maven-plugin

aleksandr-m commented 2 years ago

Can it be in test scope? And under run-its profile?

Usually this plugin should be run from the parent project. How versions will be updated if that is not the case?

stefanseifert commented 2 years ago

it makes totally sense to move it to "run-its" profile, same place as the maven-invoker-plugin which it supports, will update the PR. it is only required for the ITs of this plugin - not sure what you mean with "parent project".

aleksandr-m commented 2 years ago

I think you can put parent pom directly in the test folder. Take a look at this integration test.

stefanseifert commented 2 years ago

you're right - the ITs can be simplified to avoid the usage of a mock maven repository - will update the PR.

it's a bit more inflexible without that, though. once we have an IT that really needs to resolver a dependency from a maven repository we might need it again. but for this PRs it's sufficient without.

aleksandr-m commented 2 years ago

Looks good. Can you remove build section from the dummy parent and force push it. Then I'll approve and merge.

stefanseifert commented 2 years ago

it's removed

aleksandr-m commented 2 years ago

Sorry, I wasn't clear enough in my last comment. Can you squash all commits in a single one and force push it.

aleksandr-m commented 2 years ago

Good. Thank you.

stefanseifert commented 2 years ago

thanks for merging! - when do you plan the next release?

aleksandr-m commented 2 years ago

1.18.0 is released.