gradle远程调试过程

时间:2016-06-08 12:08:31

标签: java gradle build remote-debugging

我将public class ToyGenInput{ public static void main(String[] args){ SBML2SPA ss=new SBML2SPA("./models/toy/toy.xml"); ss.printODEs("./models/toy/"); ss.printPar("./models/toy/"); ss.printVar("./models/toy/"); } } 添加到系统环境变量中:

// first save the everything in a variable for later
// if the element with a given id doen't exist the "|| false" will turn it into a boolean false
var employeeID = document.getElementById("employeeID") || false;
var lblEmp = document.getElementById("lblEmp") || false;
var grossSalary = document.getElementById("grossSalary") || false;
var lblGrossSalary = document.getElementById("lblGrossSalary") || false;


// before accessing the .value check if its not false
if (employeeID && employeeID.value == "") {
    lblEmp.textContent = "Employee Name is required";
    ret = false;
}
else {
    lblEmp.textContent = "";
     }
if (grossSalary && grossSalary.value == "") {
    lblGrossSalary.textContent = "Gross Salary is required";
    ret = false;
}
else {
    lblGrossSalary.textContent = "";
}

我已经从InteliJ IDEA为这个套接字创建了远程调试器。我可以调试GRADLE_OPTS文件,但我无法进入脚本,例如无法查看变量值。

1 个答案:

答案 0 :(得分:7)

以下是远程调试gradle的步骤:

分步指南
1.运行Gradle命令
2.在命令行上,正常执行任务,但添加以下附加参数:

-Dorg.gradle.jvmargs='-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=5005,suspend=y'

suspend=y”部分将暂停执行以附加调试器。

附加调试器:

  1. 在IntelliJ中打开Gradle源代码
  2. 转到“运行” - >编辑配置
  3. 点击左上角的+
  4. 添加新配置
  5. 选择“远程”,如果选择则重命名,然后单击“确定”
  6. 设置断点
  7. 转到“运行” - >调试“”(默认为“未命名”)