Skip to content

Quick Start ​

Best for new services. Run the command in the parent directory where you want the project placed (e.g. ~/projects); the generator creates a new folder named after the artifactId in the current directory:

bash
mvn archetype:generate \
    -DarchetypeGroupId=io.github.weihubeats \
    -DarchetypeArtifactId=spring-boot-nebula-archetype \
    -DarchetypeVersion=3.0.6 \
    -DgroupId=com.example \
    -DartifactId=demo \
    -Dversion=1.0.0-SNAPSHOT \
    -Dpackage=com.example.demo \
    -DinteractiveMode=false

Once generated, the project runs out of the box:

bash
cd demo && mvn verify && mvn spring-boot:run -pl demo-start

See Project Archetype for details.

Option 2: Manual Integration ​

Manage versions centrally in the parent POM to avoid inconsistent dependency versions across projects (e.g. behavioral differences between Redisson 3.14 and 3.61):

xml
<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>io.github.weihubeats</groupId>
            <artifactId>spring-boot-nebula-dependencies</artifactId>
            <version>3.0.6</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

2. Add the Web Module ​

xml
<dependency>
    <groupId>io.github.weihubeats</groupId>
    <artifactId>spring-boot-nebula-web</artifactId>
</dependency>

3. Write the Application Class ​

java
@SpringBootApplication
public class WebApplication {

    public static void main(String[] args) {
        TimeZone.setDefault(TimeZone.getTimeZone("Asia/Shanghai"));
        SpringApplication.run(WebApplication.class, args);
    }
}

4. Write an Endpoint ​

No manual Response wrapping needed — just annotate the controller method with @NebulaResponseBody (it can also be placed on the class to apply to all methods):

java
@GetMapping("/test")
@NebulaResponseBody
public String test() {
    return "小奏";
}

Response format:

json
{
  "code": 200,
  "data": "小奏",
  "msg": "success"
}

5. Add More Modules as Needed ​

CapabilityArtifactIdDocs
MyBatis-Plus wrapperspring-boot-nebula-mybatisView
Read/write splittingspring-boot-nebula-dynamic-datasourceView
Distributed lockspring-boot-nebula-distribute-lockView
Excel import/exportspring-boot-nebula-excelView
Region-routing JOINspring-boot-nebula-joinView
Feign unwrappingspring-boot-nebula-feignView
Log masking & alertingspring-boot-nebula-logbackView
DDD aggregate rootspring-boot-nebula-aggregateView

Run Samples Locally ​

Every capability ships with a runnable minimal sample under spring-boot-nebula-samples:

bash
cd spring-boot-nebula-samples/spring-boot-nebula-web-sample
mvn spring-boot:run

Released under the Apache 2.0 License.