Forge
Plugins

Spring Boot

Plugin for Spring Boot and Maven projects

@bjb-forge/nx-spring-boot-project

Installation

npx forge add @bjb-forge/nx-spring-boot-project

In DevCloud, the following configuration must be in your .mvn/settings.xml

  <servers>
    <server>
      <id>csa</id>
      <username>${env.CODEAK_REPOSITORY_USERNAME}</username>
      <password>${env.CODEAK_REPOSITORY_PASSWORD}</password>
    </server>
  </servers>

<profiles>
  <profile>
    <id>forge-extension-repo</id>
    <repositories>
      <repository>
        <id>csa</id>
        <url>https://csa.maven.pkg.sehlat.io</url>
        <releases><enabled>true</enabled></releases>
        <snapshots><enabled>false</enabled></snapshots>
      </repository>
    </repositories>
    <pluginRepositories>
      <pluginRepository>
        <id>csa</id>
        <url>https://csa.maven.pkg.sehlat.io</url>
        <releases><enabled>true</enabled></releases>
        <snapshots><enabled>false</enabled></snapshots>
      </pluginRepository>
    </pluginRepositories>
  </profile>
</profiles>

<activeProfiles>
  <activeProfile>forge-extension-repo</activeProfile>
</activeProfiles>

Plugin Options

{
  "plugin": "@bjb-forge/nx-spring-boot-project/nx-plugin",
  "options": {}
}
OptionTypeDescription
useDaemonbooleanUse Maven Daemon (mvnd) instead of mvn for faster builds
deployStrategystringDeploy strategy to use for release publishing. 'default' uses standard mvn deploy. 'forge' uses the forge maven-deploy-plugin.
build.targetNamestringThe name of the build target
serve.targetNamestringThe name of the serve target
test.targetNamestringThe name of the test target
verify.targetNamestringThe name of the verify target

Inferred Targets

build

Installs the Maven project using mvn install (skipping tests).

Condition: All Maven projects (excluding pure-aggregators and orphaned modules)

test

Runs unit tests using mvn test.

Condition: Library and service projects only (not aggregator/parent projects)

verify

Runs integration tests using mvn verify.

Condition: Library and service projects only (not aggregator/parent projects)

serve

Runs the Spring Boot application with mvn spring-boot:run.

Condition: Projects with spring-boot-maven-plugin configured in pom.xml

nx-release-publish

Publishes the project artifact to a registry.

VariantCondition
JIB (Container Image)When jib.yml exists in project root
Maven DeployWhen distributionManagement is configured in pom.xml hierarchy

Generators

service-project

Create an Nx Plugin for JB.

nx g @bjb-forge/nx-spring-boot-project:service-project [options]
OptionTypeRequiredDefaultDescription
directorystringYes-A directory where the plugin is placed.

On this page