提交 d3587f55 authored 作者: yangli's avatar yangli

Merge remote-tracking branch 'origin/master'

# Conflicts: # apq-pc-client/src/main/resources/application.yml
package com.priusis.client.service.core;
import lombok.Data;
import org.eclipse.paho.client.mqttv3.MqttConnectOptions;
import org.eclipse.paho.client.mqttv3.internal.security.SSLSocketFactoryFactory;
import org.springframework.util.Base64Utils;
import org.springframework.util.StringUtils;
import java.io.FileInputStream;
import java.nio.charset.StandardCharsets;
import java.security.*;
import java.util.Properties;
/**
* Created by priusis on 18.01.17.
......@@ -17,6 +8,7 @@ import java.util.Properties;
@Data
public class MqttClientSecurityConfiguration {
private boolean apiByMac;
private String accessToken;
private String keystore;
private String keystorePassword;
......@@ -24,74 +16,4 @@ public class MqttClientSecurityConfiguration {
private String truststore;
private String truststorePassword;
public boolean isTokenBased() {
return !StringUtils.isEmpty(accessToken);
}
public boolean isSsl() {
return !StringUtils.isEmpty(truststore);
}
public void setupSecurityOptions(MqttConnectOptions options) {
if (this.isTokenBased()) {
options.setUserName(this.getAccessToken());
if (!StringUtils.isEmpty(this.getTruststore())) {
Properties sslProperties = new Properties();
sslProperties.put(SSLSocketFactoryFactory.TRUSTSTORE, this.getTruststore());
sslProperties.put(SSLSocketFactoryFactory.TRUSTSTOREPWD, this.getTruststorePassword());
sslProperties.put(SSLSocketFactoryFactory.TRUSTSTORETYPE, "JKS");
sslProperties.put(SSLSocketFactoryFactory.CLIENTAUTH, false);
options.setSSLProperties(sslProperties);
}
} else {
//TODO: check and document this
Properties sslProperties = new Properties();
sslProperties.put(SSLSocketFactoryFactory.KEYSTORE, this.getKeystore());
sslProperties.put(SSLSocketFactoryFactory.KEYSTOREPWD, this.getKeystorePassword());
sslProperties.put(SSLSocketFactoryFactory.KEYSTORETYPE, "JKS");
sslProperties.put(SSLSocketFactoryFactory.TRUSTSTORE, this.getTruststore());
sslProperties.put(SSLSocketFactoryFactory.TRUSTSTOREPWD, this.getTruststorePassword());
sslProperties.put(SSLSocketFactoryFactory.TRUSTSTORETYPE, "JKS");
sslProperties.put(SSLSocketFactoryFactory.CLIENTAUTH, true);
options.setSSLProperties(sslProperties);
}
}
public String getClientId() {
if (this.isTokenBased()) {
return sha256(this.getAccessToken().getBytes(StandardCharsets.UTF_8));
} else {
try {
FileInputStream is = new FileInputStream(this.getKeystore());
KeyStore keystore = KeyStore.getInstance(KeyStore.getDefaultType());
keystore.load(is, this.getKeystorePassword().toCharArray());
Key key = keystore.getKey(this.getKeystoreKeyAlias(), this.getKeystorePassword().toCharArray());
if (key instanceof PrivateKey) {
// Get certificate of public key
java.security.cert.Certificate cert = keystore.getCertificate(this.getKeystoreKeyAlias());
// Get public key
PublicKey publicKey = cert.getPublicKey();
return sha256(publicKey.getEncoded());
} else {
throw new RuntimeException("No public key!");
}
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
private String sha256(byte[] data) {
try {
MessageDigest md = MessageDigest.getInstance("SHA-256");
md.update(data);
return Base64Utils.encodeToString(md.digest());
} catch (NoSuchAlgorithmException e) {
throw new RuntimeException(e);
}
}
}
package com.priusis.client.service.core;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONUtil;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.google.common.io.Resources;
......@@ -15,16 +18,19 @@ import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.handler.ssl.SslContext;
import io.netty.handler.ssl.SslContextBuilder;
import io.netty.util.concurrent.Promise;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.paho.client.mqttv3.MqttMessage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import oshi.hardware.NetworkIF;
import javax.annotation.PostConstruct;
import javax.net.ssl.KeyManagerFactory;
import javax.net.ssl.TrustManagerFactory;
import java.io.*;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.security.KeyStore;
......@@ -47,6 +53,12 @@ import static com.priusis.client.util.JsonTools.*;
@Slf4j
public class MqttServiceImpl implements MqttService, MqttHandler, MqttClientCallback {
@Value(value = "${apq.iot-gateway}")
private String gateway;
@Value(value = "${apq.url.device_info}")
private String deviceInfo;
//private static final String GATEWAY_RPC_TOPIC = "gateway/rpc";
//private static final String GATEWAY_ATTRIBUTES_TOPIC = "gateway/attrs";
//private static final String GATEWAY_TELEMETRY_TOPIC = "gateway/telemetry";
......@@ -342,7 +354,6 @@ public class MqttServiceImpl implements MqttService, MqttHandler, MqttClientCall
.method(payload.get("method").asText()).params(payload.get("params").asText()).build();
// 存储rpc下发的数据
try {
......@@ -516,7 +527,12 @@ public class MqttServiceImpl implements MqttService, MqttHandler, MqttClientCall
private MqttClient initMqttClient() {
try {
MqttClientConfig mqttClientConfig = getMqttClientConfig();
mqttClientConfig.setUsername(connection.getSecurity().getAccessToken());
if (connection.getSecurity().isApiByMac()) {
mqttClientConfig.setUsername(getClientSecurityByMac().getAccessToken());
} else {
mqttClientConfig.setUsername(connection.getSecurity().getAccessToken());
}
tbClient = MqttClient.create(mqttClientConfig, this);
tbClient.setCallback(this);
tbClient.setEventLoop(nioEventLoopGroup);
......@@ -570,27 +586,32 @@ public class MqttServiceImpl implements MqttService, MqttHandler, MqttClientCall
private MqttClientConfig getMqttClientConfig() {
MqttClientConfig mqttClientConfig;
if (!StringUtils.isEmpty(connection.getSecurity().getAccessToken())) {
if (StringUtils.isEmpty(connection.getSecurity().getTruststore())) {
mqttClientConfig = new MqttClientConfig();
mqttClientConfig.setUsername(connection.getSecurity().getAccessToken());
if (connection.getSecurity().isApiByMac()) {
mqttClientConfig = new MqttClientConfig();
mqttClientConfig.setUsername(getClientSecurityByMac().getAccessToken());
} else {
if (!StringUtils.isEmpty(connection.getSecurity().getAccessToken())) {
if (StringUtils.isEmpty(connection.getSecurity().getTruststore())) {
mqttClientConfig = new MqttClientConfig();
mqttClientConfig.setUsername(connection.getSecurity().getAccessToken());
} else {
try {
SslContext sslCtx = initOneWaySslContext(connection.getSecurity());
mqttClientConfig = new MqttClientConfig(sslCtx);
} catch (Exception e) {
log.error(e.getMessage(), e);
throw new RuntimeException(e);
}
}
} else {
try {
SslContext sslCtx = initOneWaySslContext(connection.getSecurity());
SslContext sslCtx = initTwoWaySslContext(connection.getSecurity());
mqttClientConfig = new MqttClientConfig(sslCtx);
} catch (Exception e) {
log.error(e.getMessage(), e);
throw new RuntimeException(e);
}
}
} else {
try {
SslContext sslCtx = initTwoWaySslContext(connection.getSecurity());
mqttClientConfig = new MqttClientConfig(sslCtx);
} catch (Exception e) {
log.error(e.getMessage(), e);
throw new RuntimeException(e);
}
}
return mqttClientConfig;
}
......@@ -635,4 +656,27 @@ public class MqttServiceImpl implements MqttService, MqttHandler, MqttClientCall
public void setPersistentFileService(PersistentFileService persistentFileService) {
this.persistentFileService = persistentFileService;
}
private MqttClientSecurityConfiguration getClientSecurityByMac() {
try {
NetworkIF networkIF = new NetworkIF();
networkIF.setNetworkInterface(NetworkInterface.getByInetAddress(InetAddress.getLocalHost()));
String mac = networkIF.getMacaddr();
if (StrUtil.isBlank(mac)) {
log.warn("未获取到MAC地址");
return null;
}
deviceInfo = StrUtil.format(deviceInfo, mac);
String remoteDeviceVoJson = HttpUtil.get(gateway + deviceInfo);
RemoteDeviceVo remoteDeviceVo = JSONUtil.toBean(remoteDeviceVoJson, RemoteDeviceVo.class);
MqttClientSecurityConfiguration mqttClientSecurityConfiguration = new MqttClientSecurityConfiguration();
mqttClientSecurityConfiguration.setAccessToken(remoteDeviceVo.getSecretKey());
return mqttClientSecurityConfiguration;
} catch (Exception e) {
log.error("获取Mac地址异常", e);
}
return null;
}
}
package com.priusis.client.service.core;
import lombok.Data;
import java.io.Serializable;
/**
* <p>
* 设备表
* </p>
*/
@Data
public class RemoteDeviceVo implements Serializable {
/**
* 设备通讯id
*/
private String did;
/**
* 设备编码
*/
private String code;
/**
* 业务code
*/
private String bizCode;
/**
* 秘钥
*/
private String secretKey;
/**
* 设备名称
*/
private String name;
}
......@@ -24,12 +24,13 @@ core:
path: D://storage
bufferSize: 6
connection:
host: "${GATEWAY_HOST:127.0.0.1}"
host: "${PC_HOST:127.0.0.1}"
port: 1884
retryInterval: 3000
maxInFlight: 1000
security:
accessToken: "${GATEWAY_ACCESS_TOKEN:1hTbcWoaQvPzl2PpbkTG}"
apiByMac: "${PC_API_BY_MAC:true}"
# accessToken: "${PC_ACCESS_TOKEN:1hTbcWoaQvPzl2PpbkTG}"
remoteConfiguration: false
extensions:
-
......@@ -41,6 +42,7 @@ core:
apq:
iot-gateway: 192.168.124.19:7002
url:
device_info: /facility/getByMacAddress?macAddress={}
install: /ops/install/getList?macAddress={}&pageNum={}&pageSize={}
upgrade: /ops/upgrade/getList?macAddress={}&pageNum={}&pageSize={}
add-program: /ops/program/addFacProgram
......@@ -13,15 +13,14 @@
<artifactId>apq-pc-control</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<junit.version>4.12</junit.version>
<lombok.version>1.16.18</lombok.version>
<jna.version>3.0.9</jna.version>
<spring-boot.version>2.4.10</spring-boot.version>
<jna.version>3.0.9</jna.version>
<winsw.version>2.0.1</winsw.version>
<pkg.name>apq-pc-control</pkg.name>
<pkg.user>priusis-iot</pkg.user>
......@@ -37,6 +36,15 @@
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>com.sun.winsw</groupId>
<artifactId>winsw</artifactId>
<version>${winsw.version}</version>
<classifier>bin</classifier>
<type>exe</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
......@@ -48,31 +56,26 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>5.7.11</version>
</dependency>
<dependency>
<groupId>com.sun.jna</groupId>
<artifactId>jna</artifactId>
<version>${jna.version}</version>
</dependency>
<dependency>
<groupId>com.github.oshi</groupId>
<artifactId>oshi-core</artifactId>
<version>3.5.0</version>
</dependency>
<dependency>
<groupId>com.sun.winsw</groupId>
<artifactId>winsw</artifactId>
<version>${winsw.version}</version>
<classifier>bin</classifier>
<type>exe</type>
<scope>provided</scope>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
</dependencies>
......
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd">
<id>windows</id>
<formats>
<format>zip</format>
</formats>
<!-- Workaround to create logs directory -->
<fileSets>
<fileSet>
<directory>${pkg.win.dist}</directory>
<outputDirectory>logs</outputDirectory>
<excludes>
<exclude>*/**</exclude>
</excludes>
</fileSet>
<fileSet>
<directory>${pkg.win.dist}/conf</directory>
<outputDirectory>conf</outputDirectory>
<lineEnding>windows</lineEnding>
<excludes>
<exclude>*.der</exclude>
<exclude>*.cer</exclude>
<exclude>*.pfx</exclude>
</excludes>
</fileSet>
<fileSet>
<directory>${pkg.win.dist}/conf</directory>
<outputDirectory>conf</outputDirectory>
<includes>
<include>*.der</include>
<include>*.cer</include>
<include>*.pfx</include>
</includes>
</fileSet>
</fileSets>
<files>
<file>
<source>${project.build.directory}/${project.build.finalName}-boot.${project.packaging}</source>
<outputDirectory>lib</outputDirectory>
<destName>${pkg.name}.jar</destName>
</file>
<file>
<source>${pkg.win.dist}/service.exe</source>
<outputDirectory/>
<destName>${pkg.name}.exe</destName>
</file>
<file>
<source>${pkg.win.dist}/service.xml</source>
<outputDirectory/>
<destName>${pkg.name}.xml</destName>
<lineEnding>windows</lineEnding>
</file>
<file>
<source>${pkg.win.dist}/install.bat</source>
<outputDirectory/>
<lineEnding>windows</lineEnding>
</file>
<file>
<source>${pkg.win.dist}/uninstall.bat</source>
<outputDirectory/>
<lineEnding>windows</lineEnding>
</file>
</files>
</assembly>
export JAVA_OPTS="$JAVA_OPTS -Dplatform=@pkg.platform@"
export LOG_FILENAME=${pkg.name}.out
export LOADER_PATH=${pkg.installFolder}/conf
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration>
<configuration>
<appender name="fileLogAppender"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${pkg.logFolder}/${pkg.name}.log</file>
<rollingPolicy
class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>${pkg.logFolder}/${pkg.name}.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<maxFileSize>100MB</maxFileSize>
<maxHistory>30</maxHistory>
<totalSizeCap>3GB</totalSizeCap>
</rollingPolicy>
<encoder>
<pattern>%d{ISO8601} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<logger name="org.priusis" level="INFO" />
<logger name="org.eclipse.milo" level="INFO" />
<logger name="org.eclipse.paho" level="INFO" />
<root level="INFO">
<appender-ref ref="fileLogAppender"/>
</root>
</configuration>
pkg.logFolder=${pkg.unixLogFolder}
\ No newline at end of file
pkg.logFolder=${BASE}\\logs
pkg.winWrapperLogFolder=%BASE%\\logs
package com;
import com.priusis.utils.ICQrDecode;
import com.priusis.utils.IHwPortController;
import com.zy.QrDecode.CQrDecode;
import lombok.extern.slf4j.Slf4j;
@Slf4j
public class TestDemo {
//static String qrString = "0000000D920A7111688CEDA9D7E27F2AE7C98D2E";
static String qrString = "0000000D9BBC6C567944AF514A1AD0A252491B99";
public static void main2(String[] args) {
String path = CQrDecode.parseAbsolutePath("/qr/dat/", "smart-property/0000000d.dat");
int[] result = new int[4];
CQrDecode qrInstance = new CQrDecode();
int ret = qrInstance.ZOOYAPI_GetCodeII(path + "0000000d.dat", qrString, result);
log.info("ret:{}", ret);
log.info("卡号 " + Integer.toHexString(result[0]));
log.info("校验码 " + Integer.toString(result[1]));
log.info("*********************************");
}
public static void main(String[] args) {
/*String path = CQrDecode.parseAbsolutePath("/qr/dat/", "smart-property/0000000d.dat");
......@@ -44,8 +27,8 @@ public class TestDemo {
int result31 = IHwPortController.instanceDll.APQ_HWPORT_get_normal_device_permit(4);
log.info("APQ_HWPORT_get_normal_device_permit ret:{}", result31);
// 设置普通设备权限
int result32 = IHwPortController.instanceDll.APQ_HWPORT_set_normal_device_permit(4, 1, null);
log.info("APQ_HWPORT_set_normal_device_permit ret:{}", result32);
//int result32 = IHwPortController.instanceDll.APQ_HWPORT_set_normal_device_permit(4, 1, null);
//log.info("APQ_HWPORT_set_normal_device_permit ret:{}", result32);
// 应用硬件接口管理模块的配置内容
int result5 = IHwPortController.instanceDll.APQ_HWPORT_Apply();
log.info("APQ_HWPORT_Apply ret:{}", result5);
......@@ -53,9 +36,9 @@ public class TestDemo {
int result33 = IHwPortController.instanceDll.APQ_HWPORT_get_normal_device_permit(4);
log.info("Check APQ_HWPORT_get_normal_device_permit ret:{}", result33);
// 获取网络设备权限
//int speed = 0;
//int result4 = IHwPortController.instanceDll.APQ_HWPORT_get_net_device_permit(0, speed);
//log.info("APQ_HWPORT_get_net_device_permit ret:{}, speed:{}", result4, speed);
int speed = 0;
int result4 = IHwPortController.instanceDll.APQ_HWPORT_get_net_device_permit(0);
log.info("APQ_HWPORT_get_net_device_permit ret:{}, speed:{}", result4, speed);
// 清理硬件接口管理模块
int result2 = IHwPortController.instanceDll.APQ_HWPORT_Uninitialize();
log.info("APQ_HWPORT_Uninitialize ret:{}", result2);
......
......@@ -37,7 +37,7 @@ public class ApqControlApplication {
SpringApplication.run(ApqControlApplication.class, args);
}
@Scheduled(fixedDelay = FIXED_DELAY)
@Scheduled(fixedDelay = 60000L)
protected void controlProgramTask() {
// 获取硬件监控配置 params == data
ResponseEntity<MqttRpcDataMessage> forEntity = restTemplate.getForEntity("http://localhost:8765/rpc_cmd/controll", MqttRpcDataMessage.class);
......
package com.priusis.utils;
import com.sun.jna.Library;
import com.sun.jna.Native;
import com.sun.jna.Platform;
public interface ICQrDecode extends Library {
ICQrDecode INSTANCE = (ICQrDecode) Native.loadLibrary((Platform.isWindows() ? "msvcrt" : "c"), ICQrDecode.class);
void printf(String format, Object... args);
ICQrDecode instanceDll = (ICQrDecode) Native.loadLibrary("D:\\work\\priusis\\priusis-iot\\apq-iot\\apq-client\\apq-pc-control\\src\\main\\resources\\QrDecode.dll", ICQrDecode.class);
public int hello(String str);
public int ZOOYAPI_GetCode(String path, String qrString, int[] result);
public int ZOOYAPI_GetCodeII(String path, String qrString, int[] result);
}
......@@ -118,6 +118,14 @@ public interface IHwPortController extends Library {
*/
int APQ_HWPORT_get_net_device_permit(int device_id, int speed);
/**
* 获取网络设备权限
*
* @param device_id 指定网络设备硬件接口类型 {@link HwportNetDevidEnum}
* @return 返回存放配置内的带宽限速值 {@link HwportNetPermEnum} 权限类型
*/
int APQ_HWPORT_get_net_device_permit(int device_id);
/**
* 设置网络设备权限
* 设置限速选项会启动限速线程,退出程序时需要调用APQ_HWPORT_NET_PERM_NO_LIMIT或者其他不限速的权限清理限速线程
......
package com.priusis.utils;
import lombok.Data;
/**
* @author yanghan
* @date 2020/11/27 16:15
*/
@Data
public class QrCode {
/**设备卡号*/
private String card;
/**校验码*/
private String checkCode;
@Override
public String toString() {
return "QrCode{" +
"card='" + card + '\'' +
", checkCode='" + checkCode + '\'' +
'}';
}
}
package com.priusis.utils;
import com.priusis.exception.ServiceException;
import com.zy.QrDecode.CQrDecode;
import lombok.extern.slf4j.Slf4j;
@Slf4j
public class QrCodeUtils {
static int[] result = new int[4];
public static QrCode qrCodeUt(String qrString) {
String path = CQrDecode.parseAbsolutePath("/qr/dat/0000000d.dat", "smart-property/0000000d.dat");
CQrDecode cQrDecode = new CQrDecode();
int i = cQrDecode.ZOOYAPI_GetCodeII(path, qrString, result);
log.info("二维码解码状态:{}, datPath:{}", i, path);
switch (i) {
case 0:
QrCode qrCode = new QrCode();
qrCode.setCard(Integer.toHexString(result[0]));
qrCode.setCheckCode(Integer.toString(result[1]));
return qrCode;
case 4001:
throw new ServiceException("key file path error or not exist");
case 4003:
throw new ServiceException("key file open fail");
case 4005:
throw new ServiceException("qr-code is not match current key file");
default:
return null;
}
}
}
package com.zy.QrDecode;
import com.sun.jna.Platform;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.system.ApplicationHome;
import java.io.File;
import java.io.UnsupportedEncodingException;
@Slf4j
public class CQrDecode {
static {
/*
dll 问题
IDEA中通过load加载
或者配置loadLibrary,都是要配置 -Djava.library.path=D:\work\priusis\projects\ower\QrDecode
*/
try {
String path = parseAbsolutePath("/qr/dll", "/qr/dll");
log.debug("load加载path:{}", path);
if (Platform.isWindows()) {
System.load(path + "/QrDecode.dll");
} else if (Platform.isLinux()) {
String lib = System.getProperty("java.library.path");
lib = path + ":" + lib;
log.debug("load加载 java.library.path:{}", lib);
System.setProperty("java.library.path", lib);
System.loadLibrary("QrDecode");
}
} catch (Exception e) {
log.error("loadLibrary Exception");
}
}
public native int hello(String str);
public native int ZOOYAPI_GetCode(String path, String qrString, int[] result);
public native int ZOOYAPI_GetCodeII(String path, String qrString, int[] result);
/**
* @param relatePath 相对路径 /qr/dat/
* @return
*/
public static String parseAbsolutePath(String relatePath, String defaultPath) {
String path = defaultPath;
if (Platform.isWindows()) {
path = CQrDecode.class.getResource(relatePath).getPath();
path = path.replaceFirst("/", "");//排除中文空格
path = path.replaceAll("%20", " ");//排除中文空格
path = path.replaceAll("/", "\\\\");//排除中文空格
try {
path = java.net.URLDecoder.decode(path, "utf-8"); //解决路径包含中文的情况
} catch (UnsupportedEncodingException e) {
log.error("巡检二维码异常", e);
}
}
if (Platform.isLinux()) {
try {
ApplicationHome h = new ApplicationHome(CQrDecode.class);
File jarF = h.getSource();
log.debug("load加载jarF:{}", jarF);
log.debug("load加载jarF:{}", jarF.getPath());
path = jarF.getParentFile().toString() + relatePath;
} catch (Exception e) {
log.error("巡检二维码获取path异常:{}", e);
path = "/app/smart-property/qr/dll";
}
}
return path;
}
}
server:
# Server bind address
address: "0.0.0.0"
port: ${random.int[20000,29999]}
port: ${random.int[10000,19999]}
}nsgm?!7G*X2pErfK0%XjStԮr{=^<Sa
\ No newline at end of file
[Unit]
Description=${pkg.name}
After=syslog.target
[Service]
User=${pkg.user}
ExecStart=${pkg.installFolder}/bin/${pkg.name}.jar
SuccessExitStatus=143
[Install]
WantedBy=multi-user.target
#!/bin/sh
chown -R ${pkg.user}: ${pkg.logFolder}
chown -R ${pkg.user}: ${pkg.installFolder}
update-rc.d ${pkg.name} defaults
#!/bin/sh
update-rc.d -f ${pkg.name} remove
#!/bin/sh
if ! getent group ${pkg.user} >/dev/null; then
addgroup --system ${pkg.user}
fi
if ! getent passwd ${pkg.user} >/dev/null; then
adduser --quiet \
--system \
--ingroup ${pkg.user} \
--quiet \
--disabled-login \
--disabled-password \
--home ${pkg.installFolder} \
--no-create-home \
-gecos "Priusisiot application" \
${pkg.user}
fi
#!/bin/sh
if [ -e /var/run/${pkg.name}/${pkg.name}.pid ]; then
service ${pkg.name} stop
fi
#!/bin/sh
chown -R ${pkg.user}: ${pkg.logFolder}
chown -R ${pkg.user}: ${pkg.installFolder}
if [ $1 -eq 1 ] ; then
# Initial installation
systemctl --no-reload enable ${pkg.name}.service >/dev/null 2>&1 || :
fi
#!/bin/sh
if [ $1 -ge 1 ] ; then
# Package upgrade, not uninstall
systemctl try-restart ${pkg.name}.service >/dev/null 2>&1 || :
fi
#!/bin/sh
getent group ${pkg.user} >/dev/null || groupadd -r ${pkg.user}
getent passwd ${pkg.user} >/dev/null || \
useradd -d ${pkg.installFolder} -g ${pkg.user} -M -r ${pkg.user} -s /sbin/nologin \
-c "Priusisiot application"
#!/bin/sh
if [ $1 -eq 0 ] ; then
# Package removal, not upgrade
systemctl --no-reload disable --now ${pkg.name}.service > /dev/null 2>&1 || :
fi
@ECHO OFF
setlocal ENABLEEXTENSIONS
@ECHO Detecting Java version installed.
:CHECK_JAVA_64
@ECHO Detecting if it is 64 bit machine
set KEY_NAME="HKEY_LOCAL_MACHINE\Software\Wow6432Node\JavaSoft\Java Runtime Environment"
set VALUE_NAME=CurrentVersion
FOR /F "usebackq skip=2 tokens=1-3" %%A IN (`REG QUERY %KEY_NAME% /v %VALUE_NAME% 2^>nul`) DO (
set ValueName=%%A
set ValueType=%%B
set ValueValue=%%C
)
@ECHO CurrentVersion %ValueValue%
SET KEY_NAME="%KEY_NAME:~1,-1%\%ValueValue%"
SET VALUE_NAME=JavaHome
if defined ValueName (
FOR /F "usebackq skip=2 tokens=1,2*" %%A IN (`REG QUERY %KEY_NAME% /v %VALUE_NAME% 2^>nul`) DO (
set ValueName2=%%A
set ValueType2=%%B
set JRE_PATH2=%%C
if defined ValueName2 (
set ValueName = %ValueName2%
set ValueType = %ValueType2%
set ValueValue = %JRE_PATH2%
)
)
)
IF NOT "%JRE_PATH2%" == "" GOTO JAVA_INSTALLED
:CHECK_JAVA_32
@ECHO Detecting if it is 32 bit machine
set KEY_NAME="HKEY_LOCAL_MACHINE\Software\JavaSoft\Java Runtime Environment"
set VALUE_NAME=CurrentVersion
FOR /F "usebackq skip=2 tokens=1-3" %%A IN (`REG QUERY %KEY_NAME% /v %VALUE_NAME% 2^>nul`) DO (
set ValueName=%%A
set ValueType=%%B
set ValueValue=%%C
)
@ECHO CurrentVersion %ValueValue%
SET KEY_NAME="%KEY_NAME:~1,-1%\%ValueValue%"
SET VALUE_NAME=JavaHome
if defined ValueName (
FOR /F "usebackq skip=2 tokens=1,2*" %%A IN (`REG QUERY %KEY_NAME% /v %VALUE_NAME% 2^>nul`) DO (
set ValueName2=%%A
set ValueType2=%%B
set JRE_PATH2=%%C
if defined ValueName2 (
set ValueName = %ValueName2%
set ValueType = %ValueType2%
set ValueValue = %JRE_PATH2%
)
)
)
IF "%JRE_PATH2%" == "" GOTO JAVA_NOT_INSTALLED
:JAVA_INSTALLED
@ECHO Java 1.8 found!
@ECHO Installing ${pkg.name} ...
%~dp0${pkg.name}.exe install
@ECHO DONE.
GOTO END
:JAVA_NOT_INSTALLED
@ECHO Java 1.8 or above is not installed
@ECHO Please go to https://java.com/ and install Java. Then retry installation.
PAUSE
GOTO END
:END
<service>
<id>${pkg.name}</id>
<name>${project.name}</name>
<description>${project.description}</description>
<workingdirectory>%BASE%\conf</workingdirectory>
<logpath>${pkg.winWrapperLogFolder}</logpath>
<logmode>rotate</logmode>
<env name="LOADER_PATH" value="%BASE%\conf" />
<executable>java</executable>
<startargument>-Dplatform=windows</startargument>
<startargument>-jar</startargument>
<startargument>%BASE%\lib\${pkg.name}.jar</startargument>
</service>
@ECHO OFF
@ECHO Stopping ${pkg.name} ...
net stop ${pkg.name}
@ECHO Uninstalling ${pkg.name} ...
%~dp0${pkg.name}.exe uninstall
@ECHO DONE.
\ No newline at end of file
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd">
<id>windows</id>
<formats>
<format>zip</format>
</formats>
<!-- Workaround to create logs directory -->
<fileSets>
<fileSet>
<directory>${pkg.win.dist}</directory>
<outputDirectory>logs</outputDirectory>
<excludes>
<exclude>*/**</exclude>
</excludes>
</fileSet>
<fileSet>
<directory>${pkg.win.dist}/conf</directory>
<outputDirectory>conf</outputDirectory>
<lineEnding>windows</lineEnding>
<excludes>
<exclude>*.der</exclude>
<exclude>*.cer</exclude>
<exclude>*.pfx</exclude>
</excludes>
</fileSet>
<fileSet>
<directory>${pkg.win.dist}/conf</directory>
<outputDirectory>conf</outputDirectory>
<includes>
<include>*.der</include>
<include>*.cer</include>
<include>*.pfx</include>
</includes>
</fileSet>
</fileSets>
<files>
<file>
<source>${project.build.directory}/${project.build.finalName}-boot.${project.packaging}</source>
<outputDirectory>lib</outputDirectory>
<destName>${pkg.name}.jar</destName>
</file>
<file>
<source>${pkg.win.dist}/service.exe</source>
<outputDirectory/>
<destName>${pkg.name}.exe</destName>
</file>
<file>
<source>${pkg.win.dist}/service.xml</source>
<outputDirectory/>
<destName>${pkg.name}.xml</destName>
<lineEnding>windows</lineEnding>
</file>
<file>
<source>${pkg.win.dist}/install.bat</source>
<outputDirectory/>
<lineEnding>windows</lineEnding>
</file>
<file>
<source>${pkg.win.dist}/uninstall.bat</source>
<outputDirectory/>
<lineEnding>windows</lineEnding>
</file>
</files>
</assembly>
export JAVA_OPTS="$JAVA_OPTS -Dplatform=@pkg.platform@"
export LOG_FILENAME=${pkg.name}.out
export LOADER_PATH=${pkg.installFolder}/conf
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration>
<configuration>
<appender name="fileLogAppender"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${pkg.logFolder}/${pkg.name}.log</file>
<rollingPolicy
class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>${pkg.logFolder}/${pkg.name}.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<maxFileSize>100MB</maxFileSize>
<maxHistory>30</maxHistory>
<totalSizeCap>3GB</totalSizeCap>
</rollingPolicy>
<encoder>
<pattern>%d{ISO8601} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<logger name="org.priusis" level="INFO" />
<logger name="org.eclipse.milo" level="INFO" />
<logger name="org.eclipse.paho" level="INFO" />
<root level="INFO">
<appender-ref ref="fileLogAppender"/>
</root>
</configuration>
pkg.logFolder=${pkg.unixLogFolder}
\ No newline at end of file
pkg.logFolder=${BASE}\\logs
pkg.winWrapperLogFolder=%BASE%\\logs
[Unit]
Description=${pkg.name}
After=syslog.target
[Service]
User=${pkg.user}
ExecStart=${pkg.installFolder}/bin/${pkg.name}.jar
SuccessExitStatus=143
[Install]
WantedBy=multi-user.target
#!/bin/sh
chown -R ${pkg.user}: ${pkg.logFolder}
chown -R ${pkg.user}: ${pkg.installFolder}
update-rc.d ${pkg.name} defaults
#!/bin/sh
update-rc.d -f ${pkg.name} remove
#!/bin/sh
if ! getent group ${pkg.user} >/dev/null; then
addgroup --system ${pkg.user}
fi
if ! getent passwd ${pkg.user} >/dev/null; then
adduser --quiet \
--system \
--ingroup ${pkg.user} \
--quiet \
--disabled-login \
--disabled-password \
--home ${pkg.installFolder} \
--no-create-home \
-gecos "Priusisiot application" \
${pkg.user}
fi
#!/bin/sh
if [ -e /var/run/${pkg.name}/${pkg.name}.pid ]; then
service ${pkg.name} stop
fi
#!/bin/sh
chown -R ${pkg.user}: ${pkg.logFolder}
chown -R ${pkg.user}: ${pkg.installFolder}
if [ $1 -eq 1 ] ; then
# Initial installation
systemctl --no-reload enable ${pkg.name}.service >/dev/null 2>&1 || :
fi
#!/bin/sh
if [ $1 -ge 1 ] ; then
# Package upgrade, not uninstall
systemctl try-restart ${pkg.name}.service >/dev/null 2>&1 || :
fi
#!/bin/sh
getent group ${pkg.user} >/dev/null || groupadd -r ${pkg.user}
getent passwd ${pkg.user} >/dev/null || \
useradd -d ${pkg.installFolder} -g ${pkg.user} -M -r ${pkg.user} -s /sbin/nologin \
-c "Priusisiot application"
#!/bin/sh
if [ $1 -eq 0 ] ; then
# Package removal, not upgrade
systemctl --no-reload disable --now ${pkg.name}.service > /dev/null 2>&1 || :
fi
@ECHO OFF
setlocal ENABLEEXTENSIONS
@ECHO Detecting Java version installed.
:CHECK_JAVA_64
@ECHO Detecting if it is 64 bit machine
set KEY_NAME="HKEY_LOCAL_MACHINE\Software\Wow6432Node\JavaSoft\Java Runtime Environment"
set VALUE_NAME=CurrentVersion
FOR /F "usebackq skip=2 tokens=1-3" %%A IN (`REG QUERY %KEY_NAME% /v %VALUE_NAME% 2^>nul`) DO (
set ValueName=%%A
set ValueType=%%B
set ValueValue=%%C
)
@ECHO CurrentVersion %ValueValue%
SET KEY_NAME="%KEY_NAME:~1,-1%\%ValueValue%"
SET VALUE_NAME=JavaHome
if defined ValueName (
FOR /F "usebackq skip=2 tokens=1,2*" %%A IN (`REG QUERY %KEY_NAME% /v %VALUE_NAME% 2^>nul`) DO (
set ValueName2=%%A
set ValueType2=%%B
set JRE_PATH2=%%C
if defined ValueName2 (
set ValueName = %ValueName2%
set ValueType = %ValueType2%
set ValueValue = %JRE_PATH2%
)
)
)
IF NOT "%JRE_PATH2%" == "" GOTO JAVA_INSTALLED
:CHECK_JAVA_32
@ECHO Detecting if it is 32 bit machine
set KEY_NAME="HKEY_LOCAL_MACHINE\Software\JavaSoft\Java Runtime Environment"
set VALUE_NAME=CurrentVersion
FOR /F "usebackq skip=2 tokens=1-3" %%A IN (`REG QUERY %KEY_NAME% /v %VALUE_NAME% 2^>nul`) DO (
set ValueName=%%A
set ValueType=%%B
set ValueValue=%%C
)
@ECHO CurrentVersion %ValueValue%
SET KEY_NAME="%KEY_NAME:~1,-1%\%ValueValue%"
SET VALUE_NAME=JavaHome
if defined ValueName (
FOR /F "usebackq skip=2 tokens=1,2*" %%A IN (`REG QUERY %KEY_NAME% /v %VALUE_NAME% 2^>nul`) DO (
set ValueName2=%%A
set ValueType2=%%B
set JRE_PATH2=%%C
if defined ValueName2 (
set ValueName = %ValueName2%
set ValueType = %ValueType2%
set ValueValue = %JRE_PATH2%
)
)
)
IF "%JRE_PATH2%" == "" GOTO JAVA_NOT_INSTALLED
:JAVA_INSTALLED
@ECHO Java 1.8 found!
@ECHO Installing ${pkg.name} ...
%~dp0${pkg.name}.exe install
@ECHO DONE.
GOTO END
:JAVA_NOT_INSTALLED
@ECHO Java 1.8 or above is not installed
@ECHO Please go to https://java.com/ and install Java. Then retry installation.
PAUSE
GOTO END
:END
<service>
<id>${pkg.name}</id>
<name>${project.name}</name>
<description>${project.description}</description>
<workingdirectory>%BASE%\conf</workingdirectory>
<logpath>${pkg.winWrapperLogFolder}</logpath>
<logmode>rotate</logmode>
<env name="LOADER_PATH" value="%BASE%\conf" />
<executable>java</executable>
<startargument>-Dplatform=windows</startargument>
<startargument>-jar</startargument>
<startargument>%BASE%\lib\${pkg.name}.jar</startargument>
</service>
@ECHO OFF
@ECHO Stopping ${pkg.name} ...
net stop ${pkg.name}
@ECHO Uninstalling ${pkg.name} ...
%~dp0${pkg.name}.exe uninstall
@ECHO DONE.
\ No newline at end of file
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd">
<id>windows</id>
<formats>
<format>zip</format>
</formats>
<!-- Workaround to create logs directory -->
<fileSets>
<fileSet>
<directory>${pkg.win.dist}</directory>
<outputDirectory>logs</outputDirectory>
<excludes>
<exclude>*/**</exclude>
</excludes>
</fileSet>
<fileSet>
<directory>${pkg.win.dist}/conf</directory>
<outputDirectory>conf</outputDirectory>
<lineEnding>windows</lineEnding>
<excludes>
<exclude>*.der</exclude>
<exclude>*.cer</exclude>
<exclude>*.pfx</exclude>
</excludes>
</fileSet>
<fileSet>
<directory>${pkg.win.dist}/conf</directory>
<outputDirectory>conf</outputDirectory>
<includes>
<include>*.der</include>
<include>*.cer</include>
<include>*.pfx</include>
</includes>
</fileSet>
</fileSets>
<files>
<file>
<source>${project.build.directory}/${project.build.finalName}-boot.${project.packaging}</source>
<outputDirectory>lib</outputDirectory>
<destName>${pkg.name}.jar</destName>
</file>
<file>
<source>${pkg.win.dist}/service.exe</source>
<outputDirectory/>
<destName>${pkg.name}.exe</destName>
</file>
<file>
<source>${pkg.win.dist}/service.xml</source>
<outputDirectory/>
<destName>${pkg.name}.xml</destName>
<lineEnding>windows</lineEnding>
</file>
<file>
<source>${pkg.win.dist}/install.bat</source>
<outputDirectory/>
<lineEnding>windows</lineEnding>
</file>
<file>
<source>${pkg.win.dist}/uninstall.bat</source>
<outputDirectory/>
<lineEnding>windows</lineEnding>
</file>
</files>
</assembly>
export JAVA_OPTS="$JAVA_OPTS -Dplatform=@pkg.platform@"
export LOG_FILENAME=${pkg.name}.out
export LOADER_PATH=${pkg.installFolder}/conf
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration>
<configuration>
<appender name="fileLogAppender"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${pkg.logFolder}/${pkg.name}.log</file>
<rollingPolicy
class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>${pkg.logFolder}/${pkg.name}.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<maxFileSize>100MB</maxFileSize>
<maxHistory>30</maxHistory>
<totalSizeCap>3GB</totalSizeCap>
</rollingPolicy>
<encoder>
<pattern>%d{ISO8601} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<logger name="org.priusis" level="INFO" />
<logger name="org.eclipse.milo" level="INFO" />
<logger name="org.eclipse.paho" level="INFO" />
<root level="INFO">
<appender-ref ref="fileLogAppender"/>
</root>
</configuration>
pkg.logFolder=${pkg.unixLogFolder}
\ No newline at end of file
pkg.logFolder=${BASE}\\logs
pkg.winWrapperLogFolder=%BASE%\\logs
......@@ -48,7 +48,7 @@ public class ApqRegisterApplication {
@Autowired
private RestTemplate restTemplate;
@Scheduled(fixedDelay = FIXED_DELAY)
@Scheduled(fixedDelay = 60000L)
protected void registerProgramTask() {
// 获取软件检测监控配置 params == data
ResponseEntity<MqttRpcDataMessage> forEntity = restTemplate.getForEntity("http://localhost:8765/rpc_cmd/register", MqttRpcDataMessage.class);
......
[Unit]
Description=${pkg.name}
After=syslog.target
[Service]
User=${pkg.user}
ExecStart=${pkg.installFolder}/bin/${pkg.name}.jar
SuccessExitStatus=143
[Install]
WantedBy=multi-user.target
#!/bin/sh
chown -R ${pkg.user}: ${pkg.logFolder}
chown -R ${pkg.user}: ${pkg.installFolder}
update-rc.d ${pkg.name} defaults
#!/bin/sh
update-rc.d -f ${pkg.name} remove
#!/bin/sh
if ! getent group ${pkg.user} >/dev/null; then
addgroup --system ${pkg.user}
fi
if ! getent passwd ${pkg.user} >/dev/null; then
adduser --quiet \
--system \
--ingroup ${pkg.user} \
--quiet \
--disabled-login \
--disabled-password \
--home ${pkg.installFolder} \
--no-create-home \
-gecos "Priusisiot application" \
${pkg.user}
fi
#!/bin/sh
if [ -e /var/run/${pkg.name}/${pkg.name}.pid ]; then
service ${pkg.name} stop
fi
#!/bin/sh
chown -R ${pkg.user}: ${pkg.logFolder}
chown -R ${pkg.user}: ${pkg.installFolder}
if [ $1 -eq 1 ] ; then
# Initial installation
systemctl --no-reload enable ${pkg.name}.service >/dev/null 2>&1 || :
fi
#!/bin/sh
if [ $1 -ge 1 ] ; then
# Package upgrade, not uninstall
systemctl try-restart ${pkg.name}.service >/dev/null 2>&1 || :
fi
#!/bin/sh
getent group ${pkg.user} >/dev/null || groupadd -r ${pkg.user}
getent passwd ${pkg.user} >/dev/null || \
useradd -d ${pkg.installFolder} -g ${pkg.user} -M -r ${pkg.user} -s /sbin/nologin \
-c "Priusisiot application"
#!/bin/sh
if [ $1 -eq 0 ] ; then
# Package removal, not upgrade
systemctl --no-reload disable --now ${pkg.name}.service > /dev/null 2>&1 || :
fi
@ECHO OFF
setlocal ENABLEEXTENSIONS
@ECHO Detecting Java version installed.
:CHECK_JAVA_64
@ECHO Detecting if it is 64 bit machine
set KEY_NAME="HKEY_LOCAL_MACHINE\Software\Wow6432Node\JavaSoft\Java Runtime Environment"
set VALUE_NAME=CurrentVersion
FOR /F "usebackq skip=2 tokens=1-3" %%A IN (`REG QUERY %KEY_NAME% /v %VALUE_NAME% 2^>nul`) DO (
set ValueName=%%A
set ValueType=%%B
set ValueValue=%%C
)
@ECHO CurrentVersion %ValueValue%
SET KEY_NAME="%KEY_NAME:~1,-1%\%ValueValue%"
SET VALUE_NAME=JavaHome
if defined ValueName (
FOR /F "usebackq skip=2 tokens=1,2*" %%A IN (`REG QUERY %KEY_NAME% /v %VALUE_NAME% 2^>nul`) DO (
set ValueName2=%%A
set ValueType2=%%B
set JRE_PATH2=%%C
if defined ValueName2 (
set ValueName = %ValueName2%
set ValueType = %ValueType2%
set ValueValue = %JRE_PATH2%
)
)
)
IF NOT "%JRE_PATH2%" == "" GOTO JAVA_INSTALLED
:CHECK_JAVA_32
@ECHO Detecting if it is 32 bit machine
set KEY_NAME="HKEY_LOCAL_MACHINE\Software\JavaSoft\Java Runtime Environment"
set VALUE_NAME=CurrentVersion
FOR /F "usebackq skip=2 tokens=1-3" %%A IN (`REG QUERY %KEY_NAME% /v %VALUE_NAME% 2^>nul`) DO (
set ValueName=%%A
set ValueType=%%B
set ValueValue=%%C
)
@ECHO CurrentVersion %ValueValue%
SET KEY_NAME="%KEY_NAME:~1,-1%\%ValueValue%"
SET VALUE_NAME=JavaHome
if defined ValueName (
FOR /F "usebackq skip=2 tokens=1,2*" %%A IN (`REG QUERY %KEY_NAME% /v %VALUE_NAME% 2^>nul`) DO (
set ValueName2=%%A
set ValueType2=%%B
set JRE_PATH2=%%C
if defined ValueName2 (
set ValueName = %ValueName2%
set ValueType = %ValueType2%
set ValueValue = %JRE_PATH2%
)
)
)
IF "%JRE_PATH2%" == "" GOTO JAVA_NOT_INSTALLED
:JAVA_INSTALLED
@ECHO Java 1.8 found!
@ECHO Installing ${pkg.name} ...
%~dp0${pkg.name}.exe install
@ECHO DONE.
GOTO END
:JAVA_NOT_INSTALLED
@ECHO Java 1.8 or above is not installed
@ECHO Please go to https://java.com/ and install Java. Then retry installation.
PAUSE
GOTO END
:END
<service>
<id>${pkg.name}</id>
<name>${project.name}</name>
<description>${project.description}</description>
<workingdirectory>%BASE%\conf</workingdirectory>
<logpath>${pkg.winWrapperLogFolder}</logpath>
<logmode>rotate</logmode>
<env name="LOADER_PATH" value="%BASE%\conf" />
<executable>java</executable>
<startargument>-Dplatform=windows</startargument>
<startargument>-jar</startargument>
<startargument>%BASE%\lib\${pkg.name}.jar</startargument>
</service>
@ECHO OFF
@ECHO Stopping ${pkg.name} ...
net stop ${pkg.name}
@ECHO Uninstalling ${pkg.name} ...
%~dp0${pkg.name}.exe uninstall
@ECHO DONE.
\ No newline at end of file
......@@ -21,7 +21,7 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.build.timestamp.format>yyyyMMdd</maven.build.timestamp.format>
<maven-compiler-plugin.version>3.7.0</maven-compiler-plugin.version>
<jdk.version>1.8</jdk.version>
<java.version>1.8</java.version>
<netty.version>4.1.49.Final</netty.version>
<guava.version>28.2-jre</guava.version>
......@@ -50,6 +50,19 @@
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论