Giter Site home page Giter Site logo

springboot's Introduction

Packaging Springboot application with external dependencies using Maven

Spring boot has simplified the deployment of java based web / API applications drastically. It has eliminated the process of deploying the WAR file into the web container provided by Tomcat or any other application servers. It has brought in a new paradigm shift where the container libraries (like tomcat / Ubuntu / jetty) are themselves embedded along with application classes / jar within the fat spring boot jar. Thus making it a truly standalone application and a candidate for micro service development. But, there are few minor challenges, which a spring boot developer would face, when deploying the Spring boot application.

  1. How do we ship the external configuration files like application.properties, configuration xml files etc. along with the Spring boot jar.

  2. How can we copy the start-up script with VM and other parameters to start the application to deployment environments

  3. Should we manually create log directory in the new environment and make the changes in the log4j.xml / log4j.properties of the application to point to the log directory.

All the above would need manual configuration changes

Once we address the above concerns. The following questions would be addressed, automatically

  1. Deploying the application to DEV / SIT / UAT / PROD environments via Continuous Integration / Continuous Deployment (CI / CD) infrastructure like Jenkins without any additional configurations in the deployment nodes.

  2. Ship the micro service with external configurations or dependencies, packed into one deployable artifact to any new developer, who can just run it by using a startup script.

The Solution Maven has the ability to bundle all the artifacts into a directory and create .zip or a .tar file for easy shipment, using the maven-assembly-plugin. We will have to leverage this feature to programmatically organize the dependent artifacts to support the spring boot jar to run seamlessly.

The sample code demonstrates as how the Springboot jar along with external dependencies can be packaged using Maven.

springboot's People

Contributors

harshithbhaskar avatar

Watchers

James Cloos avatar chenb-c 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.