Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.

Chapter 2. Configuring your application to use Spring Boot


Reference the Spring Boot BOM (Bill of Materials) artifact in the pom.xml file at the root directory of your application.

Prerequisites

  • A Maven-based application

Procedure

  1. Open the pom.xml file, add the me.snowdrop:spring-boot-bom artifact to the <dependencyManagement> section, and specify the <type>pom</type> and <scope>import</scope>:

    <project>
      ...
      <dependencyManagement>
        <dependencies>
          <dependency>
            <groupId>me.snowdrop</groupId>
            <artifactId>spring-boot-bom</artifactId>
            <version>2.1.15.Final-redhat-00001</version>
            <type>pom</type>
            <scope>import</scope>
          </dependency>
        </dependencies>
      </dependencyManagement>
      ...
    </project>
    Copy to Clipboard Toggle word wrap
  2. Include the following properties to track the version of Spring Boot and the Spring Boot Maven Plugin you are using:

    <project>
      ...
      <properties>
        <spring-boot.version>2.1.15.RELEASE</spring-boot.version>
        <spring-boot-maven-plugin.version>2.1.15.RELEASE</spring-boot-maven-plugin.version>
      </properties>
      ...
    </project>
    Copy to Clipboard Toggle word wrap
  3. Specify the repositories containing Spring Boot Starters and the Spring Boot Maven Plugin:

      <!-- Specify the repositories containing Spring Boot artifacts. -->
      <repositories>
        <repository>
          <id>redhat-ga</id>
          <name>Red Hat GA Repository</name>
          <url>https://maven.repository.redhat.com/ga/</url>
        </repository>
      </repositories>
    
      <!-- Specify the repositories containing the plugins used to execute the build of your application. -->
      <pluginRepositories>
        <pluginRepository>
          <id>redhat-ga</id>
          <name>Red Hat GA Repository</name>
          <url>https://maven.repository.redhat.com/ga/</url>
        </pluginRepository>
      </pluginRepositories>
    Copy to Clipboard Toggle word wrap
  4. Reference spring-boot-maven-plugin as the plugin used to package your application:

    <project>
      ...
      <build>
        <plugins>
            ...
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <version>${spring-boot-maven-plugin.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                  </executions>
                <configuration>
                    <redeploy>true</redeploy>
                </configuration>
            </plugin>
            ...
        </plugins>
      </build>
      ...
    </project>
    Copy to Clipboard Toggle word wrap

Additional resources

Nach oben
Red Hat logoGithubredditYoutubeTwitter

Lernen

Testen, kaufen und verkaufen

Communitys

Über Red Hat Dokumentation

Wir helfen Red Hat Benutzern, mit unseren Produkten und Diensten innovativ zu sein und ihre Ziele zu erreichen – mit Inhalten, denen sie vertrauen können. Entdecken Sie unsere neuesten Updates.

Mehr Inklusion in Open Source

Red Hat hat sich verpflichtet, problematische Sprache in unserem Code, unserer Dokumentation und unseren Web-Eigenschaften zu ersetzen. Weitere Einzelheiten finden Sie in Red Hat Blog.

Über Red Hat

Wir liefern gehärtete Lösungen, die es Unternehmen leichter machen, plattform- und umgebungsübergreifend zu arbeiten, vom zentralen Rechenzentrum bis zum Netzwerkrand.

Theme

© 2025 Red Hat