LiquidMusic1
LiquidMusic1

Reputation: 55

How to structure "lib" in Spring Boot application?

In Java, the most acceptable manner of referencing JAR files that are project-specific is from a lib folder at the root of the project. Example: A project is written as a service which references a JAR file that communicates with the actual endpoint. That JAR file is not stored in "External Libraries". It is stored in a lib folder at the root of the project with many other jars that are used by the project.

What is the most accepted convention of storing external JAR files within a Spring Boot application? Same? Different?

Upvotes: 0

Views: 1546

Answers (1)

Andy Brown
Andy Brown

Reputation: 13009

We've done exactly as you describe with spring-boot with an unusual jar dependency that could not be uploaded to a repo because of vendor licensing issues. The jar was copied into the lib directory at the project root and referenced in gradle like this:

compile fileTree(dir: "lib", include: ["the-jar-filename.jar"])

We've had no issues with this solution.

Upvotes: 1

Related Questions