You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
As a preparation a first PR could create a MavenRepository implementing ToolRepository with a mapping from tool and edition to groupId and artifactId (as a starting point this can be hardcoded). It should support parsing maven-metadata.xml to implement resolveVersion.
The download method can be implemented straight forward reusing existing download functionality we already have implemented after mapping and building the download URL. Theoretically findDependencies could be implemented via pom but we do not want or need this yet and simply return an empty List here.
Then we can make the MavenRepository accessible via IdeContext.
Once all this is done (in another PR after merging the first or in the same PR), the run method of UpgradeCommandlet can use the MavenRepository to resolve the latest version, compare it with the current version (IdeVersion.get() converted to VersionIdentifier). If a newer version is available, then download it. Finally extract the download to $IDE_ROOT/_ide overwriting all files. The latter part may be tricky on Windows due to file locks.
As an advanced feature if the current version of IDEasy is a SNAPSHOT, then the MavenRepository should be created with https://s01.oss.sonatype.org/content/repositories/snapshots as base URL instead of https://repo1.maven.org/maven2.
Further, we currently cannot distinguish different SNAPSHOT versions.
Therefore I propose a new sub-task story:
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 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
MavenRepository
implementing ToolRepository with a mapping fromtool
andedition
togroupId
andartifactId
(as a starting point this can be hardcoded). It should support parsingmaven-metadata.xml
to implementresolveVersion
.The
download
method can be implemented straight forward reusing existing download functionality we already have implemented after mapping and building the download URL. TheoreticallyfindDependencies
could be implemented viapom
but we do not want or need this yet and simply return an emptyList
here.Then we can make the
MavenRepository
accessible viaIdeContext
.run
method ofUpgradeCommandlet
can use theMavenRepository
to 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/_ide
overwriting all files. The latter part may be tricky on Windows due to file locks.https://s01.oss.sonatype.org/content/repositories/snapshots
as base URL instead ofhttps://repo1.maven.org/maven2
.Further, we currently cannot distinguish different SNAPSHOT versions.
Therefore I propose a new sub-task story:
The text was updated successfully, but these errors were encountered: