Advertisement
hivefans

pom.xml

Aug 9th, 2021
1,625
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 1.86 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project xmlns="http://maven.apache.org/POM/4.0.0"
  3.         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4.         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  5.     <modelVersion>4.0.0</modelVersion>
  6.  
  7.     <groupId>org.example</groupId>
  8.     <artifactId>javagzipfile</artifactId>
  9.     <version>1.0-SNAPSHOT</version>
  10.  
  11.     <properties>
  12.         <maven.compiler.source>8</maven.compiler.source>
  13.         <maven.compiler.target>8</maven.compiler.target>
  14.     </properties>
  15. <!--解决jar打包后无法执行报错--->
  16.  
  17.     <build>
  18.         <finalName>${project.artifactId}</finalName><!--修改编译出来的jar包名,仅为{artifactId}.jar-->
  19.         <plugins>
  20.  
  21.  
  22.             <plugin>
  23.                 <groupId>org.apache.maven.plugins</groupId>
  24.                 <artifactId>maven-assembly-plugin</artifactId>
  25.                 <version>3.2.0</version>
  26.                 <configuration>
  27.                     <archive>
  28.                         <manifest>
  29.                             <mainClass>cn.gwm.OSSGzip</mainClass>
  30.                         </manifest>
  31.                     </archive>
  32.                     <descriptorRefs>
  33.                         <descriptorRef>jar-with-dependencies</descriptorRef>
  34.                     </descriptorRefs>
  35.                 </configuration>
  36.                 <executions>
  37.                     <execution>
  38.                         <id>make-assembly</id> <!-- this is used for inheritance merges -->
  39.                         <phase>package</phase> <!-- 指定在打包节点执行jar包合并操作 -->
  40.                         <goals>
  41.                             <goal>single</goal>
  42.                         </goals>
  43.                     </execution>
  44.                 </executions>
  45.             </plugin>
  46.         </plugins>
  47.     </build>
  48.  
  49. </project>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement