DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Last call! Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

Related

  • Spring Boot - How To Use Native SQL Queries | Restful Web Services
  • Spring Boot: Testing Service Layer Code with JUnit 5 and Mockito, RESTful Web Services
  • Component Tests for Spring Cloud Microservices
  • How To Build Web Service Using Spring Boot 2.x

Trending

  • Breaking Bottlenecks: Applying the Theory of Constraints to Software Development
  • Hybrid Cloud vs Multi-Cloud: Choosing the Right Strategy for AI Scalability and Security
  • AI’s Role in Everyday Development
  • Streamlining Event Data in Event-Driven Ansible
  1. DZone
  2. Coding
  3. Frameworks
  4. How to Write a Spring Boot Web Maven Archetype With Common Practices in Place

How to Write a Spring Boot Web Maven Archetype With Common Practices in Place

This custom Spring Boot web Maven archetype can demonstrate common practices to help you bring these standards to your team or organization.

By 
Mahmoud Romeh user avatar
Mahmoud Romeh
·
Dec. 07, 17 · Tutorial
Likes (15)
Comment
Save
Tweet
Share
28.7K Views

Join the DZone community and get the full member experience.

Join For Free

Here we are sharing a custom Spring Boot web Maven archetype I have created to encapsulate all the common practices, as an example how you can do the same in your team for common standards that can be imposed by your company or your team.

AppArchtype

The Maven archetype for the Spring Boot web application has all common standards in place, ready for development:

  • Java 1.8+
  • Maven 3.3+
  • Spring boot 1.5.6+
  • Lombok abstraction
  • JPA with H2 for explanation
  • Swagger 2 API documentation
  • Spring retry and circuit breaker for external service call
  • REST API model validation
  • Spring cloud config for external configuration on GIT repository
  • Cucumber and Spring Boot test for integration test
  • Jenkins Pipeline for multi branch project
  • continuous delivery and integration standards with Sonar check and release management
  • Support retry in sanity checks
  • Logback configuration

Installation

To install the archetype in your local repository, execute the following commands:

$ git clone https://github.com/Romeh/spring-boot-quickstart-archtype.git
$ cd spring-boot-quickstart-archtype
$ mvn clean install

Create a Project

$ mvn archetype:generate \
     -DarchetypeGroupId=com.romeh.spring-boot-archetypes \
     -DarchetypeArtifactId=spring-boot-quickstart \
     -DarchetypeVersion=1.0.0 \
     -DgroupId=com.test \
     -DartifactId=sampleapp \
     -Dversion=1.0.0-SNAPSHOT \
     -DinteractiveMode=false

Test the Generated App REST API via Swagger:

http://localhost:8080/swagger-ui.html


A sample app generated from that archetype can be found on GitHub.

References:

  1. https://projects.spring.io/spring-boot/
  2. https://maven.apache.org/guides/introduction/introduction-to-archetypes.html
Spring Framework Spring Boot Archetype (information science) Apache Maven Web Service

Published at DZone with permission of Mahmoud Romeh, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Spring Boot - How To Use Native SQL Queries | Restful Web Services
  • Spring Boot: Testing Service Layer Code with JUnit 5 and Mockito, RESTful Web Services
  • Component Tests for Spring Cloud Microservices
  • How To Build Web Service Using Spring Boot 2.x

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!