Timefold migration command is not working could it be that the command is wrong?

57 views Asked by At

Recently I've tried to migrate my OptaPlanner project with the help of the maven command found on the official Timefold website but no matter what I do it doesn't seem to work. I've tried ChatGPT(obviously no help), I tried deleting the repository folder found under ${username}/.m2/repository, still no help.

PS C:\Users\username\Documents\New folder\project-name> mvn org.openrewrite.maven:rewrite-maven-plugin:4.46.0:run -Drewrite.recipeArtifactCoordinates=ai.timefold.solver:timefold-solver-migration:0.8.41 -Drewrite.activeRecipes=ai.timefold.solver.migration.ToLatest
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO] 
[INFO] Project Backend Application                                        [pom]
[INFO] MyProjectBackend                                                   [jar]
[INFO] OptaPlanner                                                        [jar]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Project Backend Application 1.0.0-DEV:
[INFO] 
[INFO] Project Backend Application ................... SKIPPED
[INFO] MyProjectBackend  ................................ SKIPPED
[INFO] OptaPlanner ........................................ SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.224 s
[INFO] Finished at: 2023-10-24T14:09:44+03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Error resolving version for plugin '.recipeArtifactCoordinates=ai.timefold.solver:timefold-solver-migration' from the repositories [local (C:\Users\username\.m2\repository), central (https://repo.maven.apache.org/maven2)]: Plugin not found in any plugin repository -> [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/PluginVersionResolutionException

As you can see I've separated my project and optaplanner to speed up the process of generating a schedule in other words.. microservices. But that shouldn't matter it should just migrate some dependencies.

Anyways, any help is welcomed! The project is written in SpringBoot Java

1

There are 1 answers

0
Lukáš Petrovický On BEST ANSWER

This looks to me like a Windows-specific problem, not caused by Timefold Solver. Consider the command:

mvn org.openrewrite.maven:rewrite-maven-plugin:4.46.0:run -Drewrite.recipeArtifactCoordinates=ai.timefold.solver:timefold-solver-migration:0.8.41 -Drewrite.activeRecipes=ai.timefold.solver.migration.ToLatest

The error message complains of .recipeArtifactCoordinates not being a valid Maven plugin. This tells me that the command line was parsed incorrectly and that there is some specific syntax one needs to use to make this work on Windows, and specifically in PowerShell.

This question very likely has your answer.