From f7f7557d4dda5d0ad3c46e4c5f5791b278cc3bfc Mon Sep 17 00:00:00 2001
From: 疯狂的狮子li <15040126243@163.com>
Date: 星期二, 01 十二月 2020 11:44:29 +0800
Subject: [PATCH] 项目修改为 maven多环境配置

---
 ruoyi-admin/src/main/resources/application-prod.yml |    0 
 pom.xml                                             |   28 ++++++++++++++++++++++++++++
 ruoyi-admin/src/main/resources/application.yml      |    4 ++--
 README.md                                           |    1 +
 4 files changed, 31 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index 42a6a04..8e3ee8e 100644
--- a/README.md
+++ b/README.md
@@ -4,6 +4,7 @@
 * Bean绠�鍖� 浣跨敤 Lombok 绠�鍖� get set toString 绛夌瓑
 * 瀹瑰櫒鏀瑰姩 Tomcat 鏀逛负 骞跺彂鎬ц兘鏇村ソ鐨� undertow
 * 浠g爜鐢熸垚妯℃澘 鏀逛负閫傞厤 Mybatis-Plus 鐨勪唬鐮�
+* 椤圭洰淇敼涓� maven澶氱幆澧冮厤缃�
 * 閲嶇鏇存柊 鍗囩骇MybatisPlus 3.4.1 閲嶅啓閰嶇疆鏂囦欢璇︾粏娉ㄩ噴 鏇存柊鎵�鏈夋彃浠�
 * 鍚屾鍗囩骇 3.2.1 淇閲嶅ぇbug 闃绘浠绘剰鏂囦欢涓嬭浇婕忔礊
 
diff --git a/pom.xml b/pom.xml
index 5c0870d..db9ebfb 100644
--- a/pom.xml
+++ b/pom.xml
@@ -249,6 +249,12 @@
                 </configuration>
             </plugin>
         </plugins>
+        <resources>
+            <resource>
+                <directory>src/main/resources</directory>
+                <filtering>true</filtering>
+            </resource>
+        </resources>
     </build>
 
     <repositories>
@@ -276,4 +282,26 @@
         </pluginRepository>
     </pluginRepositories>
 
+    <profiles>
+        <profile>
+            <id>dev</id>
+            <properties>
+                <!-- 鐜鏍囪瘑锛岄渶瑕佷笌閰嶇疆鏂囦欢鐨勫悕绉扮浉瀵瑰簲 -->
+                <profiles.active>dev</profiles.active>
+                <logging.level>debug</logging.level>
+            </properties>
+            <activation>
+                <!-- 榛樿鐜 -->
+                <activeByDefault>true</activeByDefault>
+            </activation>
+        </profile>
+        <profile>
+            <id>prod</id>
+            <properties>
+                <profiles.active>prod</profiles.active>
+                <logging.level>warn</logging.level>
+            </properties>
+        </profile>
+    </profiles>
+
 </project>
\ No newline at end of file
diff --git a/ruoyi-admin/src/main/resources/application-prop.yml b/ruoyi-admin/src/main/resources/application-prod.yml
similarity index 100%
rename from ruoyi-admin/src/main/resources/application-prop.yml
rename to ruoyi-admin/src/main/resources/application-prod.yml
diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml
index 394380b..5a78666 100644
--- a/ruoyi-admin/src/main/resources/application.yml
+++ b/ruoyi-admin/src/main/resources/application.yml
@@ -38,7 +38,7 @@
 # 鏃ュ織閰嶇疆
 logging:
   level:
-    com.ruoyi: debug
+    com.ruoyi: @logging.level@
     org.springframework: warn
 
 # Spring閰嶇疆
@@ -48,7 +48,7 @@
     # 鍥介檯鍖栬祫婧愭枃浠惰矾寰�
     basename: i18n/messages
   profiles: 
-    active: dev
+    active: @profiles.active@
   # 鏂囦欢涓婁紶
   servlet:
      multipart:

--
Gitblit v1.9.3