feat[litemall-all-war]: 创建litemall-all-war模块,用于tomcat部署的war包。
This commit is contained in:
@@ -275,8 +275,4 @@ node_modules是litemall-admin和litemall-vue模块所依赖的项目库,可能
|
|||||||
2. 然后分别创建空的node_modules文件夹;
|
2. 然后分别创建空的node_modules文件夹;
|
||||||
3. 重新打开IDEA,分别设置litemall-admin模块和litemall-vue模块的node_modules文件夹Excluded状态。
|
3. 重新打开IDEA,分别设置litemall-admin模块和litemall-vue模块的node_modules文件夹Excluded状态。
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
### 4.2 项目war打包
|
|
||||||
|
|
||||||
目前不支持,请开发者自行实践。
|
|
||||||
@@ -5,6 +5,7 @@
|
|||||||
* litemall-core模块
|
* litemall-core模块
|
||||||
* litemall-db模块
|
* litemall-db模块
|
||||||
* litemall-all模块
|
* litemall-all模块
|
||||||
|
* litemall-all-war模块
|
||||||
|
|
||||||
litemall-db模块提供数据库访问服务。
|
litemall-db模块提供数据库访问服务。
|
||||||
|
|
||||||
@@ -13,6 +14,8 @@ litemall-core模块提供通用服务。
|
|||||||
litemall-all模块则只是一个包裹模块,几乎没有任何代码。该模块的作用是融合两个spring boot模块
|
litemall-all模块则只是一个包裹模块,几乎没有任何代码。该模块的作用是融合两个spring boot模块
|
||||||
和litemall-admin模块静态文件到一个单独Spring Boot可执行jar包中。
|
和litemall-admin模块静态文件到一个单独Spring Boot可执行jar包中。
|
||||||
|
|
||||||
|
litemall-all-war模块和litemall-all模块是一样的作用,只是采用war打包方式。
|
||||||
|
|
||||||
## 2.2 litemall-db
|
## 2.2 litemall-db
|
||||||
|
|
||||||
litemall-db模块是一个普通的Spring Boot应用,基于mybatis框架实现数据库访问操作,对外提供业务数据访问服务。
|
litemall-db模块是一个普通的Spring Boot应用,基于mybatis框架实现数据库访问操作,对外提供业务数据访问服务。
|
||||||
@@ -646,3 +649,9 @@ public interface Storage {
|
|||||||
注意:
|
注意:
|
||||||
> 这个插件只是简单的拷贝操作;因此开发者应该在打包litemall-all
|
> 这个插件只是简单的拷贝操作;因此开发者应该在打包litemall-all
|
||||||
> 之前确保先编译litemall-admin模块得到最终静态文件。
|
> 之前确保先编译litemall-admin模块得到最终静态文件。
|
||||||
|
|
||||||
|
|
||||||
|
## 2.5 litemall-all-war
|
||||||
|
|
||||||
|
litemall-all-war模块就是对litemall-all模块进行少量调整,
|
||||||
|
最后打包时会在target目录下面生成litemall.war,用于tomcat部署。
|
||||||
3
litemall-all-war/.gitignore
vendored
Normal file
3
litemall-all-war/.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
|
||||||
|
/target/
|
||||||
|
/litemall-all-war.iml
|
||||||
83
litemall-all-war/pom.xml
Normal file
83
litemall-all-war/pom.xml
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<artifactId>litemall-all-war</artifactId>
|
||||||
|
<packaging>war</packaging>
|
||||||
|
|
||||||
|
<parent>
|
||||||
|
<groupId>org.linlinjava</groupId>
|
||||||
|
<artifactId>litemall</artifactId>
|
||||||
|
<version>0.1.0</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.linlinjava</groupId>
|
||||||
|
<artifactId>litemall-core</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.linlinjava</groupId>
|
||||||
|
<artifactId>litemall-db</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.linlinjava</groupId>
|
||||||
|
<artifactId>litemall-wx-api</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.linlinjava</groupId>
|
||||||
|
<artifactId>litemall-admin-api</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-tomcat</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<finalName>litemall</finalName>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-resources-plugin</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>copy-resources</id>
|
||||||
|
<phase>validate</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>copy-resources</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<outputDirectory>${basedir}/target/classes/static</outputDirectory>
|
||||||
|
<resources>
|
||||||
|
<resource>
|
||||||
|
<directory>../litemall-admin/dist</directory>
|
||||||
|
</resource>
|
||||||
|
</resources>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
<execution>
|
||||||
|
<id>copy-resources-vue</id>
|
||||||
|
<phase>validate</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>copy-resources</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<outputDirectory>${basedir}/target/classes/static/vue</outputDirectory>
|
||||||
|
<resources>
|
||||||
|
<resource>
|
||||||
|
<directory>../litemall-vue/dist</directory>
|
||||||
|
</resource>
|
||||||
|
</resources>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
</project>
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package org.linlinjava.litemall;
|
||||||
|
|
||||||
|
import org.mybatis.spring.annotation.MapperScan;
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||||
|
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
|
||||||
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||||
|
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||||
|
|
||||||
|
@SpringBootApplication(scanBasePackages = {"org.linlinjava.litemall"})
|
||||||
|
@MapperScan("org.linlinjava.litemall.db.dao")
|
||||||
|
@EnableTransactionManagement
|
||||||
|
@EnableScheduling
|
||||||
|
public class Application extends SpringBootServletInitializer {
|
||||||
|
|
||||||
|
public static void main(String[] args) throws Exception {
|
||||||
|
SpringApplication.run(Application.class, args);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
|
||||||
|
return builder.sources(Application.class);
|
||||||
|
}
|
||||||
|
}
|
||||||
8
litemall-all-war/src/main/resources/application.yml
Normal file
8
litemall-all-war/src/main/resources/application.yml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
spring:
|
||||||
|
profiles:
|
||||||
|
active: db, core, admin, wx
|
||||||
|
messages:
|
||||||
|
encoding: UTF-8
|
||||||
|
|
||||||
|
logging:
|
||||||
|
config: classpath:logback-spring.xml
|
||||||
58
litemall-all-war/src/main/resources/logback-spring.xml
Normal file
58
litemall-all-war/src/main/resources/logback-spring.xml
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<configuration debug="true">
|
||||||
|
<contextName>logback</contextName>
|
||||||
|
<property name="log.path" value="logs" />
|
||||||
|
|
||||||
|
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||||
|
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
||||||
|
<level>debug</level>
|
||||||
|
</filter>
|
||||||
|
<encoder>
|
||||||
|
<pattern>%d{HH:mm:ss.SSS} %contextName [%thread] %-5level %logger{36} - %msg%n
|
||||||
|
</pattern>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<appender name="file" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<file>${log.path}/log.log</file>
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<fileNamePattern>${log.path}/log-%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||||
|
</rollingPolicy>
|
||||||
|
|
||||||
|
<encoder>
|
||||||
|
<pattern>%date %level [%thread] %logger{36} [%file : %line] %msg%n
|
||||||
|
</pattern>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<appender name="error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<file>${log.path}/error.log</file>
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<fileNamePattern>${log.path}/error-%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||||
|
</rollingPolicy>
|
||||||
|
|
||||||
|
<encoder>
|
||||||
|
<pattern>%date %level [%thread] %logger{36} [%file : %line] %msg%n
|
||||||
|
</pattern>
|
||||||
|
</encoder>
|
||||||
|
<!-- 此日志文件只记录ERROR级别的 -->
|
||||||
|
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||||
|
<level>ERROR</level>
|
||||||
|
<onMatch>ACCEPT</onMatch>
|
||||||
|
<onMismatch>DENY</onMismatch>
|
||||||
|
</filter>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<root level="ERROR">
|
||||||
|
<appender-ref ref="console" />
|
||||||
|
<appender-ref ref="file" />
|
||||||
|
<appender-ref ref="error" />
|
||||||
|
</root>
|
||||||
|
<logger name="org.mybatis" level="ERROR" />
|
||||||
|
<logger name="org.springframework" level="ERROR" />
|
||||||
|
<logger name="org.linlinjava.litemall.core" level="ERROR" />
|
||||||
|
<logger name="org.linlinjava.litemall.db" level="ERROR" />
|
||||||
|
<logger name="org.linlinjava.litemall.admin" level="DEBUG" />
|
||||||
|
<logger name="org.linlinjava.litemall.wx" level="DEBUG" />
|
||||||
|
<logger name="org.linlinjava.litemall" level="DEBUG" />
|
||||||
|
</configuration>
|
||||||
1
pom.xml
1
pom.xml
@@ -25,6 +25,7 @@
|
|||||||
<module>litemall-wx-api</module>
|
<module>litemall-wx-api</module>
|
||||||
<module>litemall-admin-api</module>
|
<module>litemall-admin-api</module>
|
||||||
<module>litemall-all</module>
|
<module>litemall-all</module>
|
||||||
|
<module>litemall-all-war</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
<dependencyManagement>
|
<dependencyManagement>
|
||||||
|
|||||||
Reference in New Issue
Block a user