How to Create a Dependent Jar File from settings.gradle

Asked 1 years ago, Updated 1 years ago, 370 views

When I asked Stack Overflow in English, I couldn't get an answer, so I'll ask you a question.
The current Gradle not only creates build.gradle but also sets.gradle, and the dependencies are written there, so I think you need to use it to create a jar file, but even if you search for it, you can only find a way to create a jar file from build.gradle.
How do I create a dependent jar file from settings.gradle?

java gradle jar

2022-12-07 06:15

1 Answers

Unfortunately, it is difficult to infer the situation and what the questioner wants to do from the current questionnaire.
I need a more specific explanation.

To complement your answer with your imagination,

The only way to create a jar file from build.gradle is to search.

I don't know exactly what this method is, but I think it can be done in the same way (in most cases, the ./gradlew build command).

Also, in the directory where settings.gradle is located,

./gradlew tasks

If you run the command, you can get a list of tasks that you can perform, and you may find out by looking at them.

From this question, I was wondering if you wanted to create a fat-jar.

In this case, the single module project and the configuration method are the same.
For example, if you are using Gradle Shadow Plugin, simply set it up on a module that contains the main class.
(Project Sample )


2022-12-07 06:39

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.