Skip to content
CMO & CTO
CMO & CTO

Closing the Bridge Between Marketing and Technology, By Luis Fernandez

  • Digital Experience
    • Experience Strategy
    • Experience-Driven Commerce
    • Multi-Channel Experience
    • Personalization & Targeting
    • SEO & Performance
    • User Journey & Behavior
  • Marketing Technologies
    • Analytics & Measurement
    • Content Management Systems
    • Customer Data Platforms
    • Digital Asset Management
    • Marketing Automation
    • MarTech Stack & Strategy
    • Technology Buying & ROI
  • Software Engineering
    • Software Engineering
    • Software Architecture
    • General Software
    • Development Practices
    • Productivity & Workflow
    • Code
    • Engineering Management
    • Business of Software
    • Code
    • Digital Transformation
    • Systems Thinking
    • Technical Implementation
  • About
CMO & CTO

Closing the Bridge Between Marketing and Technology, By Luis Fernandez

Spring Boot Quick Starts: Convention without Regret

Posted on May 23, 2014 By Luis Fernandez

Spring Boot just went GA and it feels like a breath of fresh air. If you have ever spent a morning wiring servlets, a lunch break fighting XML, and an afternoon chasing one missing component scan, you know the feeling. Today we can spin apps that start fast, ship as a single jar, and still keep the familiar Spring model. That is the charm of Spring Boot quick starts. Convention without regret. Start right away, keep control when it matters.

What a Spring Boot quick start really is

Spring Boot gives you Starter POMs, auto configuration, and an embedded server. Add a starter, write a tiny main class, and run. No container to install. No web.xml. Your app is the server.

<!-- pom.xml -->
<project>
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.example</groupId>
  <artifactId>demo</artifactId>
  <version>0.0.1</version>
  <parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.0.0.RELEASE</version>
  </parent>

  <dependencies>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
      </plugin>
    </plugins>
  </build>
</project>
// DemoApplication.java
package com.example.demo;

import org.springframework.boot.SpringApplication;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;

@Configuration
@ComponentScan
@EnableAutoConfiguration
public class DemoApplication {
  public static void main(String[] args) {
    SpringApplication.run(DemoApplication.class, args);
  }
}
// HelloController.java
package com.example.demo;

import org.springframework.web.bind.annotation.*;

@RestController
public class HelloController {
  @RequestMapping("/hello")
  public String hello() {
    return "hello boot";
  }
}

Run mvn spring-boot:run. Hit http://localhost:8080/hello. That is a quick start. The defaults come from auto configuration that inspects your classpath and sets sane beans. You can keep going with Tomcat out of the box or swap to Jetty if that fits your stack.

Production bits without the yak shave

Boot brings Actuator. It adds endpoints for health, info, metrics, and env. You can wire them into your monitoring right away. No extra wiring, no custom servlets, no secret flags.

<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

With that on the classpath you get endpoints like /health and /metrics. Put basic info in your application.properties and ship.

# src/main/resources/application.properties
info.app.name=demo
info.app.version=0.0.1
management.port=8081
management.address=127.0.0.1

Start the jar and curl the endpoints. Your app now tells you how it feels. That short loop is gold when you are pushing small services or building internal tools that need care from day one.

Configuration that stays boring

There is a myth that Boot hides everything. It does hide noise. It does not hide control. You can override any bean. You can use application.properties and profiles to keep secrets out of your default config and to tune for each target.

# switch ports per profile
server.port=8080
---
spring.profiles=prod
server.port=80
// Customizing an auto configured bean
@Bean
public ObjectMapper objectMapper() {
  return new ObjectMapper()
      .enable(SerializationFeature.INDENT_OUTPUT);
}

Boot starts you with smart defaults and invites you to override with plain code or simple properties. That is the heart of convention without regret. Move fast, then tune without a rewrite.

Where Boot shines and where others fit

Classic Spring with XML gives fine grained control but slows the first mile. Java config closed that gap but you still write a lot before the first endpoint. Boot turns the first mile into a sprint and keeps the same Spring core so your skills carry over.

Dropwizard is a sharp kit for small HTTP services with clear choices. If you love its bundle style and Jersey first approach, it is a great fit. Boot leans on the full Spring stack, gives a big starter catalog, and keeps a friendly path to data access, messaging, and templating without extra glue.

Rails fans will smile at the speed of new apps. The difference is that Boot keeps the knobs in reach. Less magic, more plain Java when you need it.

Practical checklist to ship your first Boot app

  • Create a project with the web starter and Actuator. Keep the parent in your POM for managed versions.
  • Write the main class with @EnableAutoConfiguration and a tiny controller. Verify with curl.
  • Add application.properties with a custom port, logging level, and info fields.
  • Set up profiles for dev and prod. Different ports or data sources per profile.
  • Write a slice test with @WebAppConfiguration and MockMvc to lock the contract.
  • Package a fat jar with spring-boot-maven-plugin. Run with java -jar.
  • Expose health on a separate port and wire it to your monitor of choice.
// Simple test with MockMvc
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = DemoApplication.class)
@WebAppConfiguration
public class HelloControllerTest {
  @Autowired private WebApplicationContext wac;
  private MockMvc mvc;

  @Before
  public void setup() {
    mvc = MockMvcBuilders.webAppContextSetup(wac).build();
  }

  @Test
  public void hello() throws Exception {
    mvc.perform(get("/hello"))
       .andExpect(status().isOk())
       .andExpect(content().string("hello boot"));
  }
}

Ship fast without losing yourself in config. That is the Boot promise I can get behind.

Software Architecture Software Engineering

Post navigation

Previous post
Next post
  • Digital Experience (94)
    • Experience Strategy (19)
    • Experience-Driven Commerce (5)
    • Multi-Channel Experience (9)
    • Personalization & Targeting (21)
    • SEO & Performance (10)
  • Marketing Technologies (92)
    • Analytics & Measurement (14)
    • Content Management Systems (45)
    • Customer Data Platforms (4)
    • Digital Asset Management (8)
    • Marketing Automation (6)
    • MarTech Stack & Strategy (10)
    • Technology Buying & ROI (3)
  • Software Engineering (310)
    • Business of Software (20)
    • Code (30)
    • Development Practices (52)
    • Digital Transformation (21)
    • Engineering Management (25)
    • General Software (82)
    • Productivity & Workflow (30)
    • Software Architecture (85)
    • Technical Implementation (23)
  • 2025 (12)
  • 2024 (8)
  • 2023 (18)
  • 2022 (13)
  • 2021 (3)
  • 2020 (8)
  • 2019 (8)
  • 2018 (23)
  • 2017 (17)
  • 2016 (40)
  • 2015 (37)
  • 2014 (25)
  • 2013 (28)
  • 2012 (24)
  • 2011 (30)
  • 2010 (42)
  • 2009 (25)
  • 2008 (13)
  • 2007 (33)
  • 2006 (26)

Ab Testing Adobe Adobe Analytics Adobe Target AEM agile-methodologies Analytics architecture-patterns CDP CMS coding-practices content-marketing Content Supply Chain Conversion Optimization Core Web Vitals customer-education Customer Data Platform Customer Experience Customer Journey DAM Data Layer Data Unification documentation DXP Individualization java Martech metrics mobile-development Mobile First Multichannel Omnichannel Personalization product-strategy project-management Responsive Design Search Engine Optimization Segmentation seo spring Targeting Tracking user-experience User Journey web-development

©2025 CMO & CTO | WordPress Theme by SuperbThemes