A repository linked in a dependency's pom should be used when handling its dependencies (according to the question Are Maven repository declarations transitive?). Unfortunately, it doesn't happen in my case.
My project has dependency org.apache.calcite:calcite-avatica:1.0.0-incubating
. The pom of calcite-avatica requires the dependency eigenbase:eigenbase-properties:1.1.4
and adds conjar repository in <repositories>
, as this is the only place where eigenbase-properties 1.1.4 can be found. When I try to build the project, I get an error:
Could not find artifact eigenbase:eigenbase-properties:pom:1.1.4 in central (https://repo.maven.apache.org/maven2)
Why is eigenbase-properties
not pulled from conjar repository? Only repository from my project is queried, while the linked repository isn't.
My minimal pom for reference:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>unresolved-dependency</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
<dependencies>
<!-- https://mvnrepository.com/artifact/org.apache.calcite/calcite-avatica -->
<dependency>
<groupId>org.apache.calcite</groupId>
<artifactId>calcite-avatica</artifactId>
<version>1.0.0-incubating</version>
</dependency>
</dependencies>
</project>
I'm using JDK 1.8 (as seen in the pom) and Maven 3.6.3 (to exclude the possibility that conjar is blocked as an external http repository, which is the default since 3.8.1; see How to disable maven blocking external HTTP repositores?).
It also isn't the case that I have some mirrors specified, as was the cause in the question: maven can't get dependency from transitive repository (sometimes).