Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

To add a JAR to a layered lib/ directory in Spring Boot, follow these steps:

  1. Create a new directory called "lib" in the root of your project.

  2. Copy the JAR file that you want to add to the lib directory.

  3. Edit your build.gradle or pom.xml file to include the following:

    For Gradle:

    dependencies { compile fileTree(dir: 'lib', include: ['*.jar']) }

    For Maven:

    <dependencies> <dependency> <groupid>com.example</groupid> <artifactid>example-library</artifactid> <version>1.0.0</version> <scope>system</scope> <systempath>${basedir}/lib/example-library.jar</systempath> </dependency> </dependencies>

  4. Build your project.

  5. Start your Spring Boot application.

  6. The JAR file that you added to the lib directory should automatically be loaded by Spring Boot.