Sfoglia il codice sorgente

1. 修改成spring-boot框架.
2. 增加了EurekaServer。

yangzhijie 6 anni fa
parent
commit
f9e68defe4

+ 8 - 8
.classpath

@@ -1,31 +1,31 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-	<classpathentry kind="src" output="target/classes" path="src/main/java">
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
 		<attributes>
-			<attribute name="optional" value="true"/>
 			<attribute name="maven.pomderived" value="true"/>
 		</attributes>
 	</classpathentry>
-	<classpathentry kind="src" output="target/test-classes" path="src/test/java">
+	<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
 		<attributes>
-			<attribute name="optional" value="true"/>
 			<attribute name="maven.pomderived" value="true"/>
-			<attribute name="test" value="true"/>
 		</attributes>
 	</classpathentry>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
+	<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
 		<attributes>
 			<attribute name="maven.pomderived" value="true"/>
 		</attributes>
 	</classpathentry>
-	<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
+	<classpathentry kind="src" output="target/classes" path="src/main/java">
 		<attributes>
+			<attribute name="optional" value="true"/>
 			<attribute name="maven.pomderived" value="true"/>
 		</attributes>
 	</classpathentry>
-	<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
+	<classpathentry kind="src" output="target/test-classes" path="src/test/java">
 		<attributes>
+			<attribute name="optional" value="true"/>
 			<attribute name="maven.pomderived" value="true"/>
+			<attribute name="test" value="true"/>
 		</attributes>
 	</classpathentry>
 	<classpathentry kind="output" path="target/classes"/>

+ 2 - 0
.gitignore

@@ -0,0 +1,2 @@
+/target/
+/logs

+ 3 - 0
.settings/org.eclipse.jdt.core.prefs

@@ -1,6 +1,9 @@
 eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.methodParameters=generate
 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
 org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
 org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
+org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
 org.eclipse.jdt.core.compiler.release=disabled
 org.eclipse.jdt.core.compiler.source=1.8

+ 40 - 0
README.md

@@ -0,0 +1,40 @@
+# 服务管理器
+
+## 开发环境
+Git克隆源代码到本地
+```
+git clone http://www.leanwo.com:3000/ShangHaiLeanwo/ServerManagement/settings
+```
+源代码导入到eclipse中。注意事项如下:
+1. 工作空间的编码格式设置成UTF-8。(Preferences-General-Workspace-Text file encoding-Other(UTF-8))
+2. 使用外部的maven(maven设置了国内镜像)
+*    2.1 Window-Preferences-Maven-Installations-Add-Installation home: Directory(Select apache maven install folder)-Finish
+*    2.2 Window-Preferences-Maven-User Settings-User Settings,(Browser)(Select apache maven install folder/config/settings.xml)-Update Settings
+
+## 默认配置
+* 打开resources/Application.yml,修改属性server.port可以修改启动的端口号。
+```
+server:
+  port: 88
+```
+* 尽量不要修改该属性,如果修改该属性,所有的服务器中都要修改eureka.serviceUrl.defaultZone属性
+```
+#Eureka Server服务器地址.
+eureka:
+  client:
+    fetch-registry: true
+    register-with-eureka: true
+    serviceUrl:
+      defaultZone: http://localhost:88/eureka/
+```
+## Eureka服务注册与发现
+* 应用程序管理器(本程序)集成了Eureka服务注册与发现,打开网址http://localhost:88可以参考各个注册服务的信息。
+
+## 服务的默认配置
+服务器名称 | 服务名称 | 默认端口号 |  备注  
+-|-|-|-
+应用程序管理器 | server-management | 88 |
+代理服务器 | gateway-server | 80 |
+文件服务器 | file-server | 85 |
+
+

+ 0 - 4
config/bat/autoRun.bat

@@ -1,4 +0,0 @@
-title ServerManagement
-cd /d %~dp0
-set current_path=%~dp0
-start javaw -jar %current_path%\ServerManagement-0.0.1.jar autoRun

+ 0 - 4
config/run.bat

@@ -1,4 +0,0 @@
-title ServerManagement
-cd /d %~dp0
-set current_path=%~dp0
-start javaw -jar %current_path%\ServerManagement-0.0.1.jar

+ 142 - 116
pom.xml

@@ -1,4 +1,5 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
 	<modelVersion>4.0.0</modelVersion>
 
@@ -10,183 +11,208 @@
 	<name>ServerManagement</name>
 	<url>http://maven.apache.org</url>
 
+	<!--指定父级依赖 -->
+	<parent>
+		<groupId>org.springframework.boot</groupId>
+		<artifactId>spring-boot-starter-parent</artifactId>
+		<version>2.2.4.RELEASE</version>
+		<relativePath /> <!-- lookup parent from repository -->
+	</parent>
+
 	<properties>
 		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-		<log4j.version>2.11.1</log4j.version>
-		<slf4j.version>1.7.25</slf4j.version>
-		<spring.version>5.1.4.RELEASE</spring.version>
+		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+		<java.version>1.8</java.version>
+		<spring-cloud.version>Hoxton.RELEASE</spring-cloud.version>
 	</properties>
 
 	<dependencies>
-		<!-- 日志框架 slf4j(slf4j的api接口包)-->
-		<dependency>
-		    <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-api</artifactId>
-		    <version>${slf4j.version}</version>
-		</dependency>
-		
-		<!-- 日志 log4j2(log4j2的核心包) -->
 		<dependency>
-		    <groupId>org.apache.logging.log4j</groupId>
-		    <artifactId>log4j-core</artifactId>
-		    <version>${log4j.version}</version>
+			<groupId>org.springframework.boot</groupId>
+			<artifactId>spring-boot-starter</artifactId>
+			<exclusions>
+				<exclusion>
+					<groupId>org.springframework.boot</groupId>
+					<artifactId>spring-boot-starter-logging</artifactId>
+				</exclusion>
+			</exclusions>
 		</dependency>
-				
-		<!-- 日志 log4j2(slf4j对应log4j2日志框架的驱动包) -->
+
 		<dependency>
-		    <groupId>org.apache.logging.log4j</groupId>
-		    <artifactId>log4j-slf4j-impl</artifactId>
-		    <version>${log4j.version}</version>
+			<groupId>org.springframework.boot</groupId>
+			<artifactId>spring-boot-starter-log4j2</artifactId>
 		</dependency>
 
 		<dependency>
-			<groupId>org.springframework</groupId>
-			<artifactId>spring-core</artifactId>
-			<version>${spring.version}</version>
+			<groupId>org.springframework.cloud</groupId>
+			<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
 		</dependency>
+
+
 		<dependency>
-			<groupId>org.springframework</groupId>
-			<artifactId>spring-context</artifactId>
-			<version>${spring.version}</version>
+			<groupId>org.springframework.boot</groupId>
+			<artifactId>spring-boot-starter-test</artifactId>
+			<scope>test</scope>
 		</dependency>
-		
+
 		<dependency>
 			<groupId>junit</groupId>
 			<artifactId>junit</artifactId>
-			<version>3.8.1</version>
 			<scope>test</scope>
 		</dependency>
 	</dependencies>
-	
-	
+
+	<dependencyManagement>
+		<dependencies>
+			<dependency>
+				<groupId>org.springframework.cloud</groupId>
+				<artifactId>spring-cloud-dependencies</artifactId>
+				<version>${spring-cloud.version}</version>
+				<type>pom</type>
+				<scope>import</scope>
+			</dependency>
+		</dependencies>
+	</dependencyManagement>
+
+
 	<build>
+		<!-- jar包名 -->
+		<finalName>ServerManagement</finalName>
+		<!--默认源代码目录 -->
+		<sourceDirectory>src/main/java </sourceDirectory>
+		<!--默认测试源代码目录 -->
+		<testSourceDirectory>src/test/java</testSourceDirectory>
+		<!--默认资源目录 -->
 		<resources>
-            <resource>
-                <directory>src/main/resources</directory>
-                <filtering>true</filtering>
-                <includes>
-                    <include>**/*.png</include>
-                    <include>**/*.properties</include>
-                    <include>**/*.xml</include>
-                </includes>
-            </resource>
-        </resources>
-        
+			<resource>
+				<directory>src/main/resources</directory>
+			</resource>
+		</resources>
+
 		<plugins>
-	  		<plugin>
-	    		<groupId>org.apache.maven.plugins</groupId>
-	    		<artifactId>maven-compiler-plugin</artifactId>
-	    		<configuration>
-	      			<source>1.8</source>
-	      			<target>1.8</target>
-	    		</configuration>
-	  		</plugin>
-	  		
 			<plugin>
-	            <groupId>org.apache.maven.plugins</groupId>
-	            <artifactId>maven-jar-plugin</artifactId>
-	            <version>3.0.2</version>
-	            <configuration>
-	                <archive>
-	                    <manifest>
-	                        <addClasspath>true</addClasspath>
-	                        <classpathPrefix>lib/</classpathPrefix>
-	                        <mainClass>com.leanwo.management.App</mainClass>
-	                    </manifest>
-	                </archive>
-	            </configuration>
-	        </plugin>
-	        
-	        <plugin>
-	            <groupId>org.apache.maven.plugins</groupId>
-	            <artifactId>maven-dependency-plugin</artifactId>
-	            <version>2.10</version>
-	            <executions>
-	                <execution>
-	                    <id>copy-dependencies</id>
-	                    <phase>package</phase>
-	                    <goals>
-	                        <goal>copy-dependencies</goal>
-	                    </goals>
-	                    <configuration>
-	                        <outputDirectory>${project.build.directory}/lib</outputDirectory>
-	                    </configuration>
-	                </execution>
-	            </executions>
-	        </plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-compiler-plugin</artifactId>
+				<configuration>
+					<source>1.8</source>
+					<target>1.8</target>
+				</configuration>
+			</plugin>
+
+			<plugin>
+				<groupId>org.springframework.boot</groupId>
+				<artifactId>spring-boot-maven-plugin</artifactId>
+			</plugin>
+
+			<!-- 忽略junit单元测试 -->
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-surefire-plugin</artifactId>
+				<version>2.20.1</version>
+				<configuration>
+					<skip>true</skip>
+				</configuration>
+			</plugin>
 
 			<plugin>
 				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-jar-plugin</artifactId>
+				<configuration>
+					<!-- 指定打包的jar包输出路径 -->
+					<outputDirectory>${project.build.directory}/${project.version}</outputDirectory>
+					<!--不打入jar包的文件类型或者路径 -->
+					<excludes>
+						<!-- <exclude>**/*.properties</exclude> -->
+						<!-- <exclude>**/*.xml</exclude> -->
+						<!-- <exclude>**/*.yml</exclude> -->
+						<!-- <exclude>static/**</exclude> -->
+						<!-- <exclude>templates/**</exclude> -->
+					</excludes>
+					<archive>
+						<!-- 指定配置文件目录,这样jar运行时会去找到同目录下的resources文件夹下查找 -->
+						<manifestEntries>
+							<Class-Path>resources/</Class-Path>
+						</manifestEntries>
+						<manifest>
+							<addClasspath>true</addClasspath>
+							<classpathPrefix>lib/</classpathPrefix>
+							<mainClass>com.leanwo.management.ServerManagementApp</mainClass>
+						</manifest>
+					</archive>
+				</configuration>
+			</plugin>
+
+			<!-- 复制资源文件 -->
+			<plugin>
 				<artifactId>maven-resources-plugin</artifactId>
-				<version>3.0.2</version>
 				<executions>
 					<execution>
-						<id>copy-resources-config</id>
+						<id>copy-dependencies</id>
 						<phase>package</phase>
 						<goals>
 							<goal>copy-resources</goal>
 						</goals>
 						<configuration>
-							<encoding>UTF-8</encoding>
-							<outputDirectory>${project.build.directory}/ServerManagement/config
-							</outputDirectory>
+							<!-- 资源文件输出目录 -->
+							<outputDirectory>${project.build.directory}/${project.version}/resources</outputDirectory>
 							<resources>
 								<resource>
-									<directory>config/</directory>
+									<directory>src/main/resources</directory>
 									<excludes>
 										<exclude>*.bat</exclude>
 									</excludes>
 								</resource>
 							</resources>
 						</configuration>
-					</execution>					
+					</execution>
+
 					<execution>
-						<id>copy-resources-lib</id>
+						<id>copy-dependencies-bat</id>
 						<phase>package</phase>
 						<goals>
 							<goal>copy-resources</goal>
 						</goals>
 						<configuration>
-							<encoding>UTF-8</encoding>
-							<outputDirectory>${project.build.directory}/ServerManagement/lib
-							</outputDirectory>
+							<!-- 资源文件输出目录 -->
+							<outputDirectory>${project.build.directory}/${project.version}</outputDirectory>
 							<resources>
 								<resource>
-									<directory>${project.build.directory}/lib/</directory>
+									<directory>src/main/resources</directory>
+									<includes>
+										<include>*.bat</include>
+									</includes>
 								</resource>
 							</resources>
 						</configuration>
 					</execution>
-					
+
+				</executions>
+			</plugin>
+
+			<!-- 分离lib -->
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-dependency-plugin</artifactId>
+				<executions>
 					<execution>
-						<id>copy-resources-bat</id>
+						<id>copy-dependencies</id>
 						<phase>package</phase>
 						<goals>
-							<goal>copy-resources</goal>
+							<goal>copy-dependencies</goal>
 						</goals>
 						<configuration>
-							<encoding>UTF-8</encoding>
-							<outputDirectory>${project.build.directory}/ServerManagement/
-							</outputDirectory>
-							<resources>
-								<resource>
-									<directory>config/</directory>
-									<includes>
-										<include>*.bat</include>
-									</includes>
-								</resource>
-								<resource>
-									<directory>${project.build.directory}</directory>
-									<includes>
-										<include>ServerManagement*.jar</include>
-									</includes>
-								</resource>
-							</resources>
+							<!-- 依赖包输出目录 -->
+							<outputDirectory>${project.build.directory}/${project.version}/lib</outputDirectory>
+							<excludeTransitive>false</excludeTransitive>
+							<stripVersion>false</stripVersion>
+							<!-- 依赖包的作用域 -->
+							<includeScope>runtime</includeScope>
 						</configuration>
-					</execution>					
+					</execution>
 				</executions>
-			</plugin>			
+			</plugin>
 		</plugins>
 	</build>
-	
+
+
 </project>

+ 2 - 2
src/main/java/com/leanwo/management/MainFrame.java

@@ -122,7 +122,7 @@ public class MainFrame extends JFrame{
 		// this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // 设定按关闭时的操作,这里是关闭窗口,如果不设定,就什么也不会发生
 		
 		// 设置图标
-		URL path = MainFrame.class.getResource("prodog_16.png");
+		URL path = MainFrame.class.getResource("/prodog_16.png");
 		Image image;
 		try {
 			image = ImageIO.read(path);
@@ -319,7 +319,7 @@ public class MainFrame extends JFrame{
 			// 获得系统托盘的实例
 			systemTray = SystemTray.getSystemTray();
 			try {
-				URL path = MainFrame.class.getResource("prodog_16.png");
+				URL path = MainFrame.class.getResource("/prodog_16.png");
 				Image image = ImageIO.read(path);   
 				trayIcon = new TrayIcon(image);
 				trayIcon.displayMessage("通知:", "程序最小化到系统托盘", TrayIcon.MessageType.INFO);

+ 3 - 3
src/main/java/com/leanwo/management/ServerFrame.java

@@ -16,8 +16,8 @@ import javax.swing.event.ListSelectionEvent;
 import javax.swing.event.ListSelectionListener;
 import javax.swing.table.DefaultTableModel;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import com.leanwo.management.model.ApplicationSetting;
 import com.leanwo.management.service.ProcessService;
@@ -34,7 +34,7 @@ import com.leanwo.management.widget.SelectObject;
  *
  */
 public class ServerFrame extends JPanel {
-	private static Log logger = LogFactory.getLog(ServerFrame.class);
+	private static Logger logger = LoggerFactory.getLogger(ServerFrame.class);
 
 	private JTable table = null;
 

+ 16 - 19
src/main/java/com/leanwo/management/App.java → src/main/java/com/leanwo/management/ServerManagementApp.java

@@ -1,39 +1,37 @@
 package com.leanwo.management;
 
-import java.io.File;
 import java.io.PrintWriter;
 import java.io.StringWriter;
 
 import javax.swing.JOptionPane;
 import javax.swing.SwingUtilities;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.core.LoggerContext;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.support.FileSystemXmlApplicationContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
+import org.springframework.context.annotation.ImportResource;
 
-import com.leanwo.management.util.LogUtil;
 import com.leanwo.management.util.ProgramStopUtil;
 
-/**
- * Hello world!
- *
- */
-public class App {
 
-	private static Log logger = LogFactory.getLog(App.class);
+@SpringBootApplication
+@EnableEurekaServer
+@ImportResource("applicationContext.xml")
+public class ServerManagementApp {
+
+	private static Logger logger = LoggerFactory.getLogger(ServerManagementApp.class);
 
 	public static void main(String[] args) {
+		System.setProperty("java.awt.headless", "false");
+		
+		SpringApplication.run(ServerManagementApp.class, args);
+		
 		JvmExitMonit.jvmExitHook();
-
-		LogUtil.init();
 		
 		ProgramStopUtil.generateStopBat();
 
-		ApplicationContext factory = new FileSystemXmlApplicationContext("config/applicationContext.xml");
-
 		boolean isAutoRun = false;
 		if (args != null && args.length > 0) {
 			if (args[0].equals("autoRun")) {
@@ -67,5 +65,4 @@ public class App {
 			}
 		});
 	}
-
 }

+ 0 - 23
src/main/java/com/leanwo/management/util/LogUtil.java

@@ -1,23 +0,0 @@
-package com.leanwo.management.util;
-
-import java.io.File;
-
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.core.LoggerContext;
-
-/**
- * 日志初始化
- * @author YangZhiJie
- *
- */
-public class LogUtil {
-	/**
-	 * 初始化
-	 */
-	public static void init() {
-		LoggerContext logContext = (LoggerContext) LogManager.getContext(false);
-		File conFile = new File("config/log4j2.xml");
-		logContext.setConfigLocation(conFile.toURI());
-		logContext.reconfigure();
-	}
-}

+ 3 - 3
src/main/java/com/leanwo/management/util/ProgramStopUtil.java

@@ -6,8 +6,8 @@ import java.io.FileWriter;
 import java.io.IOException;
 import java.lang.management.ManagementFactory;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * 程序关闭通用类
@@ -15,7 +15,7 @@ import org.apache.commons.logging.LogFactory;
  *
  */
 public class ProgramStopUtil {
-	private static Log logger = LogFactory.getLog(ProgramStopUtil.class);
+	private static Logger logger = LoggerFactory.getLogger(ProgramStopUtil.class);
 
 	/**
 	 * 生成停止程序的BAT文件

+ 3 - 3
src/main/java/com/leanwo/management/util/SpringUtil.java

@@ -3,8 +3,8 @@ package com.leanwo.management.util;
 import java.util.Iterator;
 import java.util.Map;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.context.ApplicationContext;
 import org.springframework.context.ApplicationContextAware;
 
@@ -12,7 +12,7 @@ import com.leanwo.management.exception.BeanNotInjectException;
 
 
 public class SpringUtil implements ApplicationContextAware {
-	private static Log logger = LogFactory.getLog(SpringUtil.class);
+	private static Logger logger = LoggerFactory.getLogger(SpringUtil.class);
 	private static ApplicationContext applicationContext;
 
 	@Override

+ 19 - 0
src/main/resources/Application.yml

@@ -0,0 +1,19 @@
+#eureka的端口号
+server:
+  port: 88
+spring:
+  application:
+    # 应用名称,会在Eureka中作为服务的id标识(serviceId)
+    name: server-management
+eureka:
+  instance:
+    hostname: localhost
+  client:
+    #不拉取服务
+    fetch-registry: true
+    # 不注册自己
+    register-with-eureka: true
+    # EurekaServer的地址,现在是自己的地址,如果是集群,需要写其它Server的地址。
+    serviceUrl:
+      #注册的地址,如果是集群,应该用,隔开
+      defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/

+ 20 - 53
config/applicationContext.xml → src/main/resources/applicationContext.xml

@@ -14,30 +14,28 @@
 	<bean id="springUtil" class="com.leanwo.management.util.SpringUtil" />
 	
 	<bean id="processService" class="com.leanwo.management.service.ProcessService"></bean>
+	
 	<bean id="fileService" class="com.leanwo.management.service.FileService"></bean>
 	
 	<bean id="applicationSettingCache" class="com.leanwo.management.model.ApplicationSettingCache">
 		<property name="settings">
 			<list>
-<!-- 				<ref bean="applicationSetting1" /> -->
+				<ref bean="applicationSetting1" />
 				<ref bean="applicationSetting2" />
-<!-- 				<ref bean="applicationSetting3" /> -->
-<!-- 				<ref bean="applicationSetting4" /> -->
+				<ref bean="applicationSetting3" />
+				<ref bean="applicationSetting4" />
+				<ref bean="applicationSetting5" />
 <!-- 				<ref bean="applicationSetting5" /> -->
 <!-- 				<ref bean="applicationSetting6" /> -->
 <!-- 				<ref bean="applicationSetting7" /> -->
 <!-- 				<ref bean="applicationSetting8" /> -->
-				<ref bean="applicationSetting13" />
-				<ref bean="applicationSetting14" />
-				<ref bean="applicationSetting15" />
-				<ref bean="applicationSetting16" />
 			</list>
 		</property>
 	</bean>
 
 	<bean id="applicationSetting1" class="com.leanwo.management.model.ApplicationSetting">
-		<property name="name" value="应用服务器"></property>
-		<property name="installPath" value="D:\ProdogServers\ProdogServer"></property>
+		<property name="name" value="网关服务器"></property>
+		<property name="installPath" value="D:\LeanwoProgram_2018\OtherServer\ServerManagement\src\test\java"></property>
 		<property name="startBatFile" value="run.bat"></property>
 		<property name="stopBatFile" value="stop.bat"></property>
 	</bean>
@@ -50,8 +48,8 @@
 	</bean>
 	
 	<bean id="applicationSetting3" class="com.leanwo.management.model.ApplicationSetting">
-		<property name="name" value="反向代理服务器"></property>
-		<property name="installPath" value="D:\ProdogServers\nginx-1.13.8"></property>
+		<property name="name" value="应用服务器"></property>
+		<property name="installPath" value="D:\ProdogServers\ProdogServer"></property>
 		<property name="startBatFile" value="run.bat"></property>
 		<property name="stopBatFile" value="stop.bat"></property>
 	</bean>
@@ -70,77 +68,46 @@
 		<property name="stopBatFile" value="stop.bat"></property>
 	</bean>
 	
-	
 	<bean id="applicationSetting6" class="com.leanwo.management.model.ApplicationSetting">
+		<property name="name" value="内网穿透服务器"></property>
+		<property name="installPath" value="D:\ProdogServers\natapp_windows_8080"></property>
+		<property name="startBatFile" value="run.bat"></property>
+		<property name="stopBatFile" value="stop.bat"></property>
+	</bean>
+	
+	<bean id="applicationSetting7" class="com.leanwo.management.model.ApplicationSetting">
 		<property name="name" value="钉钉服务器"></property>
 		<property name="installPath" value="D:\ProdogServers\DingTalkServer"></property>
 		<property name="startBatFile" value="run.bat"></property>
 		<property name="stopBatFile" value="stop.bat"></property>
 	</bean>
 	
-	<bean id="applicationSetting7" class="com.leanwo.management.model.ApplicationSetting">
+	<bean id="applicationSetting8" class="com.leanwo.management.model.ApplicationSetting">
 		<property name="name" value="微信服务器"></property>
 		<property name="installPath" value="D:\ProdogServers\WeChatServer"></property>
 		<property name="startBatFile" value="run.bat"></property>
 		<property name="stopBatFile" value="stop.bat"></property>
 	</bean>
 	
-	<bean id="applicationSetting8" class="com.leanwo.management.model.ApplicationSetting">
+	<bean id="applicationSetting9" class="com.leanwo.management.model.ApplicationSetting">
 		<property name="name" value="排产服务器"></property>
 		<property name="installPath" value="D:\ProdogServers\ApsServer"></property>
 		<property name="startBatFile" value="run.bat"></property>
 		<property name="stopBatFile" value="stop.bat"></property>
 	</bean>
 	
-	<bean id="applicationSetting9" class="com.leanwo.management.model.ApplicationSetting">
+	<bean id="applicationSetting10" class="com.leanwo.management.model.ApplicationSetting">
 		<property name="name" value="中间件服务器"></property>
 		<property name="installPath" value=""></property>
 		<property name="startBatFile" value="run.bat"></property>
 		<property name="stopBatFile" value="stop.bat"></property>
 	</bean>
 	
-	<bean id="applicationSetting10" class="com.leanwo.management.model.ApplicationSetting">
+	<bean id="applicationSetting11" class="com.leanwo.management.model.ApplicationSetting">
 		<property name="name" value="视频监控服务器"></property>
 		<property name="installPath" value=""></property>
 		<property name="startBatFile" value="run.bat"></property>
 		<property name="stopBatFile" value="stop.bat"></property>
 	</bean>
 	
-	
-	<bean id="applicationSetting11" class="com.leanwo.management.model.ApplicationSetting">
-		<property name="name" value="源代码服务器"></property>
-		<property name="installPath" value="D:\ProdogServers\TortoiseHg"></property>
-		<property name="startBatFile" value="run.bat"></property>
-		<property name="stopBatFile" value="stop.bat"></property>
-	</bean>	
-	<bean id="applicationSetting12" class="com.leanwo.management.model.ApplicationSetting">
-		<property name="name" value="natapp服务器"></property>
-		<property name="installPath" value="D:\ProdogServers\natapp_windows_8080"></property>
-		<property name="startBatFile" value="run.bat"></property>
-		<property name="stopBatFile" value="stop.bat"></property>
-	</bean>	
-	<bean id="applicationSetting13" class="com.leanwo.management.model.ApplicationSetting">
-		<property name="name" value="测试服务器"></property>
-		<property name="installPath" value="D:\LeanwoProgram_2018\OtherServer\ServerManagement\src\test\java"></property>
-		<property name="startBatFile" value="run.bat"></property>
-		<property name="stopBatFile" value="stop.bat"></property>
-	</bean>
-	<bean id="applicationSetting14" class="com.leanwo.management.model.ApplicationSetting">
-		<property name="name" value="测试服务器"></property>
-		<property name="installPath" value="D:\LeanwoProgram_2018\OtherServer\ServerManagement\src\test\java"></property>
-		<property name="startBatFile" value="run.bat"></property>
-		<property name="stopBatFile" value="stop.bat"></property>
-	</bean>
-	<bean id="applicationSetting15" class="com.leanwo.management.model.ApplicationSetting">
-		<property name="name" value="测试服务器"></property>
-		<property name="installPath" value="D:\LeanwoProgram_2018\OtherServer\ServerManagement\src\test\java"></property>
-		<property name="startBatFile" value="run.bat"></property>
-		<property name="stopBatFile" value="stop.bat"></property>
-	</bean>
-	<bean id="applicationSetting16" class="com.leanwo.management.model.ApplicationSetting">
-		<property name="name" value="测试服务器"></property>
-		<property name="installPath" value="D:\LeanwoProgram_2018\OtherServer\ServerManagement\src\test\java"></property>
-		<property name="startBatFile" value="run.bat"></property>
-		<property name="stopBatFile" value="stop.bat"></property>
-	</bean>
 </beans>

+ 4 - 0
src/main/resources/autoRun.bat

@@ -0,0 +1,4 @@
+title ServerManagement
+cd /d %~dp0
+set current_path=%~dp0
+start javaw -jar %current_path%\ServerManagement.jar autoRun

+ 0 - 0
config/kill.bat → src/main/resources/kill.bat


+ 1 - 1
config/log4j2.xml → src/main/resources/log4j2.xml

@@ -11,7 +11,7 @@
             <!-- 控制台只输出level及以上级别的信息(onMatch),其他的直接拒绝(onMismatch) -->
             <ThresholdFilter level="debug" onMatch="ACCEPT" onMismatch="DENY"/>
             <!-- 这个都知道是输出日志的格式 -->
-            <PatternLayout pattern="%d{HH:mm:ss.SSS} %-5level %class{36} [%L] [%M] - %msg%xEx%n"/>
+            <PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss z} %-5level %class{36} [%L] [%M] - %msg%xEx%n"/>
         </Console>
         
 		<!-- 这个会打印出所有的信息,每次大小超过size,则这size大小的日志会自动存入按年份-月份建立的文件夹下面并进行压缩,作为存档 -->

+ 0 - 0
src/main/resources/com/leanwo/management/prodog_16.png → src/main/resources/prodog_16.png


+ 4 - 0
src/main/resources/run.bat

@@ -0,0 +1,4 @@
+title ServerManagement
+cd /d %~dp0
+set current_path=%~dp0
+start javaw -jar %current_path%\ServerManagement.jar

+ 3 - 2
config/bat/schedule.bat → src/main/resources/schedule.bat

@@ -1,6 +1,7 @@
 @echo off
-set NAME=ProdogServerManagement
-set COMMAND=x:\xx\autoStart.bat
+set NAME=ServerManagement
+set current_path=%~dp0
+set COMMAND=%current_path%\resources\autoStart.bat
 
 %SystemDrive%
 cd %windir%\tasks\