Maven dependencies cannot be downloaded and resolved

Problem: maven dependencies cannot be downloaded,

Solution: Three-party download to the local, use the local jar package

The first solution: install the jar to the local warehouse

mvn install:install-file -Dfile=/Users/Downloads/aliyun-java-sdk-dyvmsapi-1.0.0-SNAPSHOT.jar -DgroupId=com.aliyun -DartifactId=aliyun-java-sdk-dyvmsapi -Dversion=1.0.0-SNAPSHOT -Dpackaging=jar

Detailed parameter explanation:

-Dfile: local jar package path

-DgroupId: Group ID corresponding to pom.xml <groupId>com.aliyun</groupId>

-DartifactId:对应pom.xml <artifactId>aliyun-java-sdk-dyvmsapi</artifactId>

-Dversion: The version number corresponds to pom.xml <version>1.0.0-SNAPSHOT</version>

pom.xml

        <dependency>
            <groupId>com.aliyun</groupId>
            <artifactId>aliyun-java-sdk-dyvmsapi</artifactId>
            <version>1.0.0-SNAPSHOT</version>
        </dependency>

Disadvantages: Others download the project and there is no jar project locally and cannot start normally

Method 2: Install the jar into the project

a. Introduce the project jar package

  <dependency>
            <groupId>com.aspose</groupId>
            <artifactId>aspose.slides</artifactId>
            <version>15.9.0</version>
            <scope>system</scope>
            <systemPath>${basedir}/src/lib/aspose/aspose.slides-15.9.0.jar</systemPath>
  </dependency>

b. Modify the packaging plug-in

<!--maven打包插件-->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<!-- 同时发布本地引用包 -->
<configuration>
<includeSystemScope>true</includeSystemScope>
</configuration>
</plugin>

Guess you like

Origin blog.csdn.net/gao_yuwushengchu/article/details/124129476
Recommended