[JAVA] (Note) Get a set of dependent library jars with the help of Gradle

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

(Note) Get a set of dependent library jars with the help of Gradle
Set the time of LocalDateTime to a specific time
Set the source of the library set as a dependency in IntelliJ as a separate module of the project
Create a multi-key map with the standard library
A quick note on using jshell with the official Docker image of the JDK
[Swift] Get the number of steps with CMP edometer
A review note of the Spring Framework Resource interface
Get started with Gradle
The story of building a Java version of Minecraft server with GCP (and also set a whitelist)
A story packed with the basics of Spring Boot (solved)
Check the operation of two roles with a chat application
A note about the seed function of Ruby on Rails
I tried JAX-RS and made a note of the procedure
Explain the benefits of the State pattern with a movie rating
Generate a single executable jar with dependent libraries in Gradle 4.9
[jsoup] How to get the full amount of a document
Find the number of days in a month with Kotlin
Copy dependent jars in Gradle 5
The basics of the process of making a call with an Android app
[Java1.8 +] Get the date of the next x day of the week with LocalDate
Get a proxy instance of the component itself in Spring Boot
A story about hitting the League Of Legends API with JAVA
Get the public URL of a private Flickr file in Java
A story that struggled with the introduction of Web Apple Pay
[Note] How to restart the Windows container set up with docker-compose
[Illustration] Finding the sum of coins with a recursive function [Ruby]
[Android] Dynamically set the height of ListView with copy (for beginners)
[Gradle] Build a Java project with a configuration different from the convention