我正在尝试将一个参数从命令行传递给一个java类。我关注了这篇文章:,但代码不适合我(也许它不是为JavaExec设计的?)这是我尝试过的:
task listTests(type:JavaExec){
main = "util.TestGroupScanner"
classpath = sourceSets.util.runtimeClasspath
// this works...
args 'demo'
/*
// this does not work!
if (project.hasProperty
我正在试图找到从命令行传递gradle任务参数的最佳方法。我有这个任务。我想打开解决方案从学生的练习,并复制到正确的地方,在项目中,以逃避他们。我称之为这样的任务:
> gradle swapSolution -Pstudent=MyStudent -Pexercise=ex05
在启用Gradle插件的同时,在IntelliJ中执行此操作时,我遇到的一个问题是,在构建项目时,我会收到此错误消息。有什么办法可以解决这个问题?
A problem occurred evaluating root project 'kprog-2020-ws'.
> Could not