Skip to content

Commit

Permalink
optimize_app_package_size
Browse files Browse the repository at this point in the history
  • Loading branch information
zackyoungh committed Nov 28, 2024
1 parent 07d6c73 commit deac85c
Show file tree
Hide file tree
Showing 6 changed files with 200 additions and 96 deletions.
52 changes: 39 additions & 13 deletions dinky-app/dinky-app-1.15/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,25 +63,51 @@
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>${maven-assembly-plugin.version}</version>
<artifactId>maven-shade-plugin</artifactId>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<!-- 可以设置jar包的入口类(可选) -->
<mainClass>org.dinky.app.MainApp</mainClass>
</manifest>
</archive>
<finalName>${project.build.finalName}-jar-with-dependencies</finalName>
<outputDirectory>${project.parent.parent.basedir}/build/extends</outputDirectory>
<minimizeJar>true</minimizeJar>
<createDependencyReducedPom>false</createDependencyReducedPom>
<filters>
<filter>
<artifact>org.dinky:*</artifact>
<includes>
<include>org/dinky/**</include>
<include>META-INF/**</include>
</includes>
</filter>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>tpch/**</exclude>
<exclude>tpcds/**</exclude>
<exclude>support/**</exclude>
<exclude>springfox/**</exclude>
<exclude>org/slf4j/**</exclude>
<exclude>org/springframework/**</exclude>
<exclude>javax/**</exclude>
<exclude>javassist/**</exclude>
<exclude>Class50/**</exclude>
<exclude>lombok/**</exclude>
<exclude>freemarker/**</exclude>
<exclude>com.sun/**</exclude>
<exclude>META-INF/resources/**</exclude>
</excludes>
</filter>
</filters>

<transformers>
<!--设置主函数-->
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>org.dinky.app.MainApp</mainClass>
</transformer>
</transformers>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<goals>
<goal>single</goal>
<goal>shade</goal>
</goals>
<phase>package</phase>
</execution>
Expand Down
52 changes: 39 additions & 13 deletions dinky-app/dinky-app-1.16/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,25 +47,51 @@
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>${maven-assembly-plugin.version}</version>
<artifactId>maven-shade-plugin</artifactId>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<!-- 可以设置jar包的入口类(可选) -->
<mainClass>org.dinky.app.MainApp</mainClass>
</manifest>
</archive>
<finalName>${project.build.finalName}-jar-with-dependencies</finalName>
<outputDirectory>${project.parent.parent.basedir}/build/extends</outputDirectory>
<minimizeJar>true</minimizeJar>
<createDependencyReducedPom>false</createDependencyReducedPom>
<filters>
<filter>
<artifact>org.dinky:*</artifact>
<includes>
<include>org/dinky/**</include>
<include>META-INF/**</include>
</includes>
</filter>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>tpch/**</exclude>
<exclude>tpcds/**</exclude>
<exclude>support/**</exclude>
<exclude>springfox/**</exclude>
<exclude>org/slf4j/**</exclude>
<exclude>org/springframework/**</exclude>
<exclude>javax/**</exclude>
<exclude>javassist/**</exclude>
<exclude>Class50/**</exclude>
<exclude>lombok/**</exclude>
<exclude>freemarker/**</exclude>
<exclude>com.sun/**</exclude>
<exclude>META-INF/resources/**</exclude>
</excludes>
</filter>
</filters>

<transformers>
<!--设置主函数-->
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>org.dinky.app.MainApp</mainClass>
</transformer>
</transformers>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<goals>
<goal>single</goal>
<goal>shade</goal>
</goals>
<phase>package</phase>
</execution>
Expand Down
52 changes: 39 additions & 13 deletions dinky-app/dinky-app-1.17/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,25 +47,51 @@
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>${maven-assembly-plugin.version}</version>
<artifactId>maven-shade-plugin</artifactId>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<!-- 可以设置jar包的入口类(可选) -->
<mainClass>org.dinky.app.MainApp</mainClass>
</manifest>
</archive>
<finalName>${project.build.finalName}-jar-with-dependencies</finalName>
<outputDirectory>${project.parent.parent.basedir}/build/extends</outputDirectory>
<minimizeJar>true</minimizeJar>
<createDependencyReducedPom>false</createDependencyReducedPom>
<filters>
<filter>
<artifact>org.dinky:*</artifact>
<includes>
<include>org/dinky/**</include>
<include>META-INF/**</include>
</includes>
</filter>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>tpch/**</exclude>
<exclude>tpcds/**</exclude>
<exclude>support/**</exclude>
<exclude>springfox/**</exclude>
<exclude>org/slf4j/**</exclude>
<exclude>org/springframework/**</exclude>
<exclude>javax/**</exclude>
<exclude>javassist/**</exclude>
<exclude>Class50/**</exclude>
<exclude>lombok/**</exclude>
<exclude>freemarker/**</exclude>
<exclude>com.sun/**</exclude>
<exclude>META-INF/resources/**</exclude>
</excludes>
</filter>
</filters>

<transformers>
<!--设置主函数-->
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>org.dinky.app.MainApp</mainClass>
</transformer>
</transformers>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<goals>
<goal>single</goal>
<goal>shade</goal>
</goals>
<phase>package</phase>
</execution>
Expand Down
52 changes: 39 additions & 13 deletions dinky-app/dinky-app-1.18/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,25 +47,51 @@
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>${maven-assembly-plugin.version}</version>
<artifactId>maven-shade-plugin</artifactId>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<!-- 可以设置jar包的入口类(可选) -->
<mainClass>org.dinky.app.MainApp</mainClass>
</manifest>
</archive>
<finalName>${project.build.finalName}-jar-with-dependencies</finalName>
<outputDirectory>${project.parent.parent.basedir}/build/extends</outputDirectory>
<minimizeJar>true</minimizeJar>
<createDependencyReducedPom>false</createDependencyReducedPom>
<filters>
<filter>
<artifact>org.dinky:*</artifact>
<includes>
<include>org/dinky/**</include>
<include>META-INF/**</include>
</includes>
</filter>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>tpch/**</exclude>
<exclude>tpcds/**</exclude>
<exclude>support/**</exclude>
<exclude>springfox/**</exclude>
<exclude>org/slf4j/**</exclude>
<exclude>org/springframework/**</exclude>
<exclude>javax/**</exclude>
<exclude>javassist/**</exclude>
<exclude>Class50/**</exclude>
<exclude>lombok/**</exclude>
<exclude>freemarker/**</exclude>
<exclude>com.sun/**</exclude>
<exclude>META-INF/resources/**</exclude>
</excludes>
</filter>
</filters>

<transformers>
<!--设置主函数-->
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>org.dinky.app.MainApp</mainClass>
</transformer>
</transformers>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<goals>
<goal>single</goal>
<goal>shade</goal>
</goals>
<phase>package</phase>
</execution>
Expand Down
52 changes: 39 additions & 13 deletions dinky-app/dinky-app-1.19/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,25 +47,51 @@
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>${maven-assembly-plugin.version}</version>
<artifactId>maven-shade-plugin</artifactId>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<!-- 可以设置jar包的入口类(可选) -->
<mainClass>org.dinky.app.MainApp</mainClass>
</manifest>
</archive>
<finalName>${project.build.finalName}-jar-with-dependencies</finalName>
<outputDirectory>${project.parent.parent.basedir}/build/extends</outputDirectory>
<minimizeJar>true</minimizeJar>
<createDependencyReducedPom>false</createDependencyReducedPom>
<filters>
<filter>
<artifact>org.dinky:*</artifact>
<includes>
<include>org/dinky/**</include>
<include>META-INF/**</include>
</includes>
</filter>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>tpch/**</exclude>
<exclude>tpcds/**</exclude>
<exclude>support/**</exclude>
<exclude>springfox/**</exclude>
<exclude>org/slf4j/**</exclude>
<exclude>org/springframework/**</exclude>
<exclude>javax/**</exclude>
<exclude>javassist/**</exclude>
<exclude>Class50/**</exclude>
<exclude>lombok/**</exclude>
<exclude>freemarker/**</exclude>
<exclude>com.sun/**</exclude>
<exclude>META-INF/resources/**</exclude>
</excludes>
</filter>
</filters>

<transformers>
<!--设置主函数-->
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>org.dinky.app.MainApp</mainClass>
</transformer>
</transformers>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<goals>
<goal>single</goal>
<goal>shade</goal>
</goals>
<phase>package</phase>
</execution>
Expand Down
36 changes: 5 additions & 31 deletions dinky-app/dinky-app-1.20/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,41 +45,14 @@
</resources>

<plugins>
<!-- <plugin>-->
<!-- <groupId>org.apache.maven.plugins</groupId>-->
<!-- <artifactId>maven-assembly-plugin</artifactId>-->
<!-- <version>${maven-assembly-plugin.version}</version>-->
<!-- <configuration>-->
<!-- <descriptorRefs>-->
<!-- <descriptorRef>jar-with-dependencies</descriptorRef>-->
<!-- </descriptorRefs>-->
<!-- <archive>-->
<!-- <manifest>-->
<!-- &lt;!&ndash; 可以设置jar包的入口类(可选) &ndash;&gt;-->
<!-- <mainClass>org.dinky.app.MainApp</mainClass>-->
<!-- </manifest>-->
<!-- </archive>-->
<!-- <outputDirectory>${project.parent.parent.basedir}/build/extends</outputDirectory>-->

<!-- </configuration>-->
<!-- <executions>-->
<!-- <execution>-->
<!-- <id>make-assembly</id>-->
<!-- <goals>-->
<!-- <goal>single</goal>-->
<!-- </goals>-->
<!-- <phase>package</phase>-->
<!-- </execution>-->
<!-- </executions>-->
<!-- </plugin>-->

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<configuration>
<finalName>${project.build.finalName}-jar-with-dependencies</finalName>
<outputDirectory>${project.parent.parent.basedir}/build/extends</outputDirectory>
<minimizeJar>true</minimizeJar>
<createDependencyReducedPom>false</createDependencyReducedPom>
<filters>
<filter>
<artifact>org.dinky:*</artifact>
Expand All @@ -96,12 +69,14 @@
<exclude>support/**</exclude>
<exclude>springfox/**</exclude>
<exclude>org/slf4j/**</exclude>
<exclude>org/springframework/**</exclude>
<exclude>javax/**</exclude>
<exclude>javassist/**</exclude>
<exclude>Class50/**</exclude>
<exclude>lombok/**</exclude>
<exclude>com/alibaba/druid/**</exclude>
<exclude>META-INF/resource/**</exclude>
<exclude>freemarker/**</exclude>
<exclude>com.sun/**</exclude>
<exclude>META-INF/resources/**</exclude>
</excludes>
</filter>
</filters>
Expand All @@ -122,7 +97,6 @@
</execution>
</executions>
</plugin>

</plugins>
</build>
</project>

0 comments on commit deac85c

Please sign in to comment.