xiehuanqun 1 tháng trước cách đây
mục cha
commit
512fb0fa20
3 tập tin đã thay đổi với 30 bổ sung17 xóa
  1. 10 0
      .drone.yml
  2. 15 17
      pom.xml
  3. 5 0
      src/main/java/com/example/test/controller/HelloController.java

+ 10 - 0
.drone.yml

@@ -20,6 +20,16 @@ steps:
     volumes:
       - name: repository
         path: /cache
+  # 更新缓存
+#  - name: rebuild-cache
+#    image: drillster/drone-volume-cache
+#    settings:
+#      rebuild: true
+#      mount:
+#        - /root/.m2/repository
+#    volumes:
+#       - name: repository
+#         path: /cache
 
   # 打包 prod
   - name: build-prod

+ 15 - 17
pom.xml

@@ -13,23 +13,12 @@
     <version>0.0.1-SNAPSHOT</version>
     <name>test</name>
     <description>test</description>
-    <url/>
-    <licenses>
-        <license/>
-    </licenses>
-    <developers>
-        <developer/>
-    </developers>
-    <scm>
-        <connection/>
-        <developerConnection/>
-        <tag/>
-        <url/>
-    </scm>
+
     <properties>
         <java.version>17</java.version>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     </properties>
+
     <dependencies>
         <dependency>
             <groupId>org.springframework.boot</groupId>
@@ -52,10 +41,12 @@
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-cache</artifactId>
         </dependency>
+
         <dependency>
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-data-redis</artifactId>
         </dependency>
+
         <dependency>
             <groupId>org.redisson</groupId>
             <artifactId>redisson</artifactId>
@@ -93,6 +84,13 @@
             <version>1.5.3</version>
         </dependency>
 
+        <!-- Hutool -->
+        <dependency>
+            <groupId>cn.hutool</groupId>
+            <artifactId>hutool-all</artifactId>
+            <version>5.8.36</version>
+        </dependency>
+
     </dependencies>
 
     <profiles>
@@ -164,7 +162,7 @@
                 </executions>
             </plugin>
             <!--将第三方依赖包拷贝到lib目录 (没有更新时注释)(第一次部署需要取消注释) -->
-           <!-- <plugin>
+            <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-dependency-plugin</artifactId>
                 <executions>
@@ -175,12 +173,12 @@
                             <goal>copy-dependencies</goal>
                         </goals>
                         <configuration>
-                             <outputDirectory>${project.build.directory}/libs</outputDirectory>
-                            &lt;!&ndash;<outputDirectory>libs</outputDirectory>&ndash;&gt;
+                            <outputDirectory>${project.build.directory}/libs</outputDirectory>
+                            <!--<outputDirectory>libs</outputDirectory>-->
                         </configuration>
                     </execution>
                 </executions>
-            </plugin>-->
+            </plugin>
         </plugins>
     </build>
 

+ 5 - 0
src/main/java/com/example/test/controller/HelloController.java

@@ -1,5 +1,6 @@
 package com.example.test.controller;
 
+import cn.hutool.core.util.StrUtil;
 import com.example.test.entity.User;
 import com.example.test.service.UserService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -14,6 +15,10 @@ public class HelloController {
     private UserService userService;
     @GetMapping("/")
     public List<User> hello() {
+        String name = "test";
+        if(StrUtil.isNotEmpty(name)){
+            System.out.println("name is not empty");
+        }
         return userService.list();
     }
 }