Skip to content

IsMatchingSpringBootVersion fails with pom.xml having only Spring Boot declared in dependencyManagement #423

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

Closed
fabapp2 opened this issue Sep 19, 2022 · 1 comment · Fixed by #454
Assignees
Labels
type: bug Something isn't working
Milestone

Comments

@fabapp2
Copy link
Contributor

fabapp2 commented Sep 19, 2022

Describe the bug
Scanning an application that has the dependency to Spring Boot declared in dependencyManagement but not other dependency to Spring Boot fails.

Also the check for spring-modules takes the version into account but uses a finder that checks only declared dependencies.
But in most cases declared dependencies to Spring modules will not have a version declared and this check will then fail.
Replacing the finder with a finder that searches the resolved dependencies with version and not only declared dependencies would fix this

To reproduce

Given:

<?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>org.springframework.sbm</groupId>
    <artifactId>spring-boot-migrator</artifactId>
    <version>0.12.1-SNAPSHOT</version>
    <dependencyManagement>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <version>2.7.4</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>
    </build>
</project>

When running boot-2.7-3.0-dependency-version-update

Then:
nothing changes

Expected:
Version updated and repository added (if required)

@fabapp2 fabapp2 added the type: bug Something isn't working label Sep 19, 2022
@fabapp2 fabapp2 added this to the v0.13.0 milestone Sep 28, 2022
@fabapp2
Copy link
Contributor Author

fabapp2 commented Sep 28, 2022

Assigned to @sanagaraj-pivotal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant