【问题标题】:Spring Boot Mobile dependency not found未找到 Spring Boot Mobile 依赖项
【发布时间】: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 和其他人。
  • 您能否尝试使用&lt;artifactId&gt;spring-mobile-starter&lt;/artifactId&gt;(按照Spring Mobile 的说明),看看是否能解决您的问题(如果是,旧项目已被弃用(从2015 年开始))跨度>
  • 我试过&lt;artifactId&gt;spring-mobile-starter&lt;/artifactId&gt;,但它仍然说找不到。我不知道您使用:https://repo.spring.io/release 是什么意思。

标签: java spring-boot maven dependencies pom.xml


【解决方案1】:

我通过下载 .jar 文件并将其添加到项目中解决了这个问题:

File -> Project Structure -> Modules -> Dependencies -> + 

现在可以了。

【讨论】:

    猜你喜欢
    • 2020-03-31
    • 2018-01-10
    • 1970-01-01
    • 2021-07-24
    • 2020-10-08
    • 1970-01-01
    • 2020-08-28
    • 2017-05-17
    • 2022-01-23
    相关资源
    最近更新 更多