How do I stop Maven 2.x from trying to retrieve non-existent pom.xml files for dependencies every build?

后端 未结 4 2072
灰色年华
灰色年华 2021-02-14 11:59

In my project, there are a number of dependencies that are transitively included from other dependencies that do not have pom.xml files available in any of our corporate reposit

4条回答
  •  灰色年华
    2021-02-14 12:39

    Downloading a POM is really a central concept in Maven to support transitive dependencies (actually, a dependency isn't just a JAR, see 3.5.5. Maven's Dependency Management for nice details on that) so I don't know if you can prevent it.

    Of course, the right thing to do would be to fix the root cause of the problem. But if you can't, maybe you can run your build in offline mode (using the -o option). Or maybe you could just "install" the artifacts in your local repository using install:install-file and instruct the plugin to generate a pom for them using the generatePom optional parameter (but this obviously doesn't "scale" really well).

提交回复
热议问题