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

org.openrewrite.maven.cleanup.ExplicitPluginVersion #4495

Open
HelloDhero opened this issue Sep 15, 2024 · 1 comment
Open

org.openrewrite.maven.cleanup.ExplicitPluginVersion #4495

HelloDhero opened this issue Sep 15, 2024 · 1 comment
Labels
bug Something isn't working question Further information is requested

Comments

@HelloDhero
Copy link

when plugin is locked version by pluginManagement , it is no need to add ''

@HelloDhero HelloDhero added the bug Something isn't working label Sep 15, 2024
@timtebeek
Copy link
Contributor

Hi @HelloDhero ; Could you explain in what circumstance you saw this issue? We normally have a format for that when you open a new issue. I've tried to replicate your issue but have so far failed, as these two tests pass:

@Test
void shouldNotOverrideParentPluginVersion() {
rewriteRun(
pomXml(
"""
<project>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.5.4</version>
</parent>
<groupId>com.mycompany.app</groupId>
<artifactId>my-app</artifactId>
<version>1</version>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
"""
)
);
}

@Test
@Issue("https://github.com/openrewrite/rewrite/issues/4495")
void shouldNotOverrideManagedVersion() {
    rewriteRun(
      pomXml(
        """
          <project>
            <groupId>com.mycompany.app</groupId>
            <artifactId>my-app</artifactId>
            <version>1</version>
            <build>
              <pluginManagement>
                <plugins>
                  <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>>
                    <version>3.8.0</version>
                  </plugin>
                </plugins>
              </pluginManagement>
              <plugins>
                <plugin>
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-compiler-plugin</artifactId>
                  <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                  </configuration>
                </plugin>
              </plugins>
            </build>
          </project>
          """
      )
    );
}

@timtebeek timtebeek added the question Further information is requested label Sep 15, 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 question Further information is requested
Projects
Status: No status
Development

No branches or pull requests

2 participants