gradle can not find a solution in a jar package build time

  A few days ago the company to new people, I gave him when installed project environment encountered a problem, a series of errors encountered in the implementation of gradle build, I analyzed and solved one by one, hereby record for others to reference.

First, first encountered the error can not find the spring-boot-related jar package

  The main contents of this error is not Benpian, so just talk about solutions to the problem is due to the speed is too slow, when you download jar package for a long time due to no response, the address is changed maven repository Ali cloud images can address warehouse significantly improve download speed

In the following configuration build.gradle

repositories {
    mavenLocal()
    maven {
        url 'https://maven.aliyun.com/nexus/content/groups/public/'
    }
    maven {
        url 'http://repo.spring.io/milestone'
    }
    mavenCentral()
}

 

Second, the second problem is that there is a jar package does not exist in a maven repository

  Later changed Ali cloud image, there is a jar or packet retries are not able to find any case, as shown in FIG.

 

This is a jar package to generate verification codes, a year ago for the first time build this project on my computer, then you can also be downloaded to, but now the central warehouse jar package has been removed, during which I tried to use similar packages, such as jar

compile group: 'com.liferay', name: 'nl.captcha.simplecaptcha', version: '1.1.1'

But while build but by the time the error is still running, but unfortunately I can only think of other ways, then I can consider whether the existing jar package into the next project, manually add, let gradle at build time no longer central warehouse request and then I found a jar package on my own computer location

 

gradle warehouse address is not configured GRADLE_USER_HOME words in the environment variable by default in the C drive. I changed gradleJar file in a folder under the D drive

The first file folder as shown in Figure put the jar package, the second folder put the pom file, compressed package sent to me labeled as a new e-mail

 Then is the most critical step, modify the configuration file, manually add the jar package

1. Create a project in an empty folder, such as libs, go into the jar package

 

2, modify the configuration file Repositories, shown in FIG.

 

flatDir{
dirs 'libs'
}

3, dependent on the jar still have to specify the configuration of the jar, as shown in

Configuration parameters on mvn jar package can go to the official website. Mitsuke.

And then perform gradle build on it

 

Attached

This link:  https://www.cnblogs.com/zizaiwuyou/p/11408820.html

 maven official website: https://mvnrepository.com/

The final step Reference article: https://blog.csdn.net/qq_40521919/article/details/80055432

 

Guess you like

Origin www.cnblogs.com/zizaiwuyou/p/11408820.html