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 > 磁盘
|
||||
* 磁盘必须有1G以上的剩余空间
|
||||
* 计算得分情况,内存 then CPU then 磁盘(磁盘必须有1G以上的剩余空间)
|
||||
* @return 得分情况
|
||||
*/
|
||||
public int calculateScore() {
|
||||
|
||||
|
@ -20,6 +20,7 @@ public class CommonUtils {
|
||||
* @param executor 需要执行的方法
|
||||
* @param retryTimes 重试的次数
|
||||
* @param intervalMS 失败后下一次执行的间隔时间
|
||||
* @param <T> 执行函数返回值类型
|
||||
* @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<String> collection) {
|
||||
if (collection == null || collection.isEmpty()) {
|
||||
|
@ -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);
|
||||
|
@ -19,8 +19,8 @@ public interface SupplierPlus<T> {
|
||||
|
||||
/**
|
||||
* Gets a result.
|
||||
*
|
||||
* @return a result
|
||||
* @throws Exception allow to throw Exception
|
||||
*/
|
||||
T get() throws Exception;
|
||||
}
|
||||
|
139
pom.xml
139
pom.xml
@ -7,6 +7,33 @@
|
||||
<groupId>com.github.kfcfans</groupId>
|
||||
<artifactId>oh-my-scheduler</artifactId>
|
||||
<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>
|
||||
<module>oh-my-scheduler-worker</module>
|
||||
<module>oh-my-scheduler-server</module>
|
||||
@ -14,7 +41,6 @@
|
||||
<module>oh-my-scheduler-client</module>
|
||||
<module>oh-my-scheduler-worker-samples</module>
|
||||
</modules>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<properties>
|
||||
<java.version>1.8</java.version>
|
||||
@ -22,6 +48,8 @@
|
||||
<maven.compiler.target>1.8</maven.compiler.target>
|
||||
<maven-compiler-plugin.version>3.8.1</maven-compiler-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.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<lombok.version>1.18.12</lombok.version>
|
||||
@ -37,34 +65,83 @@
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<!-- 编译插件 -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>${maven-compiler-plugin.version}</version>
|
||||
<configuration>
|
||||
<source>${java.version}</source>
|
||||
<target>${java.version}</target>
|
||||
<testSource>${java.version}</testSource>
|
||||
<testTarget>${java.version}</testTarget>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<!-- 打包源码 -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-source-plugin</artifactId>
|
||||
<version>${maven-source-plugin.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-sources</id>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>release</id>
|
||||
<activation>
|
||||
<activeByDefault>true</activeByDefault>
|
||||
</activation>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<!-- 编译插件 -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>${maven-compiler-plugin.version}</version>
|
||||
<configuration>
|
||||
<source>${java.version}</source>
|
||||
<target>${java.version}</target>
|
||||
<testSource>${java.version}</testSource>
|
||||
<testTarget>${java.version}</testTarget>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<!-- 打包源码 -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-source-plugin</artifactId>
|
||||
<version>${maven-source-plugin.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<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>
|
Loading…
x
Reference in New Issue
Block a user