maven中缺少工件com.msg91.sendotp。

问题描述 投票:0回答:1

当我在spring tool suits中添加库时,我得到这个错误。

'Missing artifact com.msg91.sendotp.library:library:jar:3.2'。

我已经在我的pom.xml中添加了这个库。https:/mvnrepository.comartifactcom.msg91.sendotp.library3.2。

这是我的pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.1.6.RELEASE</version>
    <relativePath /> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
<artifactId>springdemouser</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>springdemouser</name>
<description>Demo project for Spring Boot</description>

<properties>
    <java.version>1.8</java.version>
</properties>

<dependencies>

    <!-- HERE I AM GETTING ERROR -->
    <dependency>
        <groupId>com.msg91.sendotp.library</groupId>
        <artifactId>library</artifactId>
        <version>3.2</version>      
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>


<!-- other dependencies here... -->

</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>

java spring maven sms-gateway
1个回答
0
投票

我可以看到在 pom.xml 如下所述

  1. 如果你看这个库的mvnrepository链接,上面写着 this artifact it located at JCenter repository. 由于你没有分享完整的 pom.xml 文件中不清楚是否添加了JCenter repo。简单的方法是在 pom.xml 档案
<repositories>
    <repository>
      <id>jcenter</id>
      <name>jcenter</name>
      <url>https://jcenter.bintray.com</url>
    </repository>
</repositories>
  1. 您需要添加 <type> 作为 aar 到你的maven依赖关系中,否则它将尝试搜索 .jar 仓库中没有的文件。
  <!-- https://mvnrepository.com/artifact/com.msg91.sendotp.library/library -->
<dependency>
    <groupId>com.msg91.sendotp.library</groupId>
    <artifactId>library</artifactId>
    <version>3.2</version>
    <type>aar</type>
</dependency>

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.