rewrite: Error: No version provided for dependency org.springframework:spring-core (managed dependency)

Good morning,

With version 7.19.0 there is an error when parsing the original maven file because the parent POM contains an unversioned dependencyManagement.

[INFO] --- rewrite-maven-plugin:4.20.0:dryRun (default-cli) @ test-project ---
[INFO] Using active recipe(s) [com.yourorg.UpgradePom]
[INFO] Using active styles(s) []
[INFO] Validating active recipes...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  25.989 s
[INFO] Finished at: 2022-03-02T10:26:33+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.openrewrite.maven:rewrite-maven-plugin:4.20.0:dryRun (default-cli) on project test-project: Execution default-cli of goal org.openrewrite.maven:rewrite-maven-plugin:4.20.0:dryRun failed: No version
 provided for dependency org.springframework:spring-core -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException

This problem was solved in version 7.16.0 (https://github.com/openrewrite/rewrite/issues/1084) , but since version 7.18.2 (https://github.com/openrewrite/rewrite/issues/1406) it is happening again.

Attached is an example test, where the problem is reproduced.

Child project: https://github.com/josemariavillar/test_project/tree/no-version-provided Parent project: https://github.com/josemariavillar/test-project-parent/tree/no-version-provided

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 19 (13 by maintainers)

Most upvoted comments

Seems to work, thank you 😃

@josemariavillar yes, if you skip maven parsing, there will be no ability for maven-based recipes to transform maven build files. The commit I made last night should fix this problem, I just need to get all of the tests passing so the 7.20.0-SNAPSHOT is published to the snapshot repo.

-DskipMavenParsing=true saved me here.