【发布时间】:2020-11-11 17:01:02
【问题描述】:
我正在尝试使用 spring-boot-mobile 依赖项来检测用户是否使用移动平台(如果是,则显示在消息上),但我收到此错误:
Dependency 'org.springframework.mobile:spring-mobile-device:1.1.5.RELEASE' not found
Tag name: groupId Description : The project group that produced the dependency, e.g. org.apache.maven. Version : 3.0.0+
<dependency>
<groupId>org.springframework.mobile</groupId>
<artifactId>spring-mobile-device</artifactId>
<version>1.1.5.RELEASE</version>
</dependency>
<repositories>
<repository>
<id>spring-repo</id>
<name>Spring Repository</name>
<url>http://repo.spring.io/release</url>
</repository>
<repository>
<id>spring-milestone</id>
<name>Spring Milestone Repository</name>
<url>http://repo.spring.io/milestone</url>
</repository>
<repository>
<id>spring-snapshot</id>
<name>Spring Snapshot Repository</name>
<url>http://repo.spring.io/snapshot</url>
</repository>
</repositories>
我正在使用 Spring Boot 2.3.0:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.0.RELEASE</version>
<relativePath/>
</parent>
我已经尝试过 mvn clean install -U,并从 intelij idea 进行全新安装。
【问题讨论】:
-
repos 不接受 http 请求。请改用
https://repo.spring.io/release和其他人。 -
您能否尝试使用
<artifactId>spring-mobile-starter</artifactId>(按照Spring Mobile 的说明),看看是否能解决您的问题(如果是,旧项目已被弃用(从2015 年开始))跨度> -
我试过
<artifactId>spring-mobile-starter</artifactId>,但它仍然说找不到。我不知道您使用:https://repo.spring.io/release是什么意思。
标签: java spring-boot maven dependencies pom.xml