浏览代码

Merge branch 'master' of http://39.106.8.246:3003/persagy/dmp

lixing 3 年之前
父节点
当前提交
9555373be3

+ 46 - 46
dmp-dic/pom.xml

@@ -112,25 +112,25 @@
             </plugin>
 
             <!-- 按照测试要求打成zip需要的配置 -->
-<!--            &lt;!&ndash;获取git信息&ndash;&gt;-->
-<!--            <plugin>-->
-<!--                <groupId>pl.project13.maven</groupId>-->
-<!--                <artifactId>git-commit-id-plugin</artifactId>-->
-<!--                <executions>-->
-<!--                    <execution>-->
-<!--                        <goals>-->
-<!--                            <goal>revision</goal>-->
-<!--                        </goals>-->
-<!--                    </execution>-->
-<!--                </executions>-->
-<!--                <configuration>-->
-<!--                    <verbose>true</verbose>-->
-<!--                    <dateFormat>yyyyMMddHHmm</dateFormat>-->
-<!--                    <generateGitPropertiesFile>true</generateGitPropertiesFile>-->
-<!--                    &lt;!&ndash;<generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>&ndash;&gt;-->
-<!--                    <generateGitPropertiesFilename>target/git.properties</generateGitPropertiesFilename>-->
-<!--                </configuration>-->
-<!--            </plugin>-->
+            <!--获取git信息-->
+            <plugin>
+                <groupId>pl.project13.maven</groupId>
+                <artifactId>git-commit-id-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>revision</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <verbose>true</verbose>
+                    <dateFormat>yyyyMMddHHmm</dateFormat>
+                    <generateGitPropertiesFile>true</generateGitPropertiesFile>
+                    <!--<generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>-->
+                    <generateGitPropertiesFilename>target/git.properties</generateGitPropertiesFilename>
+                </configuration>
+            </plugin>
             <plugin>
                 <groupId>com.coderplus.maven.plugins</groupId>
                 <artifactId>copy-rename-maven-plugin</artifactId>
@@ -196,33 +196,33 @@
                 </executions>
             </plugin>
 
-<!--            &lt;!&ndash; 打包压缩 &ndash;&gt;-->
-<!--            <plugin>-->
-<!--                <groupId>org.apache.maven.plugins</groupId>-->
-<!--                <artifactId>maven-assembly-plugin</artifactId>-->
-<!--                <executions>-->
-<!--                    <execution>-->
-<!--                        <id>make-assembly</id>-->
-<!--                        &lt;!&ndash; 当执行mvn package时才会打包 &ndash;&gt;-->
-<!--                        <phase>package</phase>-->
-<!--                        <goals>-->
-<!--                            <goal>single</goal>-->
-<!--                        </goals>-->
-<!--                        <configuration>-->
-<!--                            <finalName>-->
-<!--                                ${project.artifactId}_${git.commit.time}_git_${git.branch}_${git.commit.id.abbrev}-->
-<!--                            </finalName>-->
-<!--                            &lt;!&ndash;不包含assembly id&ndash;&gt;-->
-<!--                            <appendAssemblyId>false</appendAssemblyId>-->
-<!--                            &lt;!&ndash;输出路径&ndash;&gt;-->
-<!--                            &lt;!&ndash;<outputDirectory>../target/co_search-${project.version}</outputDirectory>&ndash;&gt;-->
-<!--                            <descriptors>-->
-<!--                                <descriptor>src/script/zip.xml</descriptor>-->
-<!--                            </descriptors>-->
-<!--                        </configuration>-->
-<!--                    </execution>-->
-<!--                </executions>-->
-<!--            </plugin>-->
+            <!-- 打包压缩 -->
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-assembly-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>make-assembly</id>
+                        <!-- 当执行mvn package时才会打包 -->
+                        <phase>package</phase>
+                        <goals>
+                            <goal>single</goal>
+                        </goals>
+                        <configuration>
+                            <finalName>
+                                ${project.artifactId}_${git.commit.time}_git_${git.branch}_${git.commit.id.abbrev}
+                            </finalName>
+                            <!--不包含assembly id-->
+                            <appendAssemblyId>false</appendAssemblyId>
+                            <!--输出路径-->
+                            <!--<outputDirectory>../target/co_search-${project.version}</outputDirectory>-->
+                            <descriptors>
+                                <descriptor>src/script/zip.xml</descriptor>
+                            </descriptors>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
         </plugins>
     </build>
 

+ 96 - 0
dmp-org/pom.xml

@@ -119,6 +119,102 @@
                     </execution>
                 </executions>
             </plugin>
+
+            <!--拷贝资源文件 copy-resources-->
+            <plugin>
+                <artifactId>maven-resources-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>copy-resources</id>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>copy-resources</goal>
+                        </goals>
+                        <configuration>
+                            <resources>
+                                <resource>
+                                    <directory>src/main/resources/</directory>
+                                    <includes>
+                                        <include>**/*.yml</include>
+                                    </includes>
+                                </resource>
+                                <resource>
+                                    <directory>${project.build.directory}</directory>
+                                    <includes>
+                                        <include>**/version.txt</include>
+                                    </includes>
+                                </resource>
+                            </resources>
+                            <outputDirectory>${project.build.directory}/config</outputDirectory>
+                        </configuration>
+                    </execution>
+                    <!--拷贝启动脚本-->
+                    <execution>
+                        <id>copy-version</id>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>copy-resources</goal>
+                        </goals>
+                        <configuration>
+                            <resources>
+                                <resource>
+                                    <directory>src/script</directory>
+                                </resource>
+                            </resources>
+                            <outputDirectory>${project.build.directory}</outputDirectory>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+
+            <!-- 按照测试要求打成zip需要的配置 -->
+            <!--获取git信息-->
+            <plugin>
+                <groupId>pl.project13.maven</groupId>
+                <artifactId>git-commit-id-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>revision</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <verbose>true</verbose>
+                    <dateFormat>yyyyMMddHHmm</dateFormat>
+                    <generateGitPropertiesFile>true</generateGitPropertiesFile>
+                    <!--<generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>-->
+                    <generateGitPropertiesFilename>target/git.properties</generateGitPropertiesFilename>
+                </configuration>
+            </plugin>
+
+            <!-- 打包压缩 -->
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-assembly-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>make-assembly</id>
+                        <!-- 当执行mvn package时才会打包 -->
+                        <phase>package</phase>
+                        <goals>
+                            <goal>single</goal>
+                        </goals>
+                        <configuration>
+                            <finalName>
+                                ${project.artifactId}_${git.commit.time}_git_${git.branch}_${git.commit.id.abbrev}
+                            </finalName>
+                            <!--不包含assembly id-->
+                            <appendAssemblyId>false</appendAssemblyId>
+                            <!--输出路径-->
+                            <!--<outputDirectory>../target/co_search-${project.version}</outputDirectory>-->
+                            <descriptors>
+                                <descriptor>src/script/zip.xml</descriptor>
+                            </descriptors>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
         </plugins>
     </build>
 

+ 4 - 0
dmp-org/src/script/start.bat

@@ -0,0 +1,4 @@
+@ECHO OFF&PUSHD %~DP0 &TITLE dmp-dic
+@ECHO 根据情况使用内存限制 命令为:
+@ECHO java -jar -Xms500m -Xmx1024m -Dfile.encoding=utf-8 dmp-rwd.jar
+java -jar -Xms500m -Xmx1024m -Dfile.encoding=utf-8 -DCONFIG_FILE_PATH=D:\SpringCloud dmp-rwd.jar

+ 5 - 0
dmp-org/src/script/start.sh

@@ -0,0 +1,5 @@
+#!/bin/sh
+# 根据情况使用内存限制 命令为:
+# nohup java -jar -Xms500m -Xmx1024m -Dfile.encoding=utf-8 dmp-org.jar >/dev/null 2>&1 &
+nohup java -jar -Xms500m -Xmx4096m -Dfile.encoding=utf-8 -DCONFIG_FILE_PATH=/mnt/data/SpringCloud dmp-org.jar >/dev/null 2>&1 &
+sleep 2

+ 23 - 0
dmp-org/src/script/zip.xml

@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<assembly
+        xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/3.1.1"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/3.1.1 http://maven.apache.org/xsd/assembly-3.1.1.xsd">
+    <id>dev</id>
+    <formats>
+        <format>zip</format>
+    </formats>
+    <includeBaseDirectory>false</includeBaseDirectory>
+    <fileSets>
+        <fileSet>
+            <directory>${basedir}/target/</directory>
+            <includes>
+                <include>config/</include>
+                <include>*.jar</include>
+                <include>start.bat</include>
+                <include>start.sh</include>
+            </includes>
+            <outputDirectory>/</outputDirectory>
+        </fileSet>
+    </fileSets>
+</assembly>

+ 95 - 0
dmp-rwd/pom.xml

@@ -132,6 +132,101 @@
                     </execution>
                 </executions>
             </plugin>
+
+            <!--拷贝资源文件 copy-resources-->
+            <plugin>
+                <artifactId>maven-resources-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>copy-resources</id>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>copy-resources</goal>
+                        </goals>
+                        <configuration>
+                            <resources>
+                                <resource>
+                                    <directory>src/main/resources/</directory>
+                                    <includes>
+                                        <include>**/*.yml</include>
+                                    </includes>
+                                </resource>
+                                <resource>
+                                    <directory>${project.build.directory}</directory>
+                                    <includes>
+                                        <include>**/version.txt</include>
+                                    </includes>
+                                </resource>
+                            </resources>
+                            <outputDirectory>${project.build.directory}/config</outputDirectory>
+                        </configuration>
+                    </execution>
+                    <!--拷贝启动脚本-->
+                    <execution>
+                        <id>copy-version</id>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>copy-resources</goal>
+                        </goals>
+                        <configuration>
+                            <resources>
+                                <resource>
+                                    <directory>src/script</directory>
+                                </resource>
+                            </resources>
+                            <outputDirectory>${project.build.directory}</outputDirectory>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <!-- 按照测试要求打成zip需要的配置 -->
+            <!--获取git信息-->
+            <plugin>
+                <groupId>pl.project13.maven</groupId>
+                <artifactId>git-commit-id-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>revision</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <verbose>true</verbose>
+                    <dateFormat>yyyyMMddHHmm</dateFormat>
+                    <generateGitPropertiesFile>true</generateGitPropertiesFile>
+                    <!--<generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>-->
+                    <generateGitPropertiesFilename>target/git.properties</generateGitPropertiesFilename>
+                </configuration>
+            </plugin>
+
+            <!-- 打包压缩 -->
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-assembly-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>make-assembly</id>
+                        <!-- 当执行mvn package时才会打包 -->
+                        <phase>package</phase>
+                        <goals>
+                            <goal>single</goal>
+                        </goals>
+                        <configuration>
+                            <finalName>
+                                ${project.artifactId}_${git.commit.time}_git_${git.branch}_${git.commit.id.abbrev}
+                            </finalName>
+                            <!--不包含assembly id-->
+                            <appendAssemblyId>false</appendAssemblyId>
+                            <!--输出路径-->
+                            <!--<outputDirectory>../target/co_search-${project.version}</outputDirectory>-->
+                            <descriptors>
+                                <descriptor>src/script/zip.xml</descriptor>
+                            </descriptors>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
         </plugins>
     </build>
 

+ 4 - 0
dmp-rwd/src/script/start.bat

@@ -0,0 +1,4 @@
+@ECHO OFF&PUSHD %~DP0 &TITLE dmp-dic
+@ECHO 根据情况使用内存限制 命令为:
+@ECHO java -jar -Xms500m -Xmx1024m -Dfile.encoding=utf-8 dmp-rwd.jar
+java -jar -Xms500m -Xmx1024m -Dfile.encoding=utf-8 -DCONFIG_FILE_PATH=D:\SpringCloud dmp-rwd.jar

+ 5 - 0
dmp-rwd/src/script/start.sh

@@ -0,0 +1,5 @@
+#!/bin/sh
+# 根据情况使用内存限制 命令为:
+# nohup java -jar -Xms500m -Xmx1024m -Dfile.encoding=utf-8 dmp-rwd.jar >/dev/null 2>&1 &
+nohup java -jar -Xms500m -Xmx4096m -Dfile.encoding=utf-8 -DCONFIG_FILE_PATH=/mnt/data/SpringCloud dmp-rwd.jar >/dev/null 2>&1 &
+sleep 2

+ 23 - 0
dmp-rwd/src/script/zip.xml

@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<assembly
+        xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/3.1.1"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/3.1.1 http://maven.apache.org/xsd/assembly-3.1.1.xsd">
+    <id>dev</id>
+    <formats>
+        <format>zip</format>
+    </formats>
+    <includeBaseDirectory>false</includeBaseDirectory>
+    <fileSets>
+        <fileSet>
+            <directory>${basedir}/target/</directory>
+            <includes>
+                <include>config/</include>
+                <include>*.jar</include>
+                <include>start.bat</include>
+                <include>start.sh</include>
+            </includes>
+            <outputDirectory>/</outputDirectory>
+        </fileSet>
+    </fileSets>
+</assembly>