Skip to content

ide upgrade cannot find latest version at least for SNAPSHOTs #1159

@hohwille

Description

@hohwille

Expected behavior

As a IDEasy user, I want to use ide upgrade to get the latest release so that I can benefit from latest bugfixes and features.

Actual behavior

$ ide -fd upgrade --mode=snapshot
Running commandlet UpgradeCommandlet[upgrade]
Running command 'C:\Program Files\Git\cmd\git.exe' with arguments 'rev-parse' '@{u}' ...
Updates are available for the settings repository. If you want to apply the latest changes, call "ide update"
Start: Install ideasy
Resolved version pattern *-SNAPSHOT to version 2025.02.002-beta-SNAPSHOT
Tool ideasy has 0 other tool(s) as dependency
Version 2025.02.002-beta-20250227.023618-5 of tool ideasy is already installed at D:\projects\_ide\software\maven\ideasy\ideasy\2025.02.002-beta-20250227.023618-5
Deleting D:\projects\_ide\installation ...
Creating relative symbolic link D:\projects\_ide\installation pointing to software\maven\ideasy\ideasy\2025.02.002-beta-20250227.023618-5
Successfully installed ideasy in version 2025.02.002-beta-20250227.023618-5 replacing previous version 2025.02.002-beta-02_27_02-SNAPSHOT
Step 'Install ideasy' ended successfully.
It is recommended to run 'ide update' on your IDEasy projects now.
Step 'ide' ended successfully.
Successfully completed ide (upgrade,--mode=snapshot)

Whatever is going on here reveals that #786 is not properly implemented:

Resolved version pattern *-SNAPSHOT to version 2025.02.002-beta-SNAPSHOT

This is definetly incorrect since this is currently the latest version:
https://s01.oss.sonatype.org/content/repositories/snapshots/com/devonfw/tools/IDEasy/ide-cli/2025.03.002-SNAPSHOT/

So it should print 2025.03.002-SNAPSHOT instead of 2025.02.002-beta-SNAPSHOT.
You can also verify that here:
https://s01.oss.sonatype.org/content/repositories/snapshots/com/devonfw/tools/IDEasy/ide-cli/maven-metadata.xml
Check for <latest> element in the XML.

Steps to reproduce (bug) / Use Case of feature request (enhancement)

  1. ide -fd upgrade --mode=snapshot

Related/Dependent Issues

Comments/Hints:

if (file.getFileName().toString().equals(MvnArtifact.MAVEN_METADATA_XML)) {
Duration cacheDuration = METADATA_CACHE_DURATION_RELEASE;
if (file.getParent().getFileName().toString().endsWith("-SNAPSHOT")) {
cacheDuration = METADATA_CACHE_DURATION_SNAPSHOT;
}
return !this.context.getFileAccess().isFileAgeRecent(file, cacheDuration);
}

Force mode is not considered here what was actually discussed during implementation and review

Still after deleting the maven metadata from my local repo, the problem remains.

Further trace should start debugging here:

List<VersionIdentifier> versions = fetchVersions(artifact);

Affected version:

  • 2025.02.002-SNAPSHOT

Metadata

Metadata

Labels

upgradeupgrade of IDEasy to latest version

Type

Projects

Status

✅ Done

Relationships

None yet

Development

No branches or pull requests

Issue actions