UniGetUI icon indicating copy to clipboard operation
UniGetUI copied to clipboard

[FEATURE REQUEST] Maven Package Manager Support

Open BullyWiiPlaza opened this issue 3 months ago • 4 comments

Please confirm these before moving forward.

  • [x] I have searched for my feature proposal and have not found a work-in-progress/duplicate/resolved/discarded issue.
  • [x] This proposal is a completely new feature. If you want to suggest an improvement or an enhancement, please use this template.

Describe the new feature

Maven is the most commonly used package manager for Java libraries, just like vcpkg for C++ and cargo for Rust. The last two are already supported in UniGetUI. Was maven already considered or can it be implemented maybe similar to Python pip showing which library has a newer version available? The difference between pip and maven is that you specify which version of a library you want to use in the pom.xml file on a project basis and the used libraries aren't automatically updated to the latest version, unless the pom.xml file specifies it accordinly with e.g. LATEST as the version etc. Maven will also automatically update dependencies when using LATEST as the version when building a project which however is considered bad practice since always using latest library versions can cause unintended side-effects from a library being updated without the developer's knowledge and somehow suddenly behaving differently.

Describe how this new feature could help users

It could help automate downloading the latest package versions in the .m2 folder/repository. UniGetUI could show users of maven packages if there's an update available in an automated way for each available library package inside the .m2 folder. After seeing which packages have updates, a developer can then put the new version numbers into the pom.xml file of Java projects (manually) to upgrade them respectively for each project. Maven has a command to check for updated versions but it seems to only be usable on a per project basis, not globally. Also, this command can be slow if there are many transitive dependencies, e.g. when using bigger frameworks.

BullyWiiPlaza avatar Sep 17 '25 17:09 BullyWiiPlaza

Is this referring to a per-project implementation of Maven, or is there a global part? From what I see it looks like you have to find the updates from each project and then update them globally, is that correct?

mrixner avatar Sep 18 '25 00:09 mrixner

Is this referring to a per-project implementation of Maven, or is there a global part? From what I see it looks like you have to find the updates from each project and then update them globally, is that correct?

Maven has a global repository cache for the downloaded/used packages which is the .m2 folder. Each project typically uses specific versions of a library and you can look up the latest version manually on for example: https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api In order to update a library, you'd just write the new version into the project specific pom.xml file and perform a maven reload:

<!-- https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api -->
<dependency>
    <groupId>org.junit.jupiter</groupId>
    <artifactId>junit-jupiter-api</artifactId>
    <version>6.0.0-RC3</version>
    <scope>test</scope>
</dependency>

This will then cause maven to automatically pull that library version into the project and store it in the .m2 cache as well. With UniGetUI this could be turned into a global operation for the entire maven cache and to show all available package updates. The usual workflow with maven is just updating library versions on a per project basis, never globally.

BullyWiiPlaza avatar Sep 18 '25 07:09 BullyWiiPlaza

If versions can't be managed globally, it isn't a consistent experience with the rest of the UniGetUI package managers. At least vcpkg and Cargo I believe (and Pip with virtualenvs) have this sort of per-project behavior as well, but they do not expose this functionality in UniGetUI as it's not the scope of the project; finding projects is a whole different thing. If I'm wrong, Martí, please feel free to correct me.

mrixner avatar Sep 23 '25 00:09 mrixner

Yeah, you are completely right

marticliment avatar Sep 23 '25 07:09 marticliment