Skip to content

Recipes for migrating from Spring Cloud Contract to Stubborn Contract #1069

Description

@DidierLoiseau

What problem are you trying to solve?

I’m creating this issue following the recent announcement that Spring Cloud Contract will become Stubborn Contract.

There is no release yet, but it will be required to foresee at least package and dependency changes, and it seems this will apply even for past releases of Spring Cloud because it is no longer maintained: the repository is already archived (although I assume the spring-cloud-dependencies will still point to the latest version in case of patch releases of existing release trains, so the migration will become mandatory with Spring Cloud 2026.x).

What precondition(s) should be checked before applying this recipe?

Any usage of Spring Cloud Contract.

Describe the situation before applying the recipe

This will require at least to update packages and dependencies, but possibly more.

import org.springframework.cloud.contract.[…];
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-contract-[…]</artifactId>
            <scope>test</scope>
        </dependency>

Describe the situation after applying the recipe

(Exact package and dependency names to be determined)

import sh.stubborn.contract.[…];
        <dependency>
            <groupId>sh.stubborn</groupId>
            <artifactId>stubborn-contract-[…]</artifactId>
            <scope>test</scope>
        </dependency>

Have you considered any alternatives or workarounds?

No, Spring Cloud will no longer maintain and deliver Spring Cloud Contract, so there won’t be an alternative to the migration.

Any additional context

Are you interested in contributing this recipe to OpenRewrite?

Not currently as it is not required yet, I’m just creating this issue to have it on the radar.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Recipes Wanted

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions