Overwriting the "central" from settings.xml when importing bom pom files

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Overwriting the "central" from settings.xml when importing bom pom files

tic01
Hi team,

When resolving bom artifacts, the following method is invoked -
org.apache.maven.model.building.DefaultModelBuilder#configureResolver(
ModelResolver modelResolver, Model model, DefaultModelProblemCollector
problems, boolean replaceRepositories )

The 'replaceRepositories' parameter is invoked with a value of 'true' which
means that Maven looks up the lineage of of projects to find a repository.
This has the effect that if for example you have in your settings.xml a
repository with the id "central" set to "REPO A" it will replace that with
repo1.

Is this the desired behavior? Is there a way to tell Maven not to override
the repositories that I have in my Maven settings.xml as this causes unsable
builds if you are behind a company firewall and must use a middle-man
(Nexus/Artifactory).

Thanks,

Tomer





--
Sent from: http://maven.40175.n5.nabble.com/Maven-Users-f40176.html

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Overwriting the "central" from settings.xml when importing bom pom files

Thomas Broyer-2
Not a direct answer but what if you use a <mirror> rather overriding the
"central" <repository>?
https://maven.apache.org/guides/mini/guide-mirror-settings.html

Le dim. 15 mars 2020 à 18:17, tic01 <[hidden email]> a écrit :

> Hi team,
>
> When resolving bom artifacts, the following method is invoked -
> org.apache.maven.model.building.DefaultModelBuilder#configureResolver(
> ModelResolver modelResolver, Model model, DefaultModelProblemCollector
> problems, boolean replaceRepositories )
>
> The 'replaceRepositories' parameter is invoked with a value of 'true' which
> means that Maven looks up the lineage of of projects to find a repository.
> This has the effect that if for example you have in your settings.xml a
> repository with the id "central" set to "REPO A" it will replace that with
> repo1.
>
> Is this the desired behavior? Is there a way to tell Maven not to override
> the repositories that I have in my Maven settings.xml as this causes
> unsable
> builds if you are behind a company firewall and must use a middle-man
> (Nexus/Artifactory).
>
> Thanks,
>
> Tomer
>
>
>
>
>
> --
> Sent from: http://maven.40175.n5.nabble.com/Maven-Users-f40176.html
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Overwriting the "central" from settings.xml when importing bom pom files

tic01
Thanks Thomas.
mirrors are an option, but I was wondering if there is a reason that only
for nested boms the override of "central" doesn't work



--
Sent from: http://maven.40175.n5.nabble.com/Maven-Users-f40176.html

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]