Bläddra i källkod

deployer 模块使用 maven-shade-plugin 构建 jar 包

reghao 4 månader sedan
förälder
incheckning
0cbf32e9f9
1 ändrade filer med 10 tillägg och 17 borttagningar
  1. 10 17
      deployer/pom.xml

+ 10 - 17
deployer/pom.xml

@@ -38,28 +38,21 @@
         <plugins>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-assembly-plugin</artifactId>
-                <version>3.2.0</version>
-                <configuration>
-                    <archive>
-                        <manifest>
-                            <mainClass>cn.reghao.bnt.deployer.DeployApp</mainClass>
-                        </manifest>
-                    </archive>
-                    <descriptorRefs>
-                        <descriptorRef>jar-with-dependencies</descriptorRef>
-                    </descriptorRefs>
-                    <!-- 不设置此属性则生成的 jar 包名字会带有 jar-with-dependencies -->
-                    <appendAssemblyId>false</appendAssemblyId>
-                    <outputDirectory>${project.build.outputDir}</outputDirectory>
-                </configuration>
+                <artifactId>maven-shade-plugin</artifactId>
+                <version>3.2.4</version>
                 <executions>
                     <execution>
-                        <id>make-assembly</id>
                         <phase>package</phase>
                         <goals>
-                            <goal>single</goal>
+                            <goal>shade</goal>
                         </goals>
+                        <configuration>
+                            <transformers>
+                                <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
+                                    <mainClass>cn.reghao.bnt.deployer.DeployApp</mainClass>
+                                </transformer>
+                            </transformers>
+                        </configuration>
                     </execution>
                 </executions>
             </plugin>