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

The org.apache.httpcomponents:httpmime:4.5.5 was wrong after migrating to SpringBoot 3.3 #4652

Open
cuong02n opened this issue Nov 7, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@cuong02n
Copy link

cuong02n commented Nov 7, 2024

What version of OpenRewrite are you using?

I am using

  • rewrite-maven-plugin v5.43.0
  • rewrite-spring v5.22.0
  • receipe: org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_3

How are you running OpenRewrite?

I am using the Maven plugin, and my project is a single module project.

<plugin>
    <groupId>org.openrewrite.maven</groupId>
    <artifactId>rewrite-maven-plugin</artifactId>
    <version>5.43.0</version>
    <configuration>
        <exportDatatables>true</exportDatatables>
        <activeRecipes>
            <recipe>org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_3</recipe>
        </activeRecipes>
    </configuration>
    <dependencies>
        <dependency>
            <groupId>org.openrewrite.recipe</groupId>
            <artifactId>rewrite-spring</artifactId>
            <version>5.22.0</version>
        </dependency>
    </dependencies>
</plugin>

And then I used: mvn rewrite:run

What is the smallest, simplest way to reproduce the problem?

import org.apache.http.HttpEntity; // <- The tested import
import org.apache.http.StatusLine; // <- The tested import
import org.apache.http.client.methods.CloseableHttpResponse; // <- The tested import
import org.apache.http.client.methods.HttpPost; // <- The tested import
import org.apache.http.entity.ContentType; // <- The tested import
import org.apache.http.entity.mime.MultipartEntityBuilder; // <- The tested import
import org.apache.http.entity.mime.content.FileBody; // <- The tested import
import org.apache.http.entity.mime.content.StringBody; // <- The tested import

import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;


@SpringBootApplication
public class Test {
    public static void main(String[] args) {
        SpringApplication.run(Test.class);
        CloseableHttpClient httpClient = HttpClients.createDefault();
    }
}

What did you expect to see?

The code after running recipe should not be changed, or maybe a better version of its dependency.

What did you see instead?

image

The qualified name was changed, but the dependency: org.apache.httpcomponents:httpmime in pom.xml is constant.

What is the full stack trace of any errors you encountered?

[WARNING] Changes have been made to pom.xml by:
[WARNING]     org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_2
[WARNING]         org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_1
[WARNING]             org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_0
[WARNING]                 org.openrewrite.java.spring.boot2.UpgradeSpringBoot_2_7
[WARNING]                     org.openrewrite.java.spring.boot2.UpgradeSpringBoot_2_6
[WARNING]                         org.openrewrite.java.spring.boot2.UpgradeSpringBoot_2_5
[WARNING]                             org.openrewrite.java.spring.boot2.UpgradeSpringBoot_2_4
[WARNING]                                 org.openrewrite.java.spring.boot2.UpgradeSpringBoot_2_3
[WARNING]                                     org.openrewrite.java.spring.boot2.UpgradeSpringBoot_2_2
[WARNING]                                         org.openrewrite.java.spring.boot2.UpgradeSpringBoot_2_1
[WARNING]                                             org.openrewrite.java.dependencies.UpgradeDependencyVersion: {groupId=org.springframework.boot, artifactId=*, newVersion=2.1.x, overrideManagedVersion=false}
[WARNING]                                         org.openrewrite.java.dependencies.UpgradeDependencyVersion: {groupId=org.springframework.boot, artifactId=*, newVersion=2.2.x, overrideManagedVersion=false}
[WARNING]                                     org.openrewrite.java.dependencies.UpgradeDependencyVersion: {groupId=org.springframework.boot, artifactId=*, newVersion=2.3.x, overrideManagedVersion=false}
[WARNING]                                 org.openrewrite.java.dependencies.UpgradeDependencyVersion: {groupId=org.springframework.boot, artifactId=*, newVersion=2.4.x, overrideManagedVersion=false}
[WARNING]                             org.openrewrite.java.dependencies.UpgradeDependencyVersion: {groupId=org.springframework.boot, artifactId=*, newVersion=2.5.x, overrideManagedVersion=false}
[WARNING]                         org.openrewrite.java.dependencies.UpgradeDependencyVersion: {groupId=org.springframework.boot, artifactId=*, newVersion=2.6.x, overrideManagedVersion=false}
[WARNING]                     org.openrewrite.java.dependencies.UpgradeDependencyVersion: {groupId=org.springframework.boot, artifactId=*, newVersion=2.7.x, overrideManagedVersion=false}
[WARNING]                 org.openrewrite.java.dependencies.UpgradeDependencyVersion: {groupId=org.springframework.boot, artifactId=*, newVersion=3.0.x, overrideManagedVersion=false, retainVersions=[org.thymeleaf:thymeleaf-spring5, org.thymeleaf.extras:thymeleaf-extras-springsecurity5]}
[WARNING]             org.openrewrite.java.dependencies.UpgradeDependencyVersion: {groupId=org.springframework.boot, artifactId=*, newVersion=3.1.x, overrideManagedVersion=false}
[WARNING]         org.openrewrite.java.dependencies.UpgradeDependencyVersion: {groupId=org.springframework.boot, artifactId=*, newVersion=3.2.x, overrideManagedVersion=false}
[WARNING]         org.openrewrite.java.dependencies.UpgradeDependencyVersion: {groupId=org.springframework.boot, artifactId=*, newVersion=3.3.x, overrideManagedVersion=false}
[WARNING] Changes have been made to src\main\java\com\cuong02n\Test.java by:
[WARNING]     org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_2
[WARNING]         org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_1
[WARNING]             org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_0
[WARNING]                 org.openrewrite.java.spring.framework.UpgradeSpringFramework_6_0
[WARNING]                     org.openrewrite.apache.httpclient5.UpgradeApacheHttpClient_5
[WARNING]                         org.openrewrite.apache.httpclient5.UpgradeApacheHttpClient_5_ClassMapping
[WARNING]                             org.openrewrite.java.ChangePackage: {oldPackageName=org.apache.http.client.methods, newPackageName=org.apache.hc.client5.http.classic.methods}
[WARNING]                             org.openrewrite.java.ChangeType: {oldFullyQualifiedTypeName=org.apache.hc.client5.http.classic.methods.CloseableHttpResponse, newFullyQualifiedTypeName=org.apache.hc.client5.http.impl.classic.CloseableHttpResponse}
[WARNING]                             org.openrewrite.java.ChangePackage: {oldPackageName=org.apache.http.impl.client, newPackageName=org.apache.hc.client5.http.impl.classic}
[WARNING]                             org.openrewrite.java.ChangePackage: {oldPackageName=org.apache.http.entity, newPackageName=org.apache.hc.core5.http.io.entity}
[WARNING]                             org.openrewrite.java.ChangeType: {oldFullyQualifiedTypeName=org.apache.hc.core5.http.io.entity.ContentType, newFullyQualifiedTypeName=org.apache.hc.core5.http.ContentType}
[WARNING]                             org.openrewrite.java.ChangePackage: {oldPackageName=org.apache.http, newPackageName=org.apache.hc.core5.http}
[WARNING]                             org.openrewrite.java.ChangeType: {oldFullyQualifiedTypeName=org.apache.hc.core5.http.StatusLine, newFullyQualifiedTypeName=org.apache.hc.core5.http.message.StatusLine}

Are you interested in contributing a fix to OpenRewrite?

@cuong02n cuong02n added the bug Something isn't working label Nov 7, 2024
@timtebeek timtebeek moved this to Backlog in OpenRewrite Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Backlog
Development

No branches or pull requests

1 participant