mirror of
https://github.com/PowerJob/PowerJob.git
synced 2025-07-17 00:00:04 +08:00
change the pom for release
This commit is contained in:
parent
0726e1f630
commit
9823434122
@ -40,8 +40,8 @@ public class SystemMetrics implements OmsSerializable, Comparable<SystemMetrics>
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 计算得分情况,内存 > CPU > 磁盘
|
* 计算得分情况,内存 then CPU then 磁盘(磁盘必须有1G以上的剩余空间)
|
||||||
* 磁盘必须有1G以上的剩余空间
|
* @return 得分情况
|
||||||
*/
|
*/
|
||||||
public int calculateScore() {
|
public int calculateScore() {
|
||||||
|
|
||||||
|
@ -20,6 +20,7 @@ public class CommonUtils {
|
|||||||
* @param executor 需要执行的方法
|
* @param executor 需要执行的方法
|
||||||
* @param retryTimes 重试的次数
|
* @param retryTimes 重试的次数
|
||||||
* @param intervalMS 失败后下一次执行的间隔时间
|
* @param intervalMS 失败后下一次执行的间隔时间
|
||||||
|
* @param <T> 执行函数返回值类型
|
||||||
* @return 函数成功执行后的返回值
|
* @return 函数成功执行后的返回值
|
||||||
* @throws Exception 执行失败,调用方自行处理
|
* @throws Exception 执行失败,调用方自行处理
|
||||||
*/
|
*/
|
||||||
@ -66,9 +67,11 @@ public class CommonUtils {
|
|||||||
return booleanExecutor.get();
|
return booleanExecutor.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生成数据库查询语句 in 后的条件
|
* 生成数据库查询语句 in 后的条件
|
||||||
* ["a", "b", "c"] -> ('a','b','c')
|
* @param collection eg,["a", "b", "c"]
|
||||||
|
* @return eg,('a','b','c')
|
||||||
*/
|
*/
|
||||||
public static String getInStringCondition(Collection<String> collection) {
|
public static String getInStringCondition(Collection<String> collection) {
|
||||||
if (collection == null || collection.isEmpty()) {
|
if (collection == null || collection.isEmpty()) {
|
||||||
|
@ -157,16 +157,15 @@ public class NetUtils {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取本机 IP 地址
|
* 获取本机 IP 地址
|
||||||
|
* @return 本机IP地址
|
||||||
*/
|
*/
|
||||||
public static String getLocalHost() {
|
public static String getLocalHost() {
|
||||||
InetAddress address = getLocalAddress();
|
InetAddress address = getLocalAddress();
|
||||||
return address == null ? LOCALHOST_VALUE : address.getHostAddress();
|
return address == null ? LOCALHOST_VALUE : address.getHostAddress();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Find first valid IP from local network card
|
* Find first valid IP from local network card
|
||||||
*
|
|
||||||
* @return first valid local IP
|
* @return first valid local IP
|
||||||
*/
|
*/
|
||||||
public static InetAddress getLocalAddress() {
|
public static InetAddress getLocalAddress() {
|
||||||
@ -258,7 +257,8 @@ public class NetUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param hostName
|
* getIpByHost
|
||||||
|
* @param hostName hostName
|
||||||
* @return ip address or hostName if UnknownHostException
|
* @return ip address or hostName if UnknownHostException
|
||||||
*/
|
*/
|
||||||
public static String getIpByHost(String hostName) {
|
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 {
|
public static boolean matchIpRange(String pattern, String host, int port) throws UnknownHostException {
|
||||||
if (pattern == null || host == null) {
|
if (pattern == null || host == null) {
|
||||||
throw new IllegalArgumentException("Illegal Argument pattern or hostName. Pattern:" + pattern + ", Host:" + host);
|
throw new IllegalArgumentException("Illegal Argument pattern or hostName. Pattern:" + pattern + ", Host:" + host);
|
||||||
|
@ -19,8 +19,8 @@ public interface SupplierPlus<T> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a result.
|
* Gets a result.
|
||||||
*
|
|
||||||
* @return a result
|
* @return a result
|
||||||
|
* @throws Exception allow to throw Exception
|
||||||
*/
|
*/
|
||||||
T get() throws Exception;
|
T get() throws Exception;
|
||||||
}
|
}
|
||||||
|
139
pom.xml
139
pom.xml
@ -7,6 +7,33 @@
|
|||||||
<groupId>com.github.kfcfans</groupId>
|
<groupId>com.github.kfcfans</groupId>
|
||||||
<artifactId>oh-my-scheduler</artifactId>
|
<artifactId>oh-my-scheduler</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0</version>
|
||||||
|
<packaging>pom</packaging>
|
||||||
|
<name>oh-my-scheduler</name>
|
||||||
|
<url>https://github.com/KFCFans/OhMyScheduler</url>
|
||||||
|
<description>Distributed scheduling and execution framework</description>
|
||||||
|
<licenses>
|
||||||
|
<license>
|
||||||
|
<name>Apache License, Version 2.0</name>
|
||||||
|
<url>http://www.apache.org/licenses/LICENSE-2.0</url>
|
||||||
|
<distribution>repo</distribution>
|
||||||
|
</license>
|
||||||
|
</licenses>
|
||||||
|
<scm>
|
||||||
|
<url>https://github.com/KFCFans/OhMyScheduler</url>
|
||||||
|
<connection>https://github.com/KFCFans/OhMyScheduler.git</connection>
|
||||||
|
</scm>
|
||||||
|
<developers>
|
||||||
|
<developer>
|
||||||
|
<name>tengjiqi</name>
|
||||||
|
<id>tengjiqi</id>
|
||||||
|
<email>tengjiqi@gmail.com</email>
|
||||||
|
<roles>
|
||||||
|
<role>Developer</role>
|
||||||
|
</roles>
|
||||||
|
<timezone>+8</timezone>
|
||||||
|
</developer>
|
||||||
|
</developers>
|
||||||
|
|
||||||
<modules>
|
<modules>
|
||||||
<module>oh-my-scheduler-worker</module>
|
<module>oh-my-scheduler-worker</module>
|
||||||
<module>oh-my-scheduler-server</module>
|
<module>oh-my-scheduler-server</module>
|
||||||
@ -14,7 +41,6 @@
|
|||||||
<module>oh-my-scheduler-client</module>
|
<module>oh-my-scheduler-client</module>
|
||||||
<module>oh-my-scheduler-worker-samples</module>
|
<module>oh-my-scheduler-worker-samples</module>
|
||||||
</modules>
|
</modules>
|
||||||
<packaging>pom</packaging>
|
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<java.version>1.8</java.version>
|
<java.version>1.8</java.version>
|
||||||
@ -22,6 +48,8 @@
|
|||||||
<maven.compiler.target>1.8</maven.compiler.target>
|
<maven.compiler.target>1.8</maven.compiler.target>
|
||||||
<maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
|
<maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
|
||||||
<maven-source-plugin.version>3.2.1</maven-source-plugin.version>
|
<maven-source-plugin.version>3.2.1</maven-source-plugin.version>
|
||||||
|
<maven-javadoc-plugin.version>3.2.0</maven-javadoc-plugin.version>
|
||||||
|
<maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||||
<lombok.version>1.18.12</lombok.version>
|
<lombok.version>1.18.12</lombok.version>
|
||||||
@ -37,34 +65,83 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<profiles>
|
||||||
<plugins>
|
<profile>
|
||||||
<!-- 编译插件 -->
|
<id>release</id>
|
||||||
<plugin>
|
<activation>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<activeByDefault>true</activeByDefault>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
</activation>
|
||||||
<version>${maven-compiler-plugin.version}</version>
|
|
||||||
<configuration>
|
<build>
|
||||||
<source>${java.version}</source>
|
<plugins>
|
||||||
<target>${java.version}</target>
|
<!-- 编译插件 -->
|
||||||
<testSource>${java.version}</testSource>
|
<plugin>
|
||||||
<testTarget>${java.version}</testTarget>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
</configuration>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
</plugin>
|
<version>${maven-compiler-plugin.version}</version>
|
||||||
<!-- 打包源码 -->
|
<configuration>
|
||||||
<plugin>
|
<source>${java.version}</source>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<target>${java.version}</target>
|
||||||
<artifactId>maven-source-plugin</artifactId>
|
<testSource>${java.version}</testSource>
|
||||||
<version>${maven-source-plugin.version}</version>
|
<testTarget>${java.version}</testTarget>
|
||||||
<executions>
|
</configuration>
|
||||||
<execution>
|
</plugin>
|
||||||
<id>attach-sources</id>
|
<!-- 打包源码 -->
|
||||||
<goals>
|
<plugin>
|
||||||
<goal>jar</goal>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
</goals>
|
<artifactId>maven-source-plugin</artifactId>
|
||||||
</execution>
|
<version>${maven-source-plugin.version}</version>
|
||||||
</executions>
|
<executions>
|
||||||
</plugin>
|
<execution>
|
||||||
</plugins>
|
<phase>package</phase>
|
||||||
</build>
|
<goals>
|
||||||
|
<goal>jar-no-fork</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
<!-- Java Doc -->
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-javadoc-plugin</artifactId>
|
||||||
|
<version>${maven-javadoc-plugin.version}</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>jar</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
<!-- GPG -->
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-gpg-plugin</artifactId>
|
||||||
|
<version>${maven-gpg-plugin.version}</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<phase>verify</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>sign</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
<distributionManagement>
|
||||||
|
<snapshotRepository>
|
||||||
|
<id>ossrh</id>
|
||||||
|
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
|
||||||
|
</snapshotRepository>
|
||||||
|
<repository>
|
||||||
|
<id>ossrh</id>
|
||||||
|
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
|
||||||
|
</repository>
|
||||||
|
</distributionManagement>
|
||||||
|
</profile>
|
||||||
|
</profiles>
|
||||||
|
|
||||||
</project>
|
</project>
|
Loading…
x
Reference in New Issue
Block a user