miemie %!s(int64=4) %!d(string=hai) anos
pai
achega
d4a0821358
Modificáronse 2 ficheiros con 11 adicións e 3 borrados
  1. 10 2
      build.gradle
  2. 1 1
      license.txt

+ 10 - 2
build.gradle

@@ -1,4 +1,4 @@
-import java.text.SimpleDateFormat
+import java.time.LocalDateTime
 
 allprojects {
     group = 'com.baomidou'
@@ -114,6 +114,13 @@ subprojects {
     }
 
     jar {
+        into("META-INF/") {
+            from rootProject.file("LICENSE")
+        }
+        into("META-INF/maven/$project.group/$project.name") {
+            from { generatePomFileForMavenJavaPublication }
+            rename ".*", "pom.xml"
+        }
         afterEvaluate {
             manifest {
                 attributes 'Implementation-Title': archiveBaseName
@@ -123,7 +130,7 @@ subprojects {
                 attributes 'Build-OS': System.getProperty("os.name")
                 attributes 'Built-By': System.getProperty("user.name")
                 attributes 'Build-Jdk': System.getProperty("java.version")
-                attributes 'Build-Timestamp': new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date())
+                attributes 'Build-Timestamp': LocalDateTime.now().format("yyyy-MM-dd HH:mm:ss")
             }
         }
     }
@@ -140,6 +147,7 @@ subprojects {
         mapping "java", "SLASHSTAR_STYLE"
         mapping "kt", "SLASHSTAR_STYLE"
         ignoreFailures = true
+        ext.year = Calendar.getInstance().get(Calendar.YEAR)
     }
 
     //noinspection GroovyAssignabilityCheck

+ 1 - 1
license.txt

@@ -1,4 +1,4 @@
-Copyright (c) 2011-2020, baomidou (jobob@qq.com).
+Copyright (c) 2011-${year}, baomidou (jobob@qq.com).
 <p>
 Licensed under the Apache License, Version 2.0 (the "License"); you may not
 use this file except in compliance with the License. You may obtain a copy of