0

Consider the following pom.xml:

<project xmlns="http://maven.apache.org/POM/4.0.0">
    <modelVersion>4.0.0</modelVersion>
    <artifactId>bob</artifactId>
    <groupId>alice</groupId>
    <version>omicron</version>
    <pluginRepositories>
        <pluginRepository>
            <id>central</id>
            <name>My Little Nexus</name>
            <url>http://nexus.example.com:8080/nexus/content/groups/main/</url>
        </pluginRepository>
    </pluginRepositories>
</project>

When I try to run mvn clean using the file above, the following appears in the output:

Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom

Any idea why? I thought that having my own repo with an id of central should prevent this?

Mark VY
  • 1,489
  • 16
  • 31
  • 1
    If you want to use a repository manager like nexus you should configure that in your `settings.xml` not in the pom file.. – khmarbaise Dec 07 '21 at 18:19
  • how? using ``? or no? – Mark VY Dec 07 '21 at 19:03
  • 1
    Does your nexus.example.com have the maven-clean-plugin? Maybe [Maven docs](https://maven.apache.org/guides/mini/guide-multiple-repositories.html#repository-order) will be of some help to you? – SiKing Dec 07 '21 at 20:09
  • Whether my example repo has the plugin or not is actually unrelated to the question I'm trying to ask. If it's not there, then I expect the build to fail. What I did not expect is for it to look in maven central. In fact, as far as I can tell from the build logs, maven central is the FIRST thing it tries. What I want to know is the answer to one or both of the following questions. 1. why is it looking in maven central, given that the pom file tells it not to? and 2. how do I get it to stop? The link to the docs is appreciated, but I don't see how order is relevant: there's only 1 repo – Mark VY Dec 07 '21 at 20:19
  • This might be related to the maven version. It works if I downgrade to 3.6.3, but not if use 3.8.1 – Mark VY Dec 07 '21 at 20:39
  • Seems related to this: https://stackoverflow.com/questions/67001968/how-to-disable-maven-blocking-external-http-repositores – Mark VY Dec 07 '21 at 20:48

0 Answers0