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

The ${MVND_HOME}/mvn/conf/setting.xml is not used #553

Closed
Fzoss opened this issue Dec 30, 2021 · 4 comments · Fixed by #573
Closed

The ${MVND_HOME}/mvn/conf/setting.xml is not used #553

Fzoss opened this issue Dec 30, 2021 · 4 comments · Fixed by #573

Comments

@Fzoss
Copy link

Fzoss commented Dec 30, 2021

When I installed it on the windows system and replaced the conf/setting.xml in mvn in the directory with the configuration I used normally, it didn’t seem to take effect, which made me unable to package normally.

After researching, it seems that the configuration can be specified through maven.settings in mvnd.properties. The example given is ~/.m2/settings.xml.
In other words, I can directly specify my configuration file here, so I wrote this:

maven.settings=C:\ProgramData\chocolatey\lib\maven\apache-maven-3.8.3\conf\settings.xml

But it still didn't work when I tested it.
For example, when I compile under D:/root, mvnd tells me that the directory of setting.xml is:

D:/root\C:ProgramDatachocolateylibmavenapache-maven-3.8.3confsettings.xml

After flipping through, I found this:
#383
Thanks to @ppalaga for providing an example: /path/to/settings.xml
It made me realize that it may be because the directory symbol "\" under windows is considered to be an escape character
I tried to modify it

maven.settings=C:/ProgramData/chocolatey/lib/maven/apache-maven-3.8.3/conf/settings.xml

everything is normal

I recommend using File.separator to determine the file symbol of the current system and replace the configuration

@mstao
Copy link

mstao commented Dec 31, 2021

Hi, you can use ./mvn/conf/settings.xml , such as :

maven.settings=E://D//software//mvnd-0.7.1-windows-amd64//mvn//conf//settings.xml

@ppalaga
Copy link
Contributor

ppalaga commented Jan 4, 2022

@Fzoss I guess the issue happens because backslash has a special meaning (escape character) in Java Property files. Could you please try whether the following works for you?

maven.settings=C:\\ProgramData\\chocolatey\\lib\\maven\\apache-maven-3.8.3\\conf\\settings.xml

@gnodet gnodet changed the title Windows configuration mvn/conf/setting.xml does not take effect The mvnd/mvn/conf/setting.xml is not used Jan 7, 2022
@gnodet gnodet changed the title The mvnd/mvn/conf/setting.xml is not used The ${MVND_HOME}/mvn/conf/setting.xml is not used Jan 7, 2022
@gnodet
Copy link
Contributor

gnodet commented Jan 7, 2022

I found out that the original problem raised in this issue is that the global settings file is not used at all. The reason is that the maven.conf system property is not set at all by mvnd.

@Fzoss
Copy link
Author

Fzoss commented Jan 7, 2022

I found out that the original problem raised in this issue is that the global settings file is not used at all. The reason is that the maven.conf system property is not set at all by mvnd.

After I replaced the built-in maven setting.xml and found it invalid, I thought mvnd might just have to bring the setting.xml file, but mvnd wasn't going to use it.
I didn't think it was a bug at the time, so I changed my mind and tried to change the location of setting.xml in maven.settings.

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 a pull request may close this issue.

4 participants