为了账号安全,请及时绑定邮箱和手机立即绑定

Maven:在尝试在线之前如何配置以使用本地存在的工件 (~/.m2/repository)?

Maven:在尝试在线之前如何配置以使用本地存在的工件 (~/.m2/repository)?

牛魔王的故事 2021-06-30 15:43:37
在本地有两个 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>


查看完整回答
反对 回复 2021-07-14
  • 1 回答
  • 0 关注
  • 206 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信