maven 中缺少工件 com.msg91.sendotp

Missing artifact com.msg91.sendotp in maven

当我在 spring 工具套装中添加库时,出现此错误:

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

我已经在我的 pom.xml https://mvnrepository.com/artifact/com.msg91.sendotp.library/library/3.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>

我发现 pom.xml 中缺少一些内容,如下所述

  1. 如果您查看此库的 mvnrepository link,它会显示 this artifact it located at JCenter repository。由于您尚未共享完整的 pom.xml 文件,因此不清楚是否已添加 JCenter 存储库。简单的方法是在 pom.xml 文件
  2. 中包含以下内容
<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>