CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/maven-org-springframework-boot--spring-boot-autoconfigure

Spring Boot AutoConfigure provides auto-configuration capabilities that automatically configure Spring applications based on jar dependencies present on the classpath

Pending
Overview
Eval results
Files

quick-start.mddocs/guides/

Quick Start Guide

Get started with Spring Boot AutoConfigure in minutes.

Prerequisites

  • Java 17 or later
  • Maven or Gradle
  • Basic Spring Framework knowledge

Step 1: Add Dependency

Maven

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-autoconfigure</artifactId>
    <version>4.0.2</version>
</dependency>

Gradle

implementation 'org.springframework.boot:spring-boot-autoconfigure:4.0.2'

Step 2: Create Main Application

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class MyApplication {
    public static void main(String[] args) {
        SpringApplication.run(MyApplication.class, args);
    }
}

Step 3: Run Your Application

mvn spring-boot:run

or

./gradlew bootRun

What Just Happened?

The @SpringBootApplication annotation:

  1. Enabled auto-configuration - Spring Boot detected dependencies and configured beans
  2. Scanned components - Found @Component, @Service, @Controller classes
  3. Bound properties - Connected application.properties to configuration

Next Steps

Add a REST Controller

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

@RestController
public class HelloController {
    
    @GetMapping("/hello")
    public String hello() {
        return "Hello, World!";
    }
}

Visit: http://localhost:8080/hello

Configure Properties

Create src/main/resources/application.properties:

server.port=8080
spring.application.name=my-app

Exclude Auto-Configurations

@SpringBootApplication(exclude = {
    DataSourceAutoConfiguration.class
})
public class MyApplication {
    // ...
}

Common First Tasks

1. Add Database Support

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

Auto-configured automatically when H2/MySQL/PostgreSQL is on classpath.

2. Enable Caching

@SpringBootApplication
@EnableCaching
public class MyApplication {
    // ...
}

3. Add Security

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

Auto-configured with default security settings.

Debugging

Enable debug mode to see what's being auto-configured:

debug=true

Check the console output for condition evaluation report.

Next Guides

  • Configuration Basics - Learn about configuration
  • Custom Auto-Configurations - Create your own
  • Common Patterns - See real examples

Troubleshooting

Application won't start?

  • Check Java version (must be 17+)
  • Verify dependencies are downloaded
  • Enable debug mode

Port already in use?

  • Change port: server.port=8081
  • Or kill process using port 8080

Beans not found?

  • Check component scanning base packages
  • Verify @Component annotations
  • Check for circular dependencies

See Troubleshooting Guide for more help.

Install with Tessl CLI

npx tessl i tessl/maven-org-springframework-boot--spring-boot-autoconfigure@4.0.1

docs

index.md

tile.json