打包优化

This commit is contained in:
guwd 2020-09-09 18:05:06 +08:00
parent 3335a52a22
commit dea070c6c0
7 changed files with 151 additions and 70 deletions

View File

@ -39,13 +39,12 @@
</fileSet>
<fileSet>
<directory>src/main/webapp/WEB-INF</directory>
<outputDirectory>./lib/WEB-INF</outputDirectory>
<outputDirectory>./WEB-INF</outputDirectory>
</fileSet>
<fileSet>
<directory>./bin</directory>
<includes>
<include>*.sh</include>
<include>*.cmd</include>
<include>*.bat</include>
</includes>
<outputDirectory>./</outputDirectory>

6
bin/start.sh Normal file
View File

@ -0,0 +1,6 @@
#!/bin/sh
java -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=128m -Xms1024m -Xmx1024m -Xmn256m -Xss256k -XX:SurvivorRatio=8 -XX:+UseConcMarkSweepGC \
-Dloader.path=lib,config \
-jar -Dfile.encoding=utf-8 -Duser.timezone=GMT+08 -Duser.language=zh -Duser.region=CN ./ms-mcms.jar
:: > boot.log 2>&1

2
bin/stop.sh Normal file
View File

@ -0,0 +1,2 @@
#!/bin/sh
killall -9 java

131
pom-bin.xml Normal file
View File

@ -0,0 +1,131 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.2.RELEASE</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>net.mingsoft</groupId>
<artifactId>ms-mcms</artifactId>
<version>5.1-SNAPSHOT</version>
<name>ms-mcms</name>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>net.mingsoft</groupId>
<artifactId>ms-mpeople</artifactId>
<version>1.0.25</version>
</dependency>
<!-- 此部分是铭飞平台MStroe的客户端MStore不在铭飞开源产品范围如果不需要使用MStore可以删除掉 -->
<dependency>
<groupId>net.mingsoft</groupId>
<artifactId>store-client</artifactId>
<version>3.0</version>
</dependency>
</dependencies>
<build>
<finalName>ms-mcms</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
<!--打包生产-->
<configuration>
<layout>ZIP</layout>
<includes>
<include>
<groupId>non-exists</groupId>
<artifactId>non-exists</artifactId>
</include>
</includes>
<fork>true</fork>
</configuration>
</plugin>
<!--
打包生产
-->
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
<excludeTransitive>false</excludeTransitive>
<stripVersion>false</stripVersion>
<includeScope>runtime</includeScope>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<descriptors>
<descriptor>./bin/assembly.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/java</directory>
<excludes>
<!--打包生产-->
<exclude>*.java</exclude>
</excludes>
</resource>
<resource>
<directory>src/main/webapp</directory>
<excludes>
<!--打包生产-->
<exclude>static/**</exclude>
<exclude>html/**</exclude>
<exclude>upload/**</exclude>
<exclude>templets/**</exclude>
<exclude>WEB-INF/**</exclude>
</excludes>
</resource>
</resources>
<defaultGoal>compile</defaultGoal>
</build>
</project>

68
pom.xml
View File

@ -51,75 +51,17 @@
</goals>
</execution>
</executions>
<!-- 自定义打包 重写包含依赖包含不存在的依赖jar里没有pom里的依赖
<configuration>
<layout>ZIP</layout>
<includes>
<include>
<groupId>non-exists</groupId>
<artifactId>non-exists</artifactId>
</include>
</includes>
<fork>true</fork>
</configuration>-->
</plugin>
<!--拷贝第三方依赖文件到指定目录 ${project.build.directory}/lib /lib是依赖jar包的输出目录根据自己喜好配置
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
<excludeTransitive>false</excludeTransitive>
<stripVersion>false</stripVersion>
<includeScope>runtime</includeScope>
</configuration>
</execution>
</executions>
</plugin>-->
<!-- 自定义打zip包
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<descriptors>
<descriptor>./assembly/assembly.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>-->
</plugins>
<resources>
<resource>
<directory>src/main/webapp</directory>
<excludes>
<exclude>static/**</exclude>
<exclude>html/**</exclude>
<exclude>upload/**</exclude>
<exclude>templets/**</exclude>
<!-- 管理页面WEB-INF/manger单独配置在jar外面修改部分ftl避免重新jar打包 -->
<!--<exclude>WEB-INF/</exclude>-->
</excludes>
<directory>src/main/java</directory>
</resource>
<resource>
<directory>src/main/java</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
<directory>src/main/resources</directory>
</resource>
<resource>
<directory>src/main/webapp</directory>
</resource>
</resources>
<defaultGoal>compile</defaultGoal>

View File

@ -1,5 +1,5 @@
server:
port: 8081
port: 8080
servlet.session.timeout: P0DT60M0S #D天H小时M分钟S秒字符T是紧跟在时分秒之前的每个单位都必须由数字开始,且时分秒顺序不能乱
# ssl: #https证书配置 配置了之后只能通过https访问应用
# key-store: ms.pfx 证书文件
@ -13,11 +13,14 @@ logging:
path: log #会在项目的根目录下生成log目录里面会生成对应的日期目录日期目录下面生成日志压缩包备份文件,默认按每10M分割一个日志文件例如log/2020-01/app-2020-01-03-18.1.log.gz表示2020年1月3号下午六点的第一个备份也可以根据实际情况写绝对路径例如d:/log
ms:
mstore:
http: http://store.new.mingsoft.net
host: store.new.mingsoft.net
# scheme: https #解决使用代理服务器代理应用时标签解析域名依旧为http的问题
swagger:
enable: true #启用swagger文档生产的时候务必关掉
manager:
path: /ms #后台访问的路径,如:http://项目/ms/login.do的时候建议修改
path: /ms #后台访问的路径,如:http://项目/ms/login.do的时候建议修改
view-path: /WEB-INF/manager #后台视图层路径配置
chcek-code: true #默认开启验证码验证false验证码不验证
@ -66,8 +69,7 @@ spring:
expose-session-attributes: true
expose-spring-macro-helpers: true
prefer-file-system-access: false
template-loader-path: classpath:/WEB-INF/manager,classpath:/WEB-INF
#template-loader-path: file:WEB-INF/,file:WEB-INF/manager,classpath:/,classpath:/WEB-INF/manager,classpath:/WEB-INF 管理页面WEB-INF/manger单独配置在jar外面修改部分ftl避免重新jar打包
template-loader-path: file:WEB-INF/,file:WEB-INF/manager,classpath:/,classpath:/WEB-INF/manager,classpath:/WEB-INF
settings:
template_update_delay: 1
default_encoding: UTF-8

View File

@ -487,7 +487,6 @@
cursor: pointer;
outline-offset: -1px;
max-width:100%;
height: 69px;
flex-direction: column;
display: flex;
animation-duration: 1s;