I am creating parent-pom. There we are defining build->plugin->dependencies. It can fetch dependencies from maven but it couldn't fetch dependencies from our internal Maven repository. getting below error
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.2:check (validate) on project parent-pom: Execution validate of goal org.apache.maven.plugins:maven-antrun-plugin:1.2:check failed: Plugin org.apache.maven.plugins:maven-antrun-plugin:1.2 or one of its dependencies could not be resolved: Could not find artifact org.tools:build-tool:jar:1.0 in central (https://repo.maven.apache.org/maven2) -> [Help 1]
It is trying to pull dependency from https://repo.maven.apache.org/maven2 instead of our internal Maven repository. I have configured repositories and dependencyManagement still it is trying to fetch from https://repo.maven.apache.org/maven2 instead of going to our internal repositories.
pom.xml
<?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.global</groupId> <artifactId>parent-pom</artifactId> <version>1.0.0</version> <packaging>pom</packaging> <repositories> <repository> <id>archiva.global</id> <name>Internal Release Repository</name> <url>https://archiva.global.com/repository/internal</url> </repository> <repository> <id>archiva.snapshots</id> <name>Internal Snapshots Repository</name> <url>https://archiva.global.com/repository/snapshots</url> <snapshots> <enabled>true</enabled> <updatePolicy>always</updatePolicy> </snapshots> </repository> </repositories> <distributionManagement> <repository> <id>archiva.internal</id> <name>Internal Release Repository</name> <url>https://archiva.global.com/repository/internal</url> </repository> <snapshotRepository> <id>archiva.snapshots</id> <name>Internal Snapshots Repository</name> <url>https://archiva.global.com/repository/snapshots</url> </snapshotRepository> </distributionManagement> <project> ... <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-antrun-plugin</artifactId> <version>1.2</version> ... <dependencies> <dependency> <groupId>org.apache.ant</groupId> <artifactId>ant</artifactId> <version>1.7.1</version> </dependency> <dependency> <groupId>org.apache.ant</groupId> <artifactId>ant-launcher</artifactId> <version>1.7.1</version> </dependency> <dependency> <groupId>org.tools</groupId> <artifactId>build-tool</artifactId> <version>1.0</version> </dependency> </dependencies> </plugin> </plugins> </build> ... </project> Is there anything I missed? Only build plugin dependencies are not resolved where as project dependencies are getting resolved from our internal repository.
https://archiva.global.com/repository/internal. I defined in <repositories> and <distributionManagement> section.org.tools:build-tool:jar:1.0. It is internal for our project so we cannot find this in Maven central