As a IDEasy user, I want to be able to upgrade to the latest version of IDEasy so that I do not have to check for new versions, manually download and re-install IDEasy.
This should happen via ide upgrade (what will install the latest IDEasy product version if not already installed - unlike ide update what will update my current project to the latest state).
Therefore an UpgradeCommandlet shall be implemented.
The old mechanism in devonfw-ide for this feature was devon ide update scripts and the code can be found here:
https://github.com/devonfw/ide/blob/9efaf926f1daa4e1e37a22fc89081255fbf55dab/scripts/src/main/resources/scripts/command/ide#L47-L66
The key to find the latest version is https://repo1.maven.org/maven2/com/devonfw/tools/IDEasy/ide-cli/maven-metadata.xml
and for SNAPSHOTs https://s01.oss.sonatype.org/content/repositories/snapshots/com/devonfw/tools/IDEasy/ide-cli/maven-metadata.xml
As a IDEasy user, I want to be able to upgrade to the latest version of IDEasy so that I do not have to check for new versions, manually download and re-install IDEasy.
This should happen via
ide upgrade(what will install the latest IDEasy product version if not already installed - unlikeide updatewhat will update my current project to the latest state).Therefore an
UpgradeCommandletshall be implemented.The old mechanism in devonfw-ide for this feature was
devon ide update scriptsand the code can be found here:https://github.com/devonfw/ide/blob/9efaf926f1daa4e1e37a22fc89081255fbf55dab/scripts/src/main/resources/scripts/command/ide#L47-L66
The key to find the latest version is https://repo1.maven.org/maven2/com/devonfw/tools/IDEasy/ide-cli/maven-metadata.xml
and for SNAPSHOTs https://s01.oss.sonatype.org/content/repositories/snapshots/com/devonfw/tools/IDEasy/ide-cli/maven-metadata.xml
MavenRepositoryimplementing ToolRepository with a mapping fromtoolandeditiontogroupIdandartifactId(as a starting point this can be hardcoded). It should support parsingmaven-metadata.xmlto implementresolveVersion.The
downloadmethod can be implemented straight forward reusing existing download functionality we already have implemented after mapping and building the download URL. TheoreticallyfindDependenciescould be implemented viapombut we do not want or need this yet and simply return an emptyListhere.Then we can make the
MavenRepositoryaccessible viaIdeContext.runmethod ofUpgradeCommandletcan use theMavenRepositoryto resolve the latest version, compare it with the current version (IdeVersion.get()converted toVersionIdentifier). If a newer version is available, then download it. Finally extract the download to$IDE_ROOT/_ideoverwriting all files. The latter part may be tricky on Windows due to file locks.https://s01.oss.sonatype.org/content/repositories/snapshotsas base URL instead ofhttps://repo1.maven.org/maven2.Further, we currently cannot distinguish different SNAPSHOT versions.
Therefore I propose a new sub-task story: