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

Add the java.configuration.maven.globalSettings property #1586

Merged
merged 1 commit into from
Oct 31, 2020

Conversation

snjeza
Copy link
Contributor

@snjeza snjeza commented Oct 28, 2020

Signed-off-by: Snjezana Peco <snjezana.peco@redhat.com>
Copy link
Contributor

@rgrunber rgrunber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me but I think the default behaviour for global settings is missing (eg. if I leave the global settings empty).

From what I can tell, the default locations are
user settings : ${user.home}/.m2/settings.xml
globale settings : ${maven.home}/conf/settings.xml .

As an example, I tried adding something like <localRepository>${user.home}/.m2-user<localRepository> to my default user settings file and imported a maven project . Even though I had never touched the vscode settings, the local repository was created at that location. I assume this is because m2e checks the default user location when no explicit setting is defined.

I tried the same thing by placing <localRepository>${user.home}/.m2-global<localRepository> in my default global settings file. In my case this was /usr/share/maven/conf/settings.xml. This didn't work from before or with this patch.

I'm not sure if this is API we need to be calling in m2e but it would be nice to preserve this behaviour.

@snjeza
Copy link
Contributor Author

snjeza commented Oct 29, 2020

Works for me but I think the default behaviour for global settings is missing (eg. if I leave the global settings empty).

m2e configures the default behaviour. Eclipse works in the same way.

@rgrunber
Copy link
Contributor

Yup, looks like MavenImpl would need to change. There's a few places where a "default" user setting file is set initially, prior to checking if one already exists, but the same isn't done for the global one (line 440 vs. line 458).

In this case, I think this patch is fine. I'll have one last look at the patch itself.

@rgrunber
Copy link
Contributor

@snjeza Sorry for the delay. Feel free to merge this.

@snjeza snjeza merged commit ff5e0a1 into eclipse-jdtls:master Oct 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add the java.configuration.maven.globalSettings property
2 participants