How to get a complete set of dependent libraries using Gradle in advance when you cannot build a project using Gradle for various reasons ().
Just create a suitable Java Gradle project and write dependencies and tasks.
The sample specifies JasperReports and its own iText (and the libraries they depend on).
build.gradle
plugins {
id 'java'
}
sourceCompatibility = 1.8
repositories {
mavenCentral artifactUrls: [
'http://jaspersoft.artifactoryonline.com/jaspersoft/third-party-ce-artifacts/'
]
}
configurations {
//It doesn't build the project, so it only shows that it depends.
dependentLib
}
dependencies {
dependentLib 'net.sf.jasperreports:jasperreports:6.6.0'
dependentLib 'com.lowagie:itext:2.1.7.js6'
}
//Task to copy dependent libraries
task ('copyLib', type: Copy) {
from configurations.dependentLib
into 'build/lib'
}
After that, you can get a set of jars with gradlew copy Lib.
Recommended Posts