Skip to main content

Migrate from OptaPlanner to Timefold Solver

ai.timefold.solver.migration.FromOptaPlannerToTimefoldSolver

Replaces your method/field calls, GAVs, etc. To replace deprecated methods too, use the recipe ToLatest

Recipe source

GitHub: search?type=code&q=ai.timefold.solver.migration.FromOptaPlannerToTimefoldSolver, Issue Tracker, Maven Central

info

This recipe is composed of more than one recipe. If you want to customize the set of recipes this is composed of, you can find and copy the GitHub source for the recipe from the link above.

This recipe is available under the Apache License Version 2.0.

Definition

  • Change type
    • oldFullyQualifiedTypeName: org.optaplanner.persistence.jackson.api.OptaPlannerJacksonModule
    • newFullyQualifiedTypeName: ai.timefold.solver.jackson.api.TimefoldJacksonModule
    • ignoreDefinition: true
  • Rename package name
    • oldPackageName: org.optaplanner.persistence.jackson
    • newPackageName: ai.timefold.solver.jackson
    • recursive: true
  • Rename package name
    • oldPackageName: org.optaplanner.persistence.jaxb
    • newPackageName: ai.timefold.solver.jaxb
    • recursive: true
  • Rename package name
    • oldPackageName: org.optaplanner.persistence.jsonb
    • newPackageName: ai.timefold.solver.jsonb
    • recursive: true
  • Rename package name
    • oldPackageName: org.optaplanner.persistence.xstream
    • newPackageName: ai.timefold.solver.xstream
    • recursive: true
  • Rename package name
    • oldPackageName: org.optaplanner.persistence.jpa
    • newPackageName: ai.timefold.solver.jpa
    • recursive: true
  • Rename package name
    • oldPackageName: org.optaplanner
    • newPackageName: ai.timefold.solver
    • recursive: true
  • Change property key
    • oldPropertyKey: ^optaplanner\.(.*)
    • newPropertyKey: timefold.$1
    • regex: true
  • Change property key
    • oldPropertyKey: ^(%[^.]*\.)?quarkus\.optaplanner\.(.*)
    • newPropertyKey: $1quarkus.timefold.$2
    • regex: true
  • Change property key
    • oldPropertyKey: ^(%[^.]*\.)?quarkus\.log\.category\."org\.optaplanner"\.level
    • newPropertyKey: $1quarkus.log.category."ai.timefold.solver".level
    • regex: true
  • Change property key
    • oldPropertyKey: ^(%[^.]*\.)?logging\.level\.org\.optaplanner
    • newPropertyKey: $1logging.level.ai.timefold.solver
    • regex: true
  • Change XML attribute
    • elementName: solver
    • attributeName: xmlns
    • newValue: https://timefold.ai/xsd/solver
    • oldValue: https://www.optaplanner.org/xsd/solver
  • Change XML attribute
    • elementName: solver
    • attributeName: xsi:schemaLocation
    • newValue: https://timefold.ai/xsd/solver https://timefold.ai/xsd/solver/solver.xsd
    • oldValue: https://www.optaplanner.org/xsd/solver https://www.optaplanner.org/xsd/solver/solver.xsd
  • Change XML attribute
    • elementName: plannerBenchmark
    • attributeName: xmlns
    • newValue: https://timefold.ai/xsd/benchmark
    • oldValue: https://www.optaplanner.org/xsd/benchmark
  • Change XML attribute
    • elementName: plannerBenchmark
    • attributeName: xsi:schemaLocation
    • newValue: https://timefold.ai/xsd/benchmark https://timefold.ai/xsd/benchmark/benchmark.xsd
    • oldValue: https://www.optaplanner.org/xsd/benchmark https://www.optaplanner.org/xsd/benchmark/benchmark.xsd
  • Change XML attribute
    • elementName: logger
    • attributeName: name
    • newValue: ai.timefold.solver
    • oldValue: org.optaplanner
  • Change XML attribute
    • elementName: logger
    • attributeName: name
    • newValue: ai.timefold.solver
    • oldValue: org.optaplanner
  • Migrate all Maven and Gradle groupIds and artifactIds from OptaPlanner to Timefold
  • Rename Maven property key
    • oldKey: version.org.optaplanner
    • newKey: version.ai.timefold.solver
  • Rename Maven property key
    • oldKey: version.optaPlanner
    • newKey: version.timefold
  • Rename Maven property key
    • oldKey: version.optaplanner
    • newKey: version.timefold
  • Rename Maven property key
    • oldKey: org.optaplanner.version
    • newKey: ai.timefold.solver.version
  • Rename Maven property key
    • oldKey: optaPlanner.version
    • newKey: timefold.version
  • Rename Maven property key
    • oldKey: optaplanner.version
    • newKey: timefold.version
  • Rename Maven property key
    • oldKey: optaplannerVersion
    • newKey: timefoldVersion
  • Rename Maven property key
    • oldKey: optaPlannerVersion
    • newKey: timefoldVersion

Used by

This recipe is used as part of the following composite recipes:

Usage

This recipe has no required configuration options. It can be activated by adding a dependency on `org.openrewrite.recipe:rewrite-third-party` in your build file or by running a shell command (in which case no build changes are needed):

  1. Add the following to your build.gradle file:
    build.gradle
    plugins {
    id("org.openrewrite.rewrite") version("latest.release")
    }

    rewrite {
    activeRecipe("ai.timefold.solver.migration.FromOptaPlannerToTimefoldSolver")
    setExportDatatables(true)
    }

    repositories {
    mavenCentral()
    }

    dependencies {
    rewrite("org.openrewrite.recipe:rewrite-third-party:0.40.1")
    }
  2. Run gradle rewriteRun to run the recipe.

See how this recipe works across multiple open-source repositories

Run this recipe on OSS repos at scale with the Moderne SaaS.

The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories.

Please contact Moderne for more information about safely running the recipes on your own codebase in a private SaaS.

Data Tables

Maven metadata failures

org.openrewrite.maven.table.MavenMetadataFailures

Attempts to resolve maven metadata that failed.

Column NameDescription
Group idThe groupId of the artifact for which the metadata download failed.
Artifact idThe artifactId of the artifact for which the metadata download failed.
VersionThe version of the artifact for which the metadata download failed.
Maven repositoryThe URL of the Maven repository that the metadata download failed on.
SnapshotsDoes the repository support snapshots.
ReleasesDoes the repository support releases.
FailureThe reason the metadata download failed.