shenyu 打包

1.替换shenyu-admin工程的pom.xml中的<build>模块为下面的模块

<build>
<finalName>shenyu-admin</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring-boot.version}</version>
<configuration>
<!-- 指定该Main Class为全局的唯一入口 -->
<mainClass>org.apache.shenyu.admin.ShenyuAdminBootstrap</mainClass>
<layout>ZIP</layout>
<includeSystemScope>true</includeSystemScope><!-- 把第三方jar包打进去 -->
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal><!--可以把依赖的包都打包到生成的Jar包中 -->
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>${maven-resources-plugin.version}</version>
<configuration>
<encoding>${project.build.sourceEncoding}</encoding>
<useDefaultDelimiters>true</useDefaultDelimiters>
</configuration>
</plugin>
</plugins>

</build>


2.替换shenyu-bootstrap工程的pom.xml中的<build>模块为下面的模块

<build>
        <finalName>shenyu-bootstrap</finalName>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <version>${spring-boot.version}</version>
                <configuration>
                    <!-- 指定该Main Class为全局的唯一入口 -->
                    <mainClass>org.apache.shenyu.bootstrap.ShenyuBootstrapApplication</mainClass>
                    <layout>ZIP</layout>
                    <includeSystemScope>true</includeSystemScope><!-- 把第三方jar包打进去 -->
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal><!--可以把依赖的包都打包到生成的Jar包中 -->
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <skip>true</skip>
                </configuration>
            </plugin>
        </plugins>
    </build>

 


3.打包

mvn clean install -Dmaven.javadoc.skip=true -B -Drat.skip=true -Djacoco.skip=true -DskipITs -DskipTests
posted @ 2023-07-11 23:34  爱你爱自己  阅读(75)  评论(0编辑  收藏  举报