Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I stop Maven from looking in all remote repositories for pom files of dependencies that are already installed to my local repository?

Tags:

maven-2

maven

In my Maven2 project, I am depending on a jar (mule-core-2.2.1.jar) that has two dependencies which are located in remote repositories but which do not have pom files defined. So my mvn command is initially able to pull down the jars, BUT the problem is that every single time I run a mvn command, it checks every single repository for both of these poms. Can I tell mvn not to check for these poms since I already have the jar in my .m2 directory?

like image 613
awynne Avatar asked Nov 15 '22 06:11

awynne


1 Answers

Have you thought about just creating a POM? You could install the POM-less artifacts using

mvn install:install-file \
-Dfile=sample-artifactA-2.2.1.jar \
-DgroupId=org.mule.or.wathesle \
-DartifactId=sample-artifactA \
-Dversion=2.2.1 \
-Dpackaging=jar \
-DgeneratePom=true

Once the artifact has a POM Maven shouldn't need to check anymore.

like image 153
Michael Rutherfurd Avatar answered May 11 '23 04:05

Michael Rutherfurd