Spring Boot移动依赖未找到

huangapple go评论108阅读模式
英文:

Spring Boot Mobile dependency not found

问题

我正在尝试使用 spring-boot-mobile 依赖项来检测用户是否使用移动平台(如果是的话,显示消息),但我遇到了这个错误:

依赖 'org.springframework.mobile:spring-mobile-device:1.1.5.RELEASE' 未找到
标签名称:groupId
描述:产生依赖项的项目组,例如 org.apache.maven。
版本: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,以及从 IntelliJ IDEA 进行的 clean install。

英文:

I'm trying to use the spring-boot-mobile dependency for detecting if the user uses mobile platform ( and if so, to display on message ), but I get this error:

Dependency &#39;org.springframework.mobile:spring-mobile-device:1.1.5.RELEASE&#39; not found 
Tag name: groupId Description : The project group that produced the dependency, e.g. org.apache.maven. Version : 3.0.0+
 &lt;dependency&gt;
            &lt;groupId&gt;org.springframework.mobile&lt;/groupId&gt;
            &lt;artifactId&gt;spring-mobile-device&lt;/artifactId&gt;
            &lt;version&gt;1.1.5.RELEASE&lt;/version&gt;
        &lt;/dependency&gt;
 &lt;repositories&gt;
    &lt;repository&gt;
        &lt;id&gt;spring-repo&lt;/id&gt;
        &lt;name&gt;Spring Repository&lt;/name&gt;
        &lt;url&gt;http://repo.spring.io/release&lt;/url&gt;
    &lt;/repository&gt;
        &lt;repository&gt;
            &lt;id&gt;spring-milestone&lt;/id&gt;
            &lt;name&gt;Spring Milestone Repository&lt;/name&gt;
            &lt;url&gt;http://repo.spring.io/milestone&lt;/url&gt;
        &lt;/repository&gt;
        &lt;repository&gt;
            &lt;id&gt;spring-snapshot&lt;/id&gt;
            &lt;name&gt;Spring Snapshot Repository&lt;/name&gt;
            &lt;url&gt;http://repo.spring.io/snapshot&lt;/url&gt;
        &lt;/repository&gt;
    &lt;/repositories&gt;

I'm using spring boot 2.3.0:

 &lt;parent&gt;
        &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
        &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
        &lt;version&gt;2.3.0.RELEASE&lt;/version&gt;
        &lt;relativePath/&gt;
    &lt;/parent&gt;

I already tried mvn clean install -U, and clean install from the intelij idea.

答案1

得分: 0

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

文件 -> 项目结构 -> 模块 -> 依赖项 -> + 

现在它可以正常工作。

英文:

I solved this issue by downloading the .jar file and adding it in the project:

File -&gt; Project Structure -&gt; Modules -&gt; Dependencies -&gt; + 

Now it works.

huangapple
  • 本文由 发表于 2020年7月22日 15:50:27
  • 转载请务必保留本文链接:https://go.coder-hub.com/63029344.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定