mirror of
https://gitee.com/dromara/Jpom.git
synced 2024-12-02 20:08:40 +08:00
调整参数位置
This commit is contained in:
parent
8c3626ff75
commit
2ae98df2e7
@ -4,10 +4,8 @@ import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.text.StrSpliter;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.keepbx.jpom.common.commander.AbstractProjectCommander;
|
||||
import cn.keepbx.jpom.model.RunMode;
|
||||
import cn.keepbx.jpom.model.data.ProjectInfoModel;
|
||||
import cn.keepbx.jpom.model.system.NetstatModel;
|
||||
import cn.keepbx.jpom.system.JpomRuntimeException;
|
||||
import cn.keepbx.util.CommandUtil;
|
||||
import cn.keepbx.util.JvmUtil;
|
||||
|
||||
@ -27,30 +25,15 @@ public class LinuxProjectCommander extends AbstractProjectCommander {
|
||||
if (StrUtil.isBlank(path)) {
|
||||
return null;
|
||||
}
|
||||
if (projectInfoModel.getRunMode() == RunMode.Jar) {
|
||||
// 拼接命令
|
||||
return String.format("nohup java %s %s -%s=%s -Jpom.basedir=%s %s %s >> %s 2>&1 &",
|
||||
projectInfoModel.getJvm(),
|
||||
path,
|
||||
JvmUtil.POM_PID_TAG,
|
||||
projectInfoModel.getId(),
|
||||
projectInfoModel.getAbsoluteLib(),
|
||||
projectInfoModel.getMainClass(),
|
||||
projectInfoModel.getArgs(),
|
||||
projectInfoModel.getAbsoluteLog());
|
||||
}
|
||||
if (projectInfoModel.getRunMode() == RunMode.ClassPath) {
|
||||
return String.format("nohup java %s %s %s -%s=%s -Jpom.basedir=%s %s >> %s 2>&1 &",
|
||||
projectInfoModel.getJvm(),
|
||||
path,
|
||||
projectInfoModel.getMainClass(),
|
||||
JvmUtil.POM_PID_TAG,
|
||||
projectInfoModel.getId(),
|
||||
projectInfoModel.getAbsoluteLib(),
|
||||
projectInfoModel.getArgs(),
|
||||
projectInfoModel.getAbsoluteLog());
|
||||
}
|
||||
throw new JpomRuntimeException("没有实现");
|
||||
return String.format("nohup java %s %s %s -%s=%s -Jpom.basedir=%s %s >> %s 2>&1 &",
|
||||
projectInfoModel.getJvm(),
|
||||
path,
|
||||
projectInfoModel.getMainClass(),
|
||||
JvmUtil.POM_PID_TAG,
|
||||
projectInfoModel.getId(),
|
||||
projectInfoModel.getAbsoluteLib(),
|
||||
projectInfoModel.getArgs(),
|
||||
projectInfoModel.getAbsoluteLog());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -4,10 +4,8 @@ import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.text.StrSpliter;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.keepbx.jpom.common.commander.AbstractProjectCommander;
|
||||
import cn.keepbx.jpom.model.RunMode;
|
||||
import cn.keepbx.jpom.model.data.ProjectInfoModel;
|
||||
import cn.keepbx.jpom.model.system.NetstatModel;
|
||||
import cn.keepbx.jpom.system.JpomRuntimeException;
|
||||
import cn.keepbx.util.CommandUtil;
|
||||
import cn.keepbx.util.JvmUtil;
|
||||
|
||||
@ -32,17 +30,9 @@ public class WindowsProjectCommander extends AbstractProjectCommander {
|
||||
String tag = projectInfoModel.getId();
|
||||
String mainClass = projectInfoModel.getMainClass();
|
||||
String args = projectInfoModel.getArgs();
|
||||
if (projectInfoModel.getRunMode() == RunMode.Jar) {
|
||||
return String.format("javaw %s %s -%s=%s -Jpom.basedir=%s %s %s >> %s &",
|
||||
jvm, classPath, JvmUtil.POM_PID_TAG, tag,
|
||||
projectInfoModel.getAbsoluteLib(), mainClass, args, projectInfoModel.getAbsoluteLog());
|
||||
}
|
||||
if (projectInfoModel.getRunMode() == RunMode.ClassPath) {
|
||||
return String.format("javaw %s %s %s -%s=%s -Jpom.basedir=%s %s >> %s &",
|
||||
jvm, classPath, mainClass, JvmUtil.POM_PID_TAG, tag,
|
||||
projectInfoModel.getAbsoluteLib(), args, projectInfoModel.getAbsoluteLog());
|
||||
}
|
||||
throw new JpomRuntimeException("没有实现");
|
||||
return String.format("javaw %s %s %s -%s=%s -Jpom.basedir=%s %s >> %s &",
|
||||
jvm, classPath, mainClass, JvmUtil.POM_PID_TAG, tag,
|
||||
projectInfoModel.getAbsoluteLib(), args, projectInfoModel.getAbsoluteLog());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user