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
There is conf/settings.xml under apache_maven directory. If I change the maven_home parameter from the IDE, I want it to read the settings from the new home too. Why am I forced to .m2 when I can change maven_home whenever I want?
settings.xml in maven home is supposed to be for all users on you computer.
you have you personal .m2 containing your settings.xml
personal + global are merged but personal take precedence. Remove settings.xml from you .m2 and you respect maven way of handling settings.
IMHO We should not alter Maven way of managing settings.xml
I would change the description of this issue to allow setting path to the settings.xml globally in Maven settings (ideally also per project). IntelliJ Idea allows that and it's then possible to use different Maven settings (including a different local repository) for different projects if the settings collide (e.g. when working on projects for different clients)
Adding -s option to the text field works in the sense that the build passes. But Netbeans shows a lot of errors in thr project view, because it's trying to find the dependencies in the standard local repo path where they don't exist. Repository in the services view also shows only the standard local repo.
@OndroMih The Services view also has an Add repository option that might be of use there. Not sure if there's anything that might get this configured on a per-project level though.
Adding -s option to the text field works in the sense that the build passes. But Netbeans shows a lot of errors in thr project view, because it's trying to find the dependencies in the standard local repo path where they don't exist. Repository in the services view also shows only the standard local repo.
Also the settings.xml file show in Project Files seems to be hard coded to ~/.m2/settings.xml
It would make more sense to show the one configured with -s option.
Additionally it would be great if -s option can be set per Project Group. Currently it's only possible to set Maven Home.
In any case NetBeans should use internally the same settings.xml as the maven build. And show it in Project Files, so it can be viewed or edited in NetBeans if necessary.
I also tried to configure a completely separate maven with a separated local repository. I use one maven configuration for the whole user it is in ~/.m2/settings then I have another maven and set in its settings.xmllocalRepository to a different folder. Then I override maven options with -s. Everything looks ok. I see local repository in in Maven Repositories and its artifacts. But the project is marked as unloadable and still tries to use artificats from ~/.m2/repository. It builds totally ok without any issue but Netbeans simply does not use localRepository configuration.
The error is:
1 problem was encountered while building the effective model for com.example.project-parent:1.0.1-SNAPSHOT
[FATAL] Non-resolvable parent POM for com.example.project-parent:1.0.1-SNAPSHOT: The following artifacts could not be resolved: org.springframework.boot:spring-boot-starter-parent:pom:3.3.4 (present, but unavailable): Cannot access internal.repository (https://example.com/repository/maven-public/) in offline mode and the artifact org.springframework.boot:spring-boot-starter-parent:pom:3.3.4 has not been downloaded from it before. and 'parent.relativePath' points at no local POM
If I click on Resolve Project Problems it builds everything and shows (but the project is still unloadable):
Activity
mbien commentedon Jun 21, 2022
Maven Home sets the path to maven. The
.m2directory is shared since it is the default which also means.m2/settings.xmlis shared too.I don't see how changing Maven Home would influence what settings.xml is read.
ganigurgah commentedon Jun 23, 2022
There is conf/settings.xml under apache_maven directory. If I change the maven_home parameter from the IDE, I want it to read the settings from the new home too. Why am I forced to .m2 when I can change maven_home whenever I want?
ebarboni commentedon Jun 23, 2022
settings.xml in maven home is supposed to be for all users on you computer.
you have you personal .m2 containing your settings.xml
personal + global are merged but personal take precedence. Remove settings.xml from you .m2 and you respect maven way of handling settings.
IMHO We should not alter Maven way of managing settings.xml
Edited to show rational from official documentation:
https://maven.apache.org/settings.html Quick Overview section
tbw777 commentedon Jul 2, 2022
but there is no
options in nb:
OndroMih commentedon Jul 5, 2022
I would change the description of this issue to allow setting path to the settings.xml globally in Maven settings (ideally also per project). IntelliJ Idea allows that and it's then possible to use different Maven settings (including a different local repository) for different projects if the settings collide (e.g. when working on projects for different clients)
neilcsmith-net commentedon Jul 5, 2022
@tbw777 did you try just adding the CLI options directly to the text field?
OndroMih commentedon Jul 7, 2022
Adding -s option to the text field works in the sense that the build passes. But Netbeans shows a lot of errors in thr project view, because it's trying to find the dependencies in the standard local repo path where they don't exist. Repository in the services view also shows only the standard local repo.
neilcsmith-net commentedon Jul 7, 2022
@OndroMih The
Servicesview also has anAdd repositoryoption that might be of use there. Not sure if there's anything that might get this configured on a per-project level though.todor-t commentedon Mar 1, 2023
Also the settings.xml file show in Project Files seems to be hard coded to ~/.m2/settings.xml
It would make more sense to show the one configured with -s option.
Additionally it would be great if -s option can be set per Project Group. Currently it's only possible to set Maven Home.
In any case NetBeans should use internally the same settings.xml as the maven build. And show it in Project Files, so it can be viewed or edited in NetBeans if necessary.
Saljack commentedon Nov 12, 2024
I also tried to configure a completely separate maven with a separated local repository. I use one maven configuration for the whole user it is in
~/.m2/settingsthen I have another maven and set in itssettings.xmllocalRepositoryto a different folder. Then I override maven options with-s. Everything looks ok. I see local repository in in Maven Repositories and its artifacts. But the project is marked as unloadable and still tries to use artificats from~/.m2/repository. It builds totally ok without any issue but Netbeans simply does not uselocalRepositoryconfiguration.The error is:
If I click on Resolve Project Problems it builds everything and shows (but the project is still unloadable):
