Explorar el Código

feat: pom依赖排除其它包

许家凯 hace 4 años
padre
commit
6ba65c3092
Se han modificado 2 ficheros con 30 adiciones y 11 borrados
  1. 8 11
      pom.xml
  2. 22 0
      src/main/resources/package.xml

+ 8 - 11
pom.xml

@@ -74,27 +74,24 @@
                 <artifactId>maven-assembly-plugin</artifactId>
                 <version>2.4.1</version>
                 <configuration>
-                    <!-- get all project dependencies -->
-                    <descriptorRefs>
-                        <descriptorRef>jar-with-dependencies</descriptorRef>
-                    </descriptorRefs>
-                    <!-- MainClass in mainfest make a executable jar -->
-<!--                    <archive>-->
-<!--                        <manifest>-->
-<!--                            <mainClass>util.Microseer</mainClass>-->
-<!--                        </manifest>-->
-<!--                    </archive>-->
+                    <descriptors> <!--描述文件路径-->
+                        <descriptor>src/main/resources/package.xml</descriptor>
+                    </descriptors>
 
+                   <!-- <descriptorRefs>
+                        <descriptorRef>jar-with-dependencies</descriptorRef>
+                    </descriptorRefs>-->
                 </configuration>
                 <executions>
                     <execution>
                         <id>make-assembly</id>
-                        <!-- bind to the packaging phase -->
                         <phase>package</phase>
                         <goals>
                             <goal>single</goal>
                         </goals>
+
                     </execution>
+
                 </executions>
             </plugin>
 

+ 22 - 0
src/main/resources/package.xml

@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
+          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+          xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
+    <id>jar-with-dependencies</id>
+    <formats>
+        <format>jar</format>
+    </formats>
+    <includeBaseDirectory>false</includeBaseDirectory>
+    <dependencySets>
+        <dependencySet>
+            <outputDirectory>/</outputDirectory>
+            <useProjectArtifact>true</useProjectArtifact>
+            <unpack>true</unpack>
+            <scope>runtime</scope>
+            <excludes>
+                <exclude>com.aliyun.odps:*</exclude>
+                <exclude>junit:*</exclude>
+            </excludes>
+        </dependencySet>
+    </dependencySets>
+</assembly>