在我的Maven2项目中,我依赖于一个名为mule-core-2.2.1.jar的jar包,它有两个依赖项位于远程仓库中,但没有定义pom文件。因此,我的mvn命令最初能够下载这些jar包,但问题是每次运行mvn命令时,它都会检查每个仓库中这两个pom文件。我能否告诉mvn不要检查这些pom文件,因为我已经在.m2目录中拥有了这个jar包?
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
一旦构件有了POM,Maven就不需要再进行检查了。
试试这个:
<dependency>
<groupId>org.mule.or.wathesle</groupId>
<artifactId>mule-core</artifactId>
<version>YOUR_MULE_VERSION</version>
<exclusions>
<exclusion>
<groupId>sample.group</groupId>
<artifactId>sample-artifactAB</artifactId>
</exclusion>
</exclusions>
</dependency>