美文网首页
Spring Boot 使用dependencyManageme

Spring Boot 使用dependencyManageme

作者: jeffrey_hjf | 来源:发表于2019-11-19 23:08 被阅读0次

    POM 文件配置

    <?xml version="1.0" encoding="UTF-8"?>
    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
        <modelVersion>4.0.0</modelVersion>
        <packaging>pom</packaging>
        <modules>
            <module>spring-boot-alibaba-provider</module>
        </modules>
    
        <groupId>com.jeffrey</groupId>
        <artifactId>spring-boot-alibaba</artifactId>
        <version>1.0.0</version>
        <name>spring-boot-alibaba</name>
        <description>Demo project for Spring Boot</description>
    
        <properties>
            <java.version>1.8</java.version>
            <spring-cloud.version>Hoxton.RC2</spring-cloud.version>
            <spring-boot.version>2.2.1.RELEASE</spring-boot.version>
        </properties>
    
        <dependencyManagement>
            <dependencies>
                <dependency>
                    <groupId>org.springframework.cloud</groupId>
                    <artifactId>spring-cloud-dependencies</artifactId>
                    <version>${spring-cloud.version}</version>
                    <type>pom</type>
                    <scope>import</scope>
                </dependency>
    
                <dependency>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-parent</artifactId>
                    <version>${spring-boot.version}</version>
                    <type>pom</type>
                    <scope>import</scope>
                </dependency>
            </dependencies>
        </dependencyManagement>
    
        <build>
            <pluginManagement>
                <plugins>
                    <plugin>
                        <groupId>org.springframework.boot</groupId>
                        <artifactId>spring-boot-maven-plugin</artifactId>
                        <version>${spring-boot.version}</version>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>repackage</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
    
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <configuration>
                            <source>1.8</source>
                            <target>1.8</target>
                        </configuration>
                    </plugin>
                </plugins>
            </pluginManagement>
        </build>
        
        <repositories>
            <repository>
                <id>maven-ossez</id>
                <name>OSSEZ Repository</name>
                <url>https://maven.ossez.com/repository/internal</url>
            </repository>
        </repositories>
    
        <pluginRepositories>
            <pluginRepository>
                <id>maven-ossez</id>
                <name>OSSEZ Repository</name>
                <url>https://maven.ossez.com/repository/internal</url>
                <snapshots>
                    <enabled>true</enabled>
                </snapshots>
            </pluginRepository>
        </pluginRepositories>
    </project>
    

    注意

    一定要在引入的spring-boot-maven-plugin 中加上

    <executions>
        <execution>
            <goals>
                <goal>repackage</goal>
            </goals>
        </execution>
    </executions>
    

    相关文章

      网友评论

          本文标题:Spring Boot 使用dependencyManageme

          本文链接:https://www.haomeiwen.com/subject/pfcnictx.html