Maven打包Spring Cloud多模块微服务独立运行

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qwqw3333333/article/details/83347327

贴上我的项目目录,下面将以打包spring-cloud-eureka-7001为例
在这里插入图片描述

  1. 先配置好maven的环境变量。
  2. 在父pom文件,或者需要打包的服务模块pom文件中加入打包插件。
<plugin>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-maven-plugin</artifactId>
    <executions>
        <execution>
            <goals>
                <goal>repackage</goal>
            </goals>
        </execution>
    </executions>
</plugin>
  1. 进入需要打包服务模块的根目录,在该目录打开DOS命令窗口。
    在这里插入图片描述
  2. 执行打包命令:mvn install。
    在这里插入图片描述
  3. 进入架包目录,输入命令:java -jar xxx.jar 运行服务。

猜你喜欢

转载自blog.csdn.net/qwqw3333333/article/details/83347327
今日推荐