Skip to content

IVY-1665: checkdepsupdate: verify version is greater before reporting on available update#119

Open
eric-milles wants to merge 3 commits into
apache:masterfrom
eric-milles:IVY-1665
Open

IVY-1665: checkdepsupdate: verify version is greater before reporting on available update#119
eric-milles wants to merge 3 commits into
apache:masterfrom
eric-milles:IVY-1665

Conversation

@eric-milles

Copy link
Copy Markdown
Member

A status difference (integration vs release) may see a lesser version as the latest release. Ensure that the revision is greater before reporting it as an update. Ex: org.glassfish#jakarta.el 5.0.0-M1 -> 4.0.2

The logic for isGreater was extracted from org.apache.ivy.plugins.latest.LatestRevisionStrategy.MridComparator. This comparator checks more than is necessary for revision comparison.

@eric-milles eric-milles changed the title IVY-1665: verify version is greater before reporing on available updates IVY-1665: verify version is greater before reporting on available update Jun 11, 2026
@eric-milles eric-milles changed the title IVY-1665: verify version is greater before reporting on available update IVY-1665: checkdepsupdate: verify version is greater before reporting on available update Jun 11, 2026
@maartenc

maartenc commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Thanks !
Instead of extracting the code from MridComparator, I think you should use the default LatestStrategy to compare the revisions. If you want, I can change that myself after applying this PR?

@maartenc

maartenc commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Looks good, thanks !
One final remark (my fault sorry since I hinted you to the default LatestStrategy), but after some 2nd thoughts, it might be more correct to use the LatestStrategy from the resolver.

Something like this to get the LatestStrategy for a dependency?

    private LatestStrategy getLatestStrategy(IvyNode node) {
        DependencyResolver resolver = getSettings().getResolver(node.getResolvedId());
        LatestStrategy latestStrategy = null;
        if (resolver instanceof HasLatestStrategy) {
            latestStrategy = ((HasLatestStrategy) resolver).getLatestStrategy();
        }
        if (latestStrategy == null) {
            latestStrategy = getSettings().getDefaultLatestStrategy();
        }
        return latestStrategy;
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants