private static LiteJobConfiguration scriptConfiguration() { var jobCoreConfiguration = JobCoreConfiguration.newBuilder("scriptJob", "0/10 * * * * ?", 2).build(); /* * job.class 需要全包名 * streamingProcess 是否使用流式处理 */ var jobTypeConfiguration = new ScriptJobConfiguration( jobCoreConfiguration, Objects.requireNonNull(ClassLoader.getSystemResourceAsStream("scriptJob.sh")) .toString()); // overwrite() true - 启动的时候覆盖原有配置 return LiteJobConfiguration.newBuilder(jobTypeConfiguration).overwrite(true).build(); }
scriptJob.sh内容
echo This is a shell file, work information is $*
路径是 resources/scriptJob.sh
启动没有打印信息