我正在开发一个多模块的springboot-app,看起来像这样:
basedir
module - pom.xml
module2 - pom.xml
module3 - pom.xml <---- this project contains the Main class
pom.xml (parent pom)我有一个library.jar,由于各种原因,它不能放入我们的网络中。因此,我已经将安装到了一个项目本地存储库,下面是mvn install:install-file -Dfile=/path/myjar.jar -DgroupId=id.group -DartifactId=myjar -Dversion=1.0 -Dpackaging=jar -DlocalRepositoryPath=${project.basedir}/lib
我已经在父pom中添加了依赖项和存储库,因为所有3个模块都使用这个jar。
...
<dependency>
<artifactId>myjar</artifactId>
<version>1.0</version>
<groupId>id.group</group>
</dependency>
...
<repositories>
<repository>
<id>lib</id>
<url>file:///${project.basedir}/lib
<repository>
</repositories>但是,无论是通过IntelliJ还是在我尝试创建JAR时,都没有找到依赖项。当我执行mvn clean install时,它会忽略本地存储库,并尝试从nexus.可能是我的公司setting.xml配置有问题,还是多模块设置有问题?
发布于 2019-10-12 02:18:04
您提供的示例似乎有问题( URL标记没有关闭)-您可以尝试像以前一样在本地安装maven依赖项,然后使用maven离线开关,看看它是否正常工作
mvn -o installhttps://stackoverflow.com/questions/58346313
复制相似问题