在本地有兩個 maven 項目,即Authentication和Commons,我需要使用 Commons 作為 Authentication 的 pom.xml 中的依賴項,在 Commons 根目錄中~/.m2/repository運行后正確部署在本地存儲庫中mvn clean install。但是,當我maven clean install在身份驗證根目錄中運行時,我不知道如何阻止它嘗試從在線下載此本地依賴項。這是我得到的錯誤:[ERROR] Failed to execute goal on project authentication: Could not resolve dependencies for project io.project:authentication:jar:0.0.1-SNAPSHOT: Failure to find io.project.commons:project-commons:jar:0.0.1.RELEASE in https://repo.spring.io/snapshot was cached in the local repository, resolution will not be reattempted until the update interval of spring-snapshots has elapsed or updates are forced這是的pom Authentication:http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0<groupId>io.project</groupId><artifactId>authentication</artifactId><version>0.0.1-SNAPSHOT</version><packaging>jar</packaging><name>authentication</name><description>Demo project for Spring Boot</description><parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.0.5.BUILD-SNAPSHOT</version> <relativePath/> <!-- lookup parent from repository --></parent><properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <java.version>1.8</java.version> <spring-cloud.version>Finchley.BUILD-SNAPSHOT</spring-cloud.version></properties><dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-security</artifactId> </dependency>
1 回答

Qyouu
TA貢獻1786條經驗 獲得超11個贊
看看你的坐標。在身份驗證中,您依賴于io.project.commons:project-commons:
<dependency>
<groupId>io.project.commons</groupId>
<artifactId>project-commons</artifactId>
<version>0.0.1.RELEASE</version>
</dependency>
但公共項目的實際坐標是io.project:project-commons:
<groupId>io.project</groupId>
<artifactId>project-commons</artifactId>
添加回答
舉報
0/150
提交
取消