mirror of
https://gitee.com/willfree/min-dev-java.git
synced 2026-06-03 16:16:14 +08:00
轻量化SDK
This commit is contained in:
@@ -51,43 +51,88 @@
|
||||
<!-- </executions>-->
|
||||
<!-- </plugin>-->
|
||||
|
||||
<!-- 第二种方案:maven-assembly-plugin-->
|
||||
<!-- 第二种方案:maven-assembly-plugin,非轻量化时的首选方案-->
|
||||
<!-- Maven Assembly Plugin 2.4.1-->
|
||||
<!-- <plugin>-->
|
||||
<!-- <groupId>org.apache.maven.plugins</groupId>-->
|
||||
<!-- <artifactId>maven-assembly-plugin</artifactId>-->
|
||||
<!-- <version>3.3.0</version>-->
|
||||
<!-- <configuration>-->
|
||||
<!--<!– get all project dependencies –>-->
|
||||
<!--<!– <descriptorRefs>–>-->
|
||||
<!--<!– <descriptorRef>jar-with-dependencies</descriptorRef>–>-->
|
||||
<!--<!– </descriptorRefs>–>-->
|
||||
<!-- <descriptors>-->
|
||||
<!-- <!–assembly配置文件路径,注意需要在项目中新建文件properties/assembly-release.xml–>-->
|
||||
<!-- <descriptor>properties/assembly-release.xml</descriptor>-->
|
||||
<!-- </descriptors>-->
|
||||
<!-- <!– MainClass in mainfest make a executable jar –>-->
|
||||
<!-- <archive>-->
|
||||
<!-- <manifest>-->
|
||||
<!-- <mainClass>min.Main</mainClass>-->
|
||||
<!-- </manifest>-->
|
||||
<!-- <manifestEntries>-->
|
||||
<!-- <Class-Path>lib/*.jar</Class-Path>-->
|
||||
<!-- </manifestEntries>-->
|
||||
<!-- </archive>-->
|
||||
<!-- </configuration>-->
|
||||
<!-- <executions>-->
|
||||
<!-- <execution>-->
|
||||
<!-- <id>make-assembly</id>-->
|
||||
<!-- <!– bind to the packaging phase –>-->
|
||||
<!-- <phase>package</phase>-->
|
||||
<!-- <goals>-->
|
||||
<!-- <goal>single</goal>-->
|
||||
<!-- </goals>-->
|
||||
<!-- </execution>-->
|
||||
<!-- </executions>-->
|
||||
<!-- </plugin>-->
|
||||
|
||||
<!-- 第n种方案,中移要求的安卓SDK轻量化,那么这个项目也要尽可能的小,使用minimizeJar来轻量化-->
|
||||
<!-- 引入 maven-shade-plugin 插件 -->
|
||||
<!-- 使用这个插件,lib目录下的commons-codec-1.15.jar要手动放在安卓端,否则会报错缺少类-->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>3.3.0</version>
|
||||
<configuration>
|
||||
<!-- get all project dependencies -->
|
||||
<!-- <descriptorRefs>-->
|
||||
<!-- <descriptorRef>jar-with-dependencies</descriptorRef>-->
|
||||
<!-- </descriptorRefs>-->
|
||||
<descriptors>
|
||||
<!--assembly配置文件路径,注意需要在项目中新建文件properties/assembly-release.xml-->
|
||||
<descriptor>properties/assembly-release.xml</descriptor>
|
||||
</descriptors>
|
||||
<!-- MainClass in mainfest make a executable jar -->
|
||||
<archive>
|
||||
<manifest>
|
||||
<mainClass>min.Main</mainClass>
|
||||
</manifest>
|
||||
<manifestEntries>
|
||||
<Class-Path>lib/*.jar</Class-Path>
|
||||
</manifestEntries>
|
||||
</archive>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>make-assembly</id>
|
||||
<!-- bind to the packaging phase -->
|
||||
<!-- 绑定 Maven 生命周期的 package 阶段 -->
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
<!-- package 阶段执行时,让其调用插件的 repackage 目标 -->
|
||||
<goal>shade</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<transformers>
|
||||
<!-- 设置 META-INF/spring.handlers 文件追加而非覆盖 -->
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
|
||||
<resource>META-INF/spring.handlers</resource>
|
||||
</transformer>
|
||||
<!-- 设置 META-INF/spring.schemas 文件追加而非覆盖 -->
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
|
||||
<resource>META-INF/spring.schemas</resource>
|
||||
</transformer>
|
||||
<!-- 设置 META-INF/spring.factories文件追加而非覆盖 -->
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
|
||||
<resource>META-INF/spring.factories</resource>
|
||||
</transformer>
|
||||
<!-- 设置 Java SPI 追加而非覆盖 -->
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
|
||||
</transformers>
|
||||
<minimizeJar>true</minimizeJar>
|
||||
<filters>
|
||||
<filter>
|
||||
<artifact>org.bouncycastle:bcpkix-jdk15on</artifact>
|
||||
<includes>
|
||||
<include>**</include>
|
||||
</includes>
|
||||
</filter>
|
||||
</filters>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<!-- 第一种方案:onejar-->
|
||||
<!-- <plugin>-->
|
||||
<!-- <groupId>org.apache.maven.plugins</groupId>-->
|
||||
@@ -187,6 +232,12 @@
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.12</version>
|
||||
<scope>test</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>hamcrest-core</artifactId>
|
||||
<groupId>org.hamcrest</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api -->
|
||||
<dependency>
|
||||
@@ -194,6 +245,16 @@
|
||||
<artifactId>junit-jupiter-api</artifactId>
|
||||
<version>5.6.0</version>
|
||||
<scope>test</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>apiguardian-api</artifactId>
|
||||
<groupId>org.apiguardian</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>junit-platform-commons</artifactId>
|
||||
<groupId>org.junit.platform</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<!-- bc库, 国密算法-->
|
||||
@@ -272,6 +333,12 @@
|
||||
<groupId>org.openjdk.jmh</groupId>
|
||||
<artifactId>jmh-core</artifactId>
|
||||
<version>1.23</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>jopt-simple</artifactId>
|
||||
<groupId>net.sf.jopt-simple</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.openjdk.jmh</groupId>
|
||||
@@ -286,6 +353,44 @@
|
||||
<groupId>com.github.jnr</groupId>
|
||||
<artifactId>jnr-unixsocket</artifactId>
|
||||
<version>0.18</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>jffi</artifactId>
|
||||
<groupId>com.github.jnr</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>jnr-posix</artifactId>
|
||||
<groupId>com.github.jnr</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>jnr-x86asm</artifactId>
|
||||
<groupId>com.github.jnr</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>asm</artifactId>
|
||||
<groupId>org.ow2.asm</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>asm-tree</artifactId>
|
||||
<groupId>org.ow2.asm</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>asm-commons</artifactId>
|
||||
<groupId>org.ow2.asm</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>asm-util</artifactId>
|
||||
<groupId>org.ow2.asm</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>asm-analysis</artifactId>
|
||||
<groupId>org.ow2.asm</groupId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<artifactId>jnr-constants</artifactId>
|
||||
<groupId>com.github.jnr</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<!-- <!– https://mvnrepository.com/artifact/com.cloudbees.util/jnr-unixsocket-nodep –>-->
|
||||
<!-- <dependency>-->
|
||||
|
||||
@@ -70,6 +70,8 @@
|
||||
<exclude>org.jetbrains.kotlin:kotlin-stdlib</exclude>
|
||||
<exclude>org.jetbrains.kotlin:kotlin-stdlib-common</exclude>
|
||||
<exclude>org.jetbrains:annotations</exclude>
|
||||
<exclude>org.junit.jupiter:junit-jupiter-api</exclude>
|
||||
<exclude>com.some.library:unused-library</exclude>
|
||||
<!-- <exclude>org.jetbrains.kotlin:kotlin-stdlib-jdk8</exclude>-->
|
||||
<!-- <exclude>org.jetbrains.kotlin:kotlin-stdlib-reflect</exclude>-->
|
||||
<!-- <exclude>org.jetbrains.kotlin:kotlin-android-extensions-runtime</exclude>-->
|
||||
|
||||
@@ -4,7 +4,6 @@ import component.ComponentException;
|
||||
import encoding.Block;
|
||||
import encoding.Encoder;
|
||||
import encoding.IEncodingAble;
|
||||
import jnr.ffi.annotations.In;
|
||||
|
||||
/*
|
||||
* @Author: Wang Feng
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package minsecurity.identity;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import minsecurity.Common;
|
||||
import minsecurity.certificate.cert.CertException;
|
||||
import minsecurity.certificate.cert.CertUtils;
|
||||
|
||||
Reference in New Issue
Block a user