Download a dependent jar package via Gradle

Source: Internet
Author: User

It's a lot simpler to look at Gradle articles than Ant or Maven in the last few days, especially when downloading jar dependencies is a small example of a jar package dependency download written with Gradle:

(1) Establishment of BUILD.GRADLE documents

(2) The contents are as follows:

Apply plugin: ' java '


repositories {
Mavencentral ()
}


dependencies {
Compile "javax.servlet:javax.servlet-api:3.1-b07",
"org.slf4j:slf4j-log4j12:1.7.5",
"org.slf4j:slf4j-jdk14:1.7.5",
"Mysql:mysql-connector-java:5.1.24"

}


Task Copyjars (type:copy) {
From Configurations.runtime
Into ' lib '//target location
}


(3) command line run: Gradle copyjars

(4) The Lib directory is the jar package you need, Gradle will automatically analyze the jar where dependencies are downloaded


Where the red tag content is obtained. It's a good place.

Http://www.mvnrepository.com/artifact/org.springframework/spring-core/3.2.4.RELEASE

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.