GithubHelp home page GithubHelp logo

salme1541 / spring-boot-propertieslauncher-with-external-jar Goto Github PK

View Code? Open in Web Editor NEW

This project forked from markiewb/spring-boot-propertieslauncher-with-external-jar

0.0 1.0 0.0 1.81 MB

Example for a self-executable Spring Boot JAR, which accesses a 3rd-party JAR from a external directory.

License: The Unlicense

Shell 68.45% Java 31.55%

spring-boot-propertieslauncher-with-external-jar's Introduction

Example for a self-executable Spring Boot JAR, which accesses a DB driver (or any other 3rd-party JAR) from a external (non-bundled) directory.

This may be useful if you are not allowed to bundle the DB driver with your application.

Tips:

  • Use ZIP as layout in spring-boot-maven-plugin (to generate the PropertiesLauncher entry in the MANIFEST.MF)
  • Set <executable>true</executable> to prepend a shell script to the resulting JAR
  • See command line examples for different types of running the JAR using the loader.path option

Expected result

Have a look for the output

Try to use external driver
-------------> Found driver h2 1.4

in all variants. The same application is started using different types of loading an external jar.

--------------------------
Variant A via java -jar
--------------------------
...
2019-04-25 22:51:59.934  INFO 26947 --- [           main] com.example.x.Application                : Started Application in 6.005 seconds (JVM running for 6.465)
Try to use external driver
-------------> Found driver h2 1.4

--------------------------
Variant B via java -jar
--------------------------
...
2019-04-25 22:52:06.447  INFO 26948 --- [           main] com.example.x.Application                : Started Application in 5.996 seconds (JVM running for 6.456)
Try to use external driver
-------------> Found driver h2 1.4

------------------------------------------------------------------------------------------------
Variant C via self-executable and loader.path-configuration from (default-) loader.properties
------------------------------------------------------------------------------------------------
...
Try to use external driver
-------------> Found driver h2 1.4

--------------------------------------------------------------------------------------------
Variant D via self-executable and loader.path-configuration from different property file 
--------------------------------------------------------------------------------------------
...
2019-04-25 22:52:19.494  INFO 26979 --- [           main] com.example.x.Application                : Started Application in 6.005 seconds (JVM running for 6.453)
Try to use external driver
-------------> Found driver h2 1.4

------------------------------------------------------------
Variant E via self-executable and LOADER_PATH environment
------------------------------------------------------------
...
2019-04-25 22:52:26.024  INFO 26995 --- [           main] com.example.x.Application                : Started Application in 5.967 seconds (JVM running for 6.439)
Try to use external driver
-------------> Found driver h2 1.4

spring-boot-propertieslauncher-with-external-jar's People

Contributors

markiewb avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.