Hello,
First time using a mailing list so forgive (and correct) me if I do
something wrong.
I read that before opening an issue it is better to check with the mailing
list, so here I am.

In our company we have our own artifactory repositories defined as follows
in settings.xml:
'''
<settings>
  <servers>...</servers>
  <profiles>
    <profile>
      <repositories>
        <repository>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
          <id>central</id>
          <name>libs-release</name>
          <url>.../artifactory/libs-release</url>
        </repository>
        <repository>
          <snapshots />
          <id>snapshots</id>
          <name>libs-snapshot</name>
          <url>.../artifactory/libs-snapshot</url>
        </repository>
      </repositories>
      [...]
      <id>artifactory</id>
    </profile>
  </profiles>

  <activeProfiles>
    <activeProfile>artifactory</activeProfile>
  </activeProfiles>
</settings>
'''
We never had problems with this setup but now we are trying to do this:
Have a project that define in the dependencyManagement a BOM (built by us)
(BOM 1, 0.1.0-SNAPSHOT)
That BOM has another BOM in its dependencyManagement (again built by us)
(BOM 2, 2.0.3)

Previously the project was just pointing to BOM2, now we have BOM1.
When building maven fails as it's unable to find BOM2. debugging I see:

[DEBUG] Resolving artifact my.company:bom1:pom:0.1.0-20240614.085416-4 from
[central (.../artifactory/libs-release
<https://artifactory.finantix.com/artifactory/libs-release>, default,
releases), snapshots (.../artifactory/libs-snapshot
<https://artifactory.finantix.com/artifactory/libs-snapshot>, default,
releases+snapshots)]

[...]

[DEBUG] Resolving artifact my.company:bom2:pom:2.0.3 from [snapshots (
.../artifactory/libs-snapshot
<https://artifactory.finantix.com/artifactory/libs-snapshot>, default,
releases+snapshots), central (https://repo.maven.apache.org/maven2,
default, releases)]

I tried renaming the repositories id to my-central and my-snapshots and I
get

[DEBUG] Resolving my-company:bom2:pom:2.0.3 from [my-central (
.../artifactory/libs-release
<https://artifactory.finantix.com/artifactory/libs-release>, default,
releases), my-snapshots (.../artifactory/libs-snapshot
<https://artifactory.finantix.com/artifactory/libs-snapshot>, default,
releases+snapshots), central (https://repo.maven.apache.org/maven2,
default, releases)]

But I don't understand why, only for the BOM dependency inside another BOM,
the central repository is not overridden.
Thanks for any help.
Mattia

Reply via email to