Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JodaTime should pull threeten-extra from resources, not classpath #676

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

timtebeek
Copy link
Contributor

@timtebeek timtebeek commented Feb 15, 2025

What's changed?

Add threeten-extra to TypeTable.

What's your motivation?

Could not be found on classpath(..).

Anything in particular you'd like reviewers to focus on?

Please ./gradlew pTML, then use 3.3.0-SNAPSHOT of rewrite-migrate-java with rewrite-maven-plugin v6.1.3 or v6.1.4.

Anyone you would like to review specifically?

@YarochkinMichael

@timtebeek timtebeek self-assigned this Feb 15, 2025
@timtebeek
Copy link
Contributor Author

Alternatively, adding threeten-extra to the plugin itself also seems to work as a workaround for now

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>my.test</groupId>
    <artifactId>openrewrite-test</artifactId>
    <version>1.0-SNAPSHOT</version>

    <properties>
        <maven.compiler.source>21</maven.compiler.source>
        <maven.compiler.target>21</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencies>
        <dependency>
            <groupId>joda-time</groupId>
            <artifactId>joda-time</artifactId>
            <version>2.2</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.openrewrite.maven</groupId>
                <artifactId>rewrite-maven-plugin</artifactId>
                <version>6.1.3</version>
                <configuration>
                    <activeRecipes>
                        <recipe>org.openrewrite.java.migrate.joda.NoJodaTime</recipe>
                    </activeRecipes>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.openrewrite.recipe</groupId>
                        <artifactId>rewrite-migrate-java</artifactId>
                        <version>3.2.0</version>
                    </dependency>
                    <dependency>
                        <groupId>org.threeten</groupId>
                        <artifactId>threeten-extra</artifactId>
                        <version>1.8.0</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>
    </build>

</project>

@timtebeek
Copy link
Contributor Author

There's additional usages that we'd need to replace for a proper fix:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

1 participant