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