From 9823434122fc092e0eec5e1fe90283f39a8e8fcc Mon Sep 17 00:00:00 2001 From: tjq Date: Mon, 20 Apr 2020 17:46:50 +0800 Subject: [PATCH] change the pom for release --- .../kfcfans/common/model/SystemMetrics.java | 4 +- .../kfcfans/common/utils/CommonUtils.java | 5 +- .../github/kfcfans/common/utils/NetUtils.java | 14 +- .../kfcfans/common/utils/SupplierPlus.java | 2 +- pom.xml | 139 ++++++++++++++---- 5 files changed, 119 insertions(+), 45 deletions(-) diff --git a/oh-my-scheduler-common/src/main/java/com/github/kfcfans/common/model/SystemMetrics.java b/oh-my-scheduler-common/src/main/java/com/github/kfcfans/common/model/SystemMetrics.java index 8774cc8d..1b107ac6 100644 --- a/oh-my-scheduler-common/src/main/java/com/github/kfcfans/common/model/SystemMetrics.java +++ b/oh-my-scheduler-common/src/main/java/com/github/kfcfans/common/model/SystemMetrics.java @@ -40,8 +40,8 @@ public class SystemMetrics implements OmsSerializable, Comparable } /** - * 计算得分情况,内存 > CPU > 磁盘 - * 磁盘必须有1G以上的剩余空间 + * 计算得分情况,内存 then CPU then 磁盘(磁盘必须有1G以上的剩余空间) + * @return 得分情况 */ public int calculateScore() { diff --git a/oh-my-scheduler-common/src/main/java/com/github/kfcfans/common/utils/CommonUtils.java b/oh-my-scheduler-common/src/main/java/com/github/kfcfans/common/utils/CommonUtils.java index 3c5d2303..cd52d346 100644 --- a/oh-my-scheduler-common/src/main/java/com/github/kfcfans/common/utils/CommonUtils.java +++ b/oh-my-scheduler-common/src/main/java/com/github/kfcfans/common/utils/CommonUtils.java @@ -20,6 +20,7 @@ public class CommonUtils { * @param executor 需要执行的方法 * @param retryTimes 重试的次数 * @param intervalMS 失败后下一次执行的间隔时间 + * @param 执行函数返回值类型 * @return 函数成功执行后的返回值 * @throws Exception 执行失败,调用方自行处理 */ @@ -66,9 +67,11 @@ public class CommonUtils { return booleanExecutor.get(); } + /** * 生成数据库查询语句 in 后的条件 - * ["a", "b", "c"] -> ('a','b','c') + * @param collection eg,["a", "b", "c"] + * @return eg,('a','b','c') */ public static String getInStringCondition(Collection collection) { if (collection == null || collection.isEmpty()) { diff --git a/oh-my-scheduler-common/src/main/java/com/github/kfcfans/common/utils/NetUtils.java b/oh-my-scheduler-common/src/main/java/com/github/kfcfans/common/utils/NetUtils.java index 42313593..7dcfe115 100644 --- a/oh-my-scheduler-common/src/main/java/com/github/kfcfans/common/utils/NetUtils.java +++ b/oh-my-scheduler-common/src/main/java/com/github/kfcfans/common/utils/NetUtils.java @@ -157,16 +157,15 @@ public class NetUtils { /** * 获取本机 IP 地址 + * @return 本机IP地址 */ public static String getLocalHost() { InetAddress address = getLocalAddress(); return address == null ? LOCALHOST_VALUE : address.getHostAddress(); } - /** * Find first valid IP from local network card - * * @return first valid local IP */ public static InetAddress getLocalAddress() { @@ -258,7 +257,8 @@ public class NetUtils { } /** - * @param hostName + * getIpByHost + * @param hostName hostName * @return ip address or hostName if UnknownHostException */ public static String getIpByHost(String hostName) { @@ -340,13 +340,7 @@ public class NetUtils { } } - /** - * @param pattern - * @param host - * @param port - * @return - * @throws UnknownHostException - */ + public static boolean matchIpRange(String pattern, String host, int port) throws UnknownHostException { if (pattern == null || host == null) { throw new IllegalArgumentException("Illegal Argument pattern or hostName. Pattern:" + pattern + ", Host:" + host); diff --git a/oh-my-scheduler-common/src/main/java/com/github/kfcfans/common/utils/SupplierPlus.java b/oh-my-scheduler-common/src/main/java/com/github/kfcfans/common/utils/SupplierPlus.java index f400db85..0f43b9da 100644 --- a/oh-my-scheduler-common/src/main/java/com/github/kfcfans/common/utils/SupplierPlus.java +++ b/oh-my-scheduler-common/src/main/java/com/github/kfcfans/common/utils/SupplierPlus.java @@ -19,8 +19,8 @@ public interface SupplierPlus { /** * Gets a result. - * * @return a result + * @throws Exception allow to throw Exception */ T get() throws Exception; } diff --git a/pom.xml b/pom.xml index 5e5cabe2..6cc99520 100644 --- a/pom.xml +++ b/pom.xml @@ -7,6 +7,33 @@ com.github.kfcfans oh-my-scheduler 1.0.0 + pom + oh-my-scheduler + https://github.com/KFCFans/OhMyScheduler + Distributed scheduling and execution framework + + + Apache License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0 + repo + + + + https://github.com/KFCFans/OhMyScheduler + https://github.com/KFCFans/OhMyScheduler.git + + + + tengjiqi + tengjiqi + tengjiqi@gmail.com + + Developer + + +8 + + + oh-my-scheduler-worker oh-my-scheduler-server @@ -14,7 +41,6 @@ oh-my-scheduler-client oh-my-scheduler-worker-samples - pom 1.8 @@ -22,6 +48,8 @@ 1.8 3.8.1 3.2.1 + 3.2.0 + 1.6 UTF-8 UTF-8 1.18.12 @@ -37,34 +65,83 @@ - - - - - org.apache.maven.plugins - maven-compiler-plugin - ${maven-compiler-plugin.version} - - ${java.version} - ${java.version} - ${java.version} - ${java.version} - - - - - org.apache.maven.plugins - maven-source-plugin - ${maven-source-plugin.version} - - - attach-sources - - jar - - - - - - + + + release + + true + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven-compiler-plugin.version} + + ${java.version} + ${java.version} + ${java.version} + ${java.version} + + + + + org.apache.maven.plugins + maven-source-plugin + ${maven-source-plugin.version} + + + package + + jar-no-fork + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + ${maven-javadoc-plugin.version} + + + package + + jar + + + + + + + org.apache.maven.plugins + maven-gpg-plugin + ${maven-gpg-plugin.version} + + + verify + + sign + + + + + + + + + + ossrh + https://oss.sonatype.org/content/repositories/snapshots/ + + + ossrh + https://oss.sonatype.org/service/local/staging/deploy/maven2/ + + + + + \ No newline at end of file