Przeglądaj źródła

工程POM优化

zhanghaijun 2 lat temu
rodzic
commit
cfc50e8aee
7 zmienionych plików z 49 dodań i 10 usunięć
  1. 5 0
      .gitattributes
  2. 2 0
      .gitignore
  3. 21 0
      deploy.sh
  4. 0 8
      pom.xml
  5. 19 0
      settings.xml
  6. 2 2
      train-server/pom.xml
  7. 0 0
      train-server/src/main/resources/application-demo.yml

+ 5 - 0
.gitattributes

@@ -0,0 +1,5 @@
+*.js linguist-language=java
+*.html linguist-language=java
+
+# 强制换行符为 LF
+# * text eol=lf

+ 2 - 0
.gitignore

@@ -1,4 +1,6 @@
 **/.flattened-pom.xml
+/store/
+/train-server/store
 target/
 !.mvn/wrapper/maven-wrapper.jar
 !**/src/main/**/target/

+ 21 - 0
deploy.sh

@@ -0,0 +1,21 @@
+#! /bin/sh
+
+## cd到当前目录
+cd `dirname $0`
+
+VERSION_POM=`awk '/<version>[^<]+<\/version>/{gsub(/<version>|<\/version>/,"",$1);print $1;exit;}' pom.xml`
+
+## 前置条件
+command -v mvn >/dev/null 2>&1 || { echo >&2 "I require maven 3.5 + but it's not installed.  Aborting."; sleep 5; exit 1; }
+
+
+echo "====== release ====== start build to pom.xml ======"
+mvn -D maven.test.skip=true clean package -P prod -s settings.xml
+if [ ! $? -eq 0 ]; then
+echo -e "------ failed error by mvn build ------"
+exit 1;
+fi
+echo '====== release ====== docker build ======'
+mvn -Ddocker.tag.version=v$VERSION_POM -Ddocker.build.url=http://127.0.0.1:2375 docker:removeImage docker:build -amd -s settings.xml
+echo "====== docker build complete ======"
+

+ 0 - 8
pom.xml

@@ -21,16 +21,8 @@
         <!-- 依赖 -->
         <hutool.version>5.8.16</hutool.version>
         <spring-boot.version>3.1.5</spring-boot.version>
-        <lombok.version>1.18.30</lombok.version>
         <mybatis-plus.version>3.5.3.2</mybatis-plus.version>
         <!-- 插件版本 -->
-        <mapstruct-plus.version>1.3.5</mapstruct-plus.version>
-        <mapstruct-plus.lombok.version>0.2.0</mapstruct-plus.lombok.version>
-        <maven-jar-plugin.version>3.2.2</maven-jar-plugin.version>
-        <maven-war-plugin.version>3.2.2</maven-war-plugin.version>
-        <therapi-javadoc.version>0.15.0</therapi-javadoc.version>
-        <maven-compiler-plugin.verison>3.11.0</maven-compiler-plugin.verison>
-        <maven-surefire-plugin.version>3.1.2</maven-surefire-plugin.version>
         <flatten-maven-plugin.version>1.3.0</flatten-maven-plugin.version>
     </properties>
 

+ 19 - 0
settings.xml

@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<settings
+    xmlns="http://maven.apache.org/SETTINGS/1.2.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.2.0 https://maven.apache.org/xsd/settings-1.2.0.xsd">
+
+    <pluginGroups>
+        <pluginGroup>com.spotify</pluginGroup>
+    </pluginGroups>
+    <mirrors>
+        <mirror>
+            <id>aliyun</id>
+            <mirrorOf>central</mirrorOf>
+            <name>aliyun maven</name>
+            <url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
+        </mirror>
+    </mirrors>
+</settings>

+ 2 - 2
train-server/pom.xml

@@ -3,7 +3,7 @@
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
     <parent>
-        <groupId>com.example</groupId>
+        <groupId>top.haijunit</groupId>
         <artifactId>mul-agent-virtual-simulation-system</artifactId>
         <version>${revision}</version>
     </parent>
@@ -31,7 +31,7 @@
         <dependency>
             <groupId>com.baomidou</groupId>
             <artifactId>mybatis-plus-boot-starter</artifactId>
-            <version>3.5.3.1</version>
+            <version>${mybatis-plus.version}</version>
         </dependency>
         <dependency>
             <groupId>org.liquibase</groupId>

train-server/src/main/resources/application-local.yml → train-server/src/main/resources/application-demo.yml