I can't patch file with gradle. I try to use ant by always got an error:
Execution failed for task ':rbps-api:compileJava'.
> java.io.IOException: Cannot run program "patch" (in directory "C:\Users\IdeaProjects\cosmos\rbps-api"): CreateProcess error=2, The system cannot find the file specified
gradle debug:
11:31:46.535 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception.
11:31:46.536 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
11:31:46.536 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Where:
11:31:46.536 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Build file 'C:\Users\oleh.havryliv\IdeaProjects\cosmos\rbps-api\build.gradle' line: 56
11:31:46.536 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
11:31:46.536 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong:
11:31:46.537 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Execution failed for task ':rbps-api:assemble'.
11:31:46.537 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > java.io.IOException: Cannot run program "patch" (in directory "C:\Users\oleh.havryliv\IdeaProjects\cosmos\rbps-api"): CreateProcess error=2, The system cannot find the file specified
11:31:46.537 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
11:31:46.537 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Try:
11:31:46.538 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Run with --stacktrace option to get the stack trace. Run with --scan to get full insights.
11:31:46.538 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
11:31:46.538 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Get more help at https://help.gradle.org
11:31:46.538 [ERROR] [org.gradle.internal.buildevents.BuildResultLogger]
11:31:46.539 [ERROR] [org.gradle.internal.buildevents.BuildResultLogger] BUILD FAILED in 5s
gradle.xml
apply plugin: 'java'
compileJava.doLast {
ant.patch(patchfile: "$rootDir\\rbps-api\\ResourceBundle.patch" , originalFile: "$rootDir\\rbps-api\\src\\main\\java\\com\\medtronic\\diabetes\\carelink\\rbps\\api\\resource\\ResourceBundle.java")
}
Files exist on these paths. What could be wrong? Maybe exist another approach?
As Jeff Holt has already mentioned in the comments: the patch Ant task ”requires patch to be on the execution path” (cf. Ant docs).
Related
I was trying to build cordapp-template-java (Release M14.0) using ./gradlew clean deployNodes --debug and getting below error
09:35:30.533 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Completing Build operation 'Run tasks'
09:35:30.534 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationExecutor] Build operation 'Run tasks' completed
09:35:30.537 [DEBUG] [org.gradle.internal.work.DefaultWorkerLeaseService] Worker lease root.1 completed (0 worker(s) in use)
09:35:30.537 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Daemon worker Thread 2: released lock on root.1
09:35:30.538 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
09:35:30.538 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception.
09:35:30.538 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
09:35:30.538 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong:
09:35:30.538 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Execution failed for task ':deployNodes'.
09:35:30.539 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Error while generating node info file. Please check the logs in C:\Users\iyyam\CordaR3\cordapp-template-java\build\nodes\Notary\logs.
09:35:30.539 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
09:35:30.539 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Try:
09:35:30.539 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Run with --scan to get full insights.
09:35:30.539 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
09:35:30.539 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Exception is:
09:35:30.545 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':deployNodes'.
09:35:30.545 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$3.accept(ExecuteActionsTaskExecuter.java:166)
09:35:30.545 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$3.accept(ExecuteActionsTaskExecuter.java:163)
09:35:30.545 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:191)
....
09:35:30.559 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416)
09:35:30.559 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406)
09:35:30.559 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
09:35:30.559 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
09:35:30.559 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
09:35:30.559 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102)
09:35:30.559 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
09:35:30.559 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
09:35:30.560 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:43)
09:35:30.560 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:355)
09:35:30.560 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:343)
......
09:35:30.561 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
09:35:30.561 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
09:35:30.561 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Caused by: org.gradle.api.InvalidUserDataException: Error while generating node info file. Please check the logs in C:\Users\iyyam\CordaR3\cordapp-template-java\build\nodes\Notary\logs.
but log file does not have any error . H2 database setup is completed successfully in log . No error in log .
I am very much a newbie in programming. so i need help to troubleshoot this error. Please excuse.
16:52:44.590 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception.
16:52:44.590 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
16:52:44.590 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Where:
16:52:44.590 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Build file '/opt/eventuate-examples-restaurant-management/restaurants-service/build.gradle' line: 4
16:52:44.590 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
16:52:44.590 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong:
16:52:44.590 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] A problem occurred evaluating project ':restaurants-service'.
16:52:44.590 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Failed to apply plugin [class 'io.spring.gradle.dependencymanagement.DependencyManagementPlugin']
16:52:44.590 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Could not create task of type 'DependencyManagementReportTask'.
16:52:44.591 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
16:52:44.591 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Try:
16:52:44.591 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Run with --stacktrace option to get the stack trace.
16:52:44.591 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
16:52:44.591 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Get more help at https://help.gradle.org
16:52:44.591 [ERROR] [org.gradle.internal.buildevents.BuildResultLogger]
16:52:44.591 [ERROR] [org.gradle.internal.buildevents.BuildResultLogger] BUILD FAILED in 2s
gradle version
------------------------------------------------------------
Gradle 3.4.1
------------------------------------------------------------
Build time: 2012-12-21 00:00:00 UTC
Revision: none
Groovy: 2.4.15
Ant: Apache Ant(TM) version 1.10.3 compiled on July 19 2018
JVM: 10.0.2 (Oracle Corporation 10.0.2+13-Ubuntu-1ubuntu0.18.04.3)
OS: Linux 4.15.0-1021-aws amd64
It seems to be related to the Spring Boot plugin version you are using. See some issues that could be related to your problem: https://issues.gradle.org/browse/GRADLE-3482 and https://github.com/spring-gradle-plugins/dependency-management-plugin/issues/87.
So you should upgrade your plugin version, and (if possible) upgrade Gradle version to latest ( 4.10 )
Current version of the plugin is 2.1.0.RELEASE
plugins {
id 'org.springframework.boot' version '2.1.0.RELEASE'
}
I am trying to integrate allure-report with my junit code.
To try this, i was first trying to run the allure-junit example from https://github.com/allure-examples/allure-junit-example
When i run this code, i get the below error.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire- plugin:2.18:test (default-test) on project SampleAllureTest: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.18:test failed: There was an error in the forked process
[ERROR] java.lang.NoSuchMethodError: org.apache.commons.beanutils.ConvertUtilsBean.register(ZZI)V
[ERROR] at ru.yandex.qatools.properties.decorators.DefaultFieldDecorator.<init>(DefaultFieldDecorator.java:24)
[ERROR] at ru.yandex.qatools.properties.PropertyLoader.populate(PropertyLoader.java:29)
[ERROR] at ru.yandex.qatools.properties.PropertyLoader.populate(PropertyLoader.java:23)
[ERROR] at ru.yandex.qatools.allure.config.AllureConfig.<init>(AllureConfig.java:80)
[ERROR] at ru.yandex.qatools.allure.config.AllureConfig.newInstance(AllureConfig.java:84)
[ERROR] at ru.yandex.qatools.allure.Allure.getVersion(Allure.java:266)
[ERROR] at ru.yandex.qatools.allure.Allure.fire(Allure.java:187)
[ERROR] at ru.yandex.qatools.allure.junit.AllureRunListener.testSuiteFinished(AllureRunListener.java:89)
[ERROR] at ru.yandex.qatools.allure.junit.AllureRunListener.testRunFinished(AllureRunListener.java:95)
[ERROR] at org.junit.runner.notification.SynchronizedRunListener.testRunFinished(SynchronizedRunListener.java:42)
[ERROR] at org.junit.runner.notification.RunNotifier$2.notifyListener(RunNotifier.java:103)
[ERROR] at org.junit.runner.notification.RunNotifier$SafeNotifier.run(RunNotifier.java:72)
[ERROR] at org.junit.runner.notification.RunNotifier.fireTestRunFinished(RunNotifier.java:100)
[ERROR] at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:131)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
Could anyone please help me in fixing this issue.Please note, i didnt do any changes to the code in the sample.
You need to add commons-beanutils to your dependencies.
We recently upgraded our gradle to version 2.13 (the latest at the time of this writing). We are using the sonarqube plugin calling it via "gradlew clean test sonarqube". Before the upgrade, everything was working fine with Sonar.
After we upgraded to version 2.13, we get the following error "Incompatible version 1007" and it looks like an incompatibility with the gradle jacoco plugin. We are currently using version 2.0.1 of the sonarqube plugin and we also tried the sonarRunner plugin as well which fails with the same error. Has anybody else run into this and how did you resolve it?
plugins {
id "org.sonarqube" version "2.0.1"
}
4:06:55.845 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ':sonarqube'.
14:06:55.845 [ERROR] [org.gradle.BuildExceptionReporter] > Unable to read /var/lib/jenkins/jobs/Indicee-BI-API-Java-Library_platform_team/workspace/build/jacoco/test.exec
14:06:55.845 [ERROR] [org.gradle.BuildExceptionReporter]
14:06:55.846 [ERROR] [org.gradle.BuildExceptionReporter] * Exception is:
14:06:55.846 [ERROR] [org.gradle.BuildExceptionReporter] org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':sonarqube'.
14:06:55.852 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: java.io.IOException: Incompatible version 1007.
14:06:55.852 [ERROR] [org.gradle.BuildExceptionReporter] at org.jacoco.core.data.ExecutionDataReader.readHeader(ExecutionDataReader.java:127)
14:06:55.852 [ERROR] [org.gradle.BuildExceptionReporter] at org.jacoco.core.data.ExecutionDataReader.readBlock(ExecutionDataReader.java:107)
14:06:55.852 [ERROR] [org.gradle.BuildExceptionReporter] at org.jacoco.core.data.ExecutionDataReader.read(ExecutionDataReader.java:87)
14:06:55.853 [ERROR] [org.gradle.BuildExceptionReporter] at org.sonar.plugins.jacoco.JaCoCoOverallSensor.loadSourceFiles(JaCoCoOverallSensor.java:124)
14:06:55.853 [ERROR] [org.gradle.BuildExceptionReporter] ... 95 more
The Sonar plugin upgrade for Java to 3.13.1 worked. Thank you.
gradlew dist -xtest -xjavadoc -xsetupui
When dist from master, build succeeds.
When running from branch, it fails.I did push the branch to my remote, but I am not sure why the gradle task should know about remote branches. I could run successfully with -xpullDocs
Seems something to do with "wikiBranch" property.
FAILURE: Build failed with an exception.
10:34:14.670 [ERROR] [org.gradle.BuildExceptionReporter]
10:34:14.670 [ERROR] [org.gradle.BuildExceptionReporter] * Where:
10:34:14.670 [ERROR] [org.gradle.BuildExceptionReporter] Script '/Users/{$ID}/spring-xd/gradle/build-docs.gradle' line: 58
10:34:14.670 [ERROR] [org.gradle.BuildExceptionReporter]
10:34:14.670 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
10:34:14.671 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ':pullDocs'.
10:34:14.671 [ERROR] [org.gradle.BuildExceptionReporter] > Error while switching to branch: origin/jms-transport. Cause: Ref origin/{branch} can not be resolved
10:34:14.672 [ERROR] [org.gradle.BuildExceptionReporter]
10:34:14.673 [ERROR] [org.gradle.BuildExceptionReporter] * Exception is:
10:34:14.674 [ERROR] [org.gradle.BuildExceptionReporter] org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':pullDocs'.
10:34:14.674 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
10:34:14.674 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
10:34:14.674 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
10:34:14.674 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
10:34:14.674 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
10:34:14.674 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:42)
10:34:14.674 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
10:34:14.675 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
10:34:14.675 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
10:34:14.675 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.AbstractTask.executeWithoutThrowingTaskFailure(AbstractTask.java:289)
10:34:14.675 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.executeTask(AbstractTaskPlanExecutor.java:79)
10:34:14.675 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:63)
10:34:14.675 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:51)
Use -PwikiBranch=origin/master
At present, we maintain the documentation separately from the main sources. We found it initially helpful to use the GitHub wiki (with its editing capabilities) as the source for Spring XD's documentation. Github's wiki is a separate Git repo and cause some complexities.
With multiple active XD branches, we had to maintain multiple documentation branches as well.
Therefore, if you use a custom branch, you have to pass the -PwikiBranch parameter using Gradle, e.g.:
./gradlew dist -PwikiBranch=origin/master
For some more details, please also see:
https://github.com/spring-projects/spring-xd/blob/master/gradle/build-docs.gradle#L37