Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Respect MAVEN_USER_HOME in MavenUtil #637

Open
dreamscached opened this issue Mar 3, 2023 · 2 comments
Open

Respect MAVEN_USER_HOME in MavenUtil #637

dreamscached opened this issue Mar 3, 2023 · 2 comments

Comments

@dreamscached
Copy link

Hello! I am the maintainer of AUR packages for your software. I'm unsure if version 2 is still being maintained or you're occupied by work on v3, however, I have encountered a problem when packaging a VCS package for AUR.

The issue is about MavenUtil class which uses a hardcoded path for Maven local repository, which may be affected by MAVEN_USER_HOME or other Maven settings:

/**
* @return Local directory containing downloaded maven artifacts.
*/
public static Path getMavenHome() {
return Paths.get(System.getProperty("user.home"), ".m2", "repository");
}

In my AUR package I resorted to use of the following patch:

171a172,173
>  		if (System.getenv("MAVEN_USER_HOME") != null)
>  			return Paths.get(System.getenv("MAVEN_USER_HOME"), "repository");

I think it wouldn't harm to also account for environment variable or Maven settings, if possible, instead of using hardcoded path. Thank you.

@dreamscached dreamscached changed the title Respect MAVEN_USER_HOME in several resource-involving tests Respect MAVEN_USER_HOME in MavenUtil Mar 3, 2023
@dreamscached
Copy link
Author

Originally it was an issue with tests being run and creating ~/.m2 folder without being told so, since Maven was set to use custom settings.xml which clearly defined that Maven home folder wasn't in ~/.m2 but somewhere else.

@Col-E
Copy link
Owner

Col-E commented Mar 3, 2023

I'm unsure if version 2 is still being maintained

That is correct, I am currently busy with v3. In fact, there's a heavy rewrite going underway. But with that in mind, outline all your needs and I'll see what I can do about addressing them in v3.

For awareness, v3 is going to be bumping the minimum version of Java required to run Recaf, most likely to 17.

The plan is to have a launcher module for users not using a package manager, and then publish the necessary files for repository maintainers to keep their own mechanisms for keeping up-to-date without the launcher.

Using the following patch

👍

Looks like a fine solution.

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

No branches or pull requests

2 participants