简体   繁体   中英

Maven trying to download a local dependency

I'm working on an API that depends on a small library I created in my project. In IntelliJ IDEA, it looks like :

PROJECT : myProject

  • MODULE : mySimpleAPI (maven project + spring boot application)
  • MODULE : mySmallLib (maven project)

I just added mySmallLib in mySpringAPI's dependencies.

But when I execute the spring-boot:run command, it tried to download the dependency from spring repositories. I tried in offline mode, but it also didn't work. How can I tell to maven that the dependency is already in the project and it doesn't need to download it ?

Seems your code/library is not updating automatically. So you will need to update them manually.

Go to each sub module of your project and open pom.xml. now right click on the file and click on clean install.

IntelliJ中的示例Maven全新安装

Try running your application again, and it should work. Let me know if it doesn't.

run mvn clean install on "mySmallLib" project first. This will install the jar in your local maven repo. Then you can perform mvn spring-boot:run on "mySimpleAPI" project.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM