打包优化

This commit is contained in:
wangtp 2021-01-18 15:36:14 +08:00
parent e6252e9c87
commit 702d8d8583
13 changed files with 76 additions and 61 deletions

View File

@ -10,7 +10,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>net.mingsoft</groupId> <groupId>net.mingsoft</groupId>
<artifactId>ms-mcms</artifactId> <artifactId>ms-mcms</artifactId>
<version>5.1</version> <version>5.2.0</version>
<name>ms-mcms</name> <name>ms-mcms</name>
<properties> <properties>
<java.version>1.8</java.version> <java.version>1.8</java.version>

Binary file not shown.

Binary file not shown.

114
pom.xml
View File

@ -3,77 +3,108 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent> <parent>
<groupId>net.mingsoft</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>ms-pom</artifactId> <artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.4</version> <version>2.2.2.RELEASE</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>net.mingsoft</groupId> <groupId>net.mingsoft</groupId>
<artifactId>ms-mcms</artifactId> <artifactId>ms-mcms</artifactId>
<version>5.2.0.RELEASE</version> <version>5.2.0.RELEASE</version>
<name>ms-mcms</name> <name>ms-mcms</name>
<!-- 打包jar包 -->
<packaging>jar</packaging>
<!-- 打包war包 --> <!-- 打包war包 -->
<!-- <packaging>war</packaging> --> <!-- <packaging>war</packaging>-->
<properties> <properties>
<java.version>1.8</java.version> <java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties> </properties>
<repositories> <repositories>
<repository> <repository>
<id>central-repos</id> <id>central-repos</id>
<name>Central Repository 2</name> <name>Central Repository 2</name>
<url>https://repo.maven.apache.org/maven2/</url> <url>https://repo.maven.apache.org/maven2/</url>
</repository> </repository>
<!--阿里云仓库--> <!--阿里云仓库-->
<!-- <!--
<repository> <repository>
<id>alimaven</id> <id>alimaven</id>
<name>aliyun maven</name> <name>aliyun maven</name>
<url>https://maven.aliyun.com/nexus/content/groups/public/</url> <url>https://maven.aliyun.com/nexus/content/groups/public/</url>
<releases> <releases>
<enabled>true</enabled> <enabled>true</enabled>
</releases> </releases>
<snapshots> <snapshots>
<enabled>true</enabled> <enabled>true</enabled>
</snapshots> </snapshots>
</repository> </repository>
--> -->
</repositories> </repositories>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>net.mingsoft</groupId> <groupId>net.mingsoft</groupId>
<artifactId>ms-base</artifactId> <artifactId>ms-base</artifactId>
<version>1.0.25</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.mingsoft</groupId> <groupId>net.mingsoft</groupId>
<artifactId>ms-basic</artifactId> <artifactId>ms-basic</artifactId>
<version>1.0.36</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.mingsoft</groupId> <groupId>net.mingsoft</groupId>
<artifactId>ms-mdiy</artifactId> <artifactId>ms-mdiy</artifactId>
<version>1.0.28</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.mingsoft</groupId> <groupId>net.mingsoft</groupId>
<artifactId>ms-mpeople</artifactId> <artifactId>ms-mpeople</artifactId>
<version>1.0.33</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.mingsoft</groupId> <groupId>net.mingsoft</groupId>
<artifactId>store-client</artifactId> <artifactId>store-client</artifactId>
<version>5.2</version>
</dependency> </dependency>
<dependency>
<groupId>dm</groupId>
<artifactId>dm</artifactId>
<version>8</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/DmJdbcDriver18.jar</systemPath>
</dependency>
</dependencies> </dependencies>
<build> <build>
<finalName>ms-mcms</finalName> <finalName>ms-mcms</finalName>
<resources>
<resource>
<directory>src/main/webapp</directory>
<excludes>
<!-- 打包生产并手动将static、html、upload、template复制到生产 -->
<exclude>static/</exclude>
<exclude>html/</exclude>
<exclude>upload/</exclude>
<exclude>template/</exclude>
<!-- 如果生产需要实时修改WEB-INF/下的页面可启用这行并手动将项目中的WEB-INF目录复制到运行环境 -->
<!-- <exclude>WEB-INF/</exclude>-->
</excludes>
</resource>
<resource>
<directory>src/main/resources</directory>
</resource>
<resource>
<directory>src/main/java</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
</resources>
<plugins> <plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<executable>true</executable>
</configuration>
</plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
@ -97,22 +128,7 @@
</dependency> </dependency>
</dependencies> </dependencies>
</plugin> </plugin>
</plugins> </plugins>
<resources>
<resource>
<directory>src/main/webapp</directory>
</resource>
<resource>
<directory>src/main/resources</directory>
</resource>
<resource>
<directory>src/main/java</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
</resources>
<defaultGoal>compile</defaultGoal> <defaultGoal>compile</defaultGoal>
</build> </build>
</project> </project>

View File

@ -86,8 +86,8 @@ public class WebConfig implements WebMvcConfigurer {
@Override @Override
public void addResourceHandlers(ResourceHandlerRegistry registry) { public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler(uploadMapping).addResourceLocations(File.separator+uploadFloderPath+File.separator,"file:"+uploadFloderPath+File.separator); registry.addResourceHandler(uploadMapping).addResourceLocations(File.separator+uploadFloderPath+File.separator,"file:"+uploadFloderPath+File.separator,"classpath:/template/");
registry.addResourceHandler("/template/**").addResourceLocations(File.separator+template+File.separator,"file:"+template+File.separator); registry.addResourceHandler("/template/**").addResourceLocations(File.separator+template+File.separator,"file:"+template+File.separator,"classpath:/html/");
registry.addResourceHandler("/html/**").addResourceLocations("/html/","file:html/"); registry.addResourceHandler("/html/**").addResourceLocations("/html/","file:html/");
//三种映射方式 webapp下当前目录下jar内 //三种映射方式 webapp下当前目录下jar内
registry.addResourceHandler("/app/**").addResourceLocations("/app/","file:app/", "classpath:/app/"); registry.addResourceHandler("/app/**").addResourceLocations("/app/","file:app/", "classpath:/app/");
@ -137,7 +137,7 @@ public class WebConfig implements WebMvcConfigurer {
*/ */
@Override @Override
public void addViewControllers(ViewControllerRegistry registry) { public void addViewControllers(ViewControllerRegistry registry) {
registry.addViewController("/").setViewName("forward:/index"); registry.addViewController("/").setViewName("forward:/index.do");
registry.setOrder(Ordered.HIGHEST_PRECEDENCE); registry.setOrder(Ordered.HIGHEST_PRECEDENCE);
WebMvcConfigurer.super.addViewControllers(registry); WebMvcConfigurer.super.addViewControllers(registry);
} }

View File

@ -20,7 +20,7 @@ ms:
manager: manager:
path: /ms #后台访问的路径,如:http://项目/ms/login.do生产的时候建议修改 path: /ms #后台访问的路径,如:http://项目/ms/login.do生产的时候建议修改
view-path: /WEB-INF/manager #后台视图层路径配置 view-path: /WEB-INF/manager #后台视图层路径配置
check-code: false #默认开启验证码验证false验证码不验证 check-code: true #默认开启验证码验证false验证码不验证
upload: upload:
enable-web: true #启用web层的上传 enable-web: true #启用web层的上传

View File

@ -42,7 +42,7 @@
<span class="title"> ${field.typetitle} </span> <span class="title"> ${field.typetitle} </span>
{/ms:channel} {/ms:channel}
<#assign typetitle=field.typetitle> <#assign typetitle=field.typetitle>
<#if field.leaf> <#if field.typeleaf>
{ms:channel type='level'} {ms:channel type='level'}
<a href="{ms:global.url/}${field.typelink}" class="<#if typetitle==field.typetitle>sub-title-sel<#else>sub-title</#if>"> ${field.typetitle} </a> <a href="{ms:global.url/}${field.typelink}" class="<#if typetitle==field.typetitle>sub-title-sel<#else>sub-title</#if>"> ${field.typetitle} </a>
{/ms:channel} {/ms:channel}

View File

@ -605,7 +605,6 @@
.ms-nav .body .nav-search .ms-search-input .ms-search-button { .ms-nav .body .nav-search .ms-search-input .ms-search-button {
flex-direction: row; flex-direction: row;
background-image: url({ms:global.host/}/{ms:global.style/}/images/1601265263422.png);
display: flex; display: flex;
width: 40px; width: 40px;
box-sizing: border-box; box-sizing: border-box;

View File

@ -43,7 +43,7 @@
<span class="title"> ${field.typetitle} </span> <span class="title"> ${field.typetitle} </span>
{/ms:channel} {/ms:channel}
<#assign typetitle=field.typetitle> <#assign typetitle=field.typetitle>
<#if field.leaf> <#if field.typeleaf>
{ms:channel type='level'} {ms:channel type='level'}
<a href="{ms:global.url/}${field.typelink}" class="<#if typetitle==field.typetitle>sub-title-sel<#else>sub-title</#if>"> ${field.typetitle} </a> <a href="{ms:global.url/}${field.typelink}" class="<#if typetitle==field.typetitle>sub-title-sel<#else>sub-title</#if>"> ${field.typetitle} </a>
{/ms:channel} {/ms:channel}

View File

@ -42,7 +42,7 @@
<span class="title"> ${field.typetitle}</span> <span class="title"> ${field.typetitle}</span>
{/ms:channel} {/ms:channel}
<#assign typetitle=field.typetitle> <#assign typetitle=field.typetitle>
<#if field.leaf> <#if field.typeleaf>
{ms:channel type='level'} {ms:channel type='level'}
<a href="{ms:global.url/}${field.typelink}" class="<#if typetitle==field.typetitle>sub-title-sel<#else>sub-title</#if>"> ${field.typetitle} </a> <a href="{ms:global.url/}${field.typelink}" class="<#if typetitle==field.typetitle>sub-title-sel<#else>sub-title</#if>"> ${field.typetitle} </a>
{/ms:channel} {/ms:channel}

View File

@ -42,7 +42,7 @@
<span class="title"> ${field.typetitle} </span> <span class="title"> ${field.typetitle} </span>
{/ms:channel} {/ms:channel}
<#assign typetitle=field.typetitle> <#assign typetitle=field.typetitle>
<#if field.leaf> <#if field.typeleaf>
{ms:channel type='level'} {ms:channel type='level'}
<a href="{ms:global.url/}${field.typelink}" class="<#if typetitle==field.typetitle>sub-title-sel<#else>sub-title</#if>"> ${field.typetitle} </a> <a href="{ms:global.url/}${field.typelink}" class="<#if typetitle==field.typetitle>sub-title-sel<#else>sub-title</#if>"> ${field.typetitle} </a>
{/ms:channel} {/ms:channel}

View File

@ -43,7 +43,7 @@
<span class="title"> ${field.typetitle} </span> <span class="title"> ${field.typetitle} </span>
{/ms:channel} {/ms:channel}
<#assign typetitle=field.typetitle> <#assign typetitle=field.typetitle>
<#if field.leaf> <#if field.typeleaf>
{ms:channel type='level'} {ms:channel type='level'}
<a href="{ms:global.url/}${field.typelink}" class="<#if typetitle==field.typetitle>sub-title-sel<#else>sub-title</#if>"> ${field.typetitle} </a> <a href="{ms:global.url/}${field.typelink}" class="<#if typetitle==field.typetitle>sub-title-sel<#else>sub-title</#if>"> ${field.typetitle} </a>
{/ms:channel} {/ms:channel}