如何执行独立的javaexec任务

时间:2019-01-22 09:01:32

标签: java gradle build.gradle javaexec-gradle-plugin

我有一个名为'FunctionalityMaintainer'的gradle项目,我试图在build.gradle中独立执行两个JavaExec任务。 以下是我的build.gradle

的结构
task(findPattern, dependsOn:'classes', type:JavaExec){
main = 'org.package.somepackage1.PatternMatcher'
classpath = sourceSets.main.runtimeClasspath
args = [project.getProperty('baseDir'), project.getProperty('playGroundWorkspace')]
}

task(deleteZip, dependsOn:'classes', type:JavaExec){
main = 'org.package.somepackage2.ZipDeleter'
classpath = sourceSets.main.runtimeClasspath
args = [project.getProperty('zipPath')]
}

如果执行以下命令,则说出deleteZip任务-

gradle deleteZip -PzipPath='D:/PathtoZip'

失败并显示错误

could not get unknown property 'baseDir' for root project 'FunctionalityMaintainer' of type org.gradle.api.Project. 

有人可以告诉我我在做什么错吗?

0 个答案:

没有答案