zoukankan      html  css  js  c++  java
  • SpringBoot聚合项目打包

    1.打包遇到的问题:

    子模块打包时,每次打包出来的jar都只有3k左右,没办法运行,目测应该是依赖的jar没有打包进来!

    2.解决办法:

    2.1.主项目的pom.xml里面不需要打包配置

    2.2.在需要打包的项目pom.xml文件里做如下打包配置

    <build>
            <finalName>microservice-eureka-7001</finalName>
            <resources>
                <resource>
                    <directory>src/main/java</directory>
                    <filtering>true</filtering>
                    <includes>
                        <include>**/*.xml</include>
                    </includes>
                </resource>
                <resource>
                    <directory>src/main/resources</directory>
                    <includes>
                        <include>**.*</include>
                        <include>**/*.*</include><!-- i18n能读取到 -->
                        <include>**/*/*.*</include>
                    </includes>
                </resource>
            </resources>
            <plugins>
                <plugin>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-maven-plugin</artifactId>
    
                    <configuration>
                        <fork>true</fork> <!-- 如果没有该配置,devtools不会生效 -->
                        <!-- 指定该Main Class为全局的唯一入口 -->
                        <mainClass>com.fdzang.microservice.eureka.EurekaServer7001_App</mainClass>
                        <layout>ZIP</layout>
                    </configuration>
                    <executions>
                        <execution>
                            <goals>
                                <goal>repackage</goal><!--可以把依赖的包都打包到生成的Jar包中-->
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>

    2.3.重点:

    <executions>
    <execution>
    <goals>
    <goal>repackage</goal><!--可以把依赖的包都打包到生成的Jar包中-->
    </goals>
    </execution>
    </executions>
  • 相关阅读:
    C++基础学习1-编译与链接
    html学习
    使用BP拦截POST请求包
    2019.9.17
    搭建LAMP环境
    2019.9.16
    2019.9.12
    2019.9.11
    手脱无名壳tslgame_rl
    一款自制壳的脱壳
  • 原文地址:https://www.cnblogs.com/fdzang/p/10231684.html
Copyright © 2011-2022 走看看