Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compilation with plugin job-dsl-core:1.57 failing #57

Closed
rgaduput opened this issue Dec 11, 2017 · 16 comments
Closed

compilation with plugin job-dsl-core:1.57 failing #57

rgaduput opened this issue Dec 11, 2017 · 16 comments

Comments

@rgaduput
Copy link

Hi,
as we are still using job-dsl-core:1.57 plugin and all our dsl scripts are built according to this version.
While trying to build gradle-jenkins-jobdsl-plugin with this version it is failing with below.
Just changed version to 1.57 of job-dsl-core dependency in plugin/build.gradle file.
Something else also needs to be changed ? (i am bit new programming.)

_Configuration on demand is an incubating feature.

Task :plugin:compileGroovy FAILED
startup failed:
/tools/jenkins/heremaps/gradle-jenkins-jobdsl-plugin/plugin/src/main/groovy/com/here/gradle/plugins/jobdsl/RestJobManagement.groovy: 26: Can't have an abstract method in a non-abstract class. The class 'com.here.gradle.plugins.jobdsl.RestJobManagement' must be declared abstract or the method 'java.lang.String createOrUpdateConfigFile(javaposse.jobdsl.dsl.ConfigFile, boolean)' must be implemented.
@ line 26, column 1.
@SuppressWarnings('MethodCount') // High method count required because of super class.
^
/tools/jenkins/heremaps/gradle-jenkins-jobdsl-plugin/plugin/src/main/groovy/com/here/gradle/plugins/jobdsl/RestJobManagement.groovy: 26: Can't have an abstract method in a non-abstract class. The class 'com.here.gradle.plugins.jobdsl.RestJobManagement' must be declared abstract or the method 'java.lang.String getConfigFileId(javaposse.jobdsl.dsl.ConfigFileType, java.lang.String)' must be implemented.
@ line 26, column 1.
@SuppressWarnings('MethodCount') // High method count required because of super class.

  • Exception is:
    org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':plugin:compileGroovy'.
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100)
    at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70)
    at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
    at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62)
    at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
    at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:60)
    at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:97)
    at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:87)
    at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52)
    at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
    at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
    at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
    at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:248)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:241)
    at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:230)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:123)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:79)
    at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:104)_
@mnonnenmacher
Copy link
Contributor

Hi @rgaduput,

the problem here is that the interface of the JobManagement class has changed between these Job DSL versions. As a result, it is not possible to compile the plugin with an old Job DSL version like 1.57.

Did you try to compile your Job DSL scripts with the latest version? Usually it is not much effort to upgrade your scripts.

@rgaduput
Copy link
Author

Hi @mnonnenmacher ,
Ok.
Yes i tried compiling my DSL scripts with latest version and failing with below, i thought it is something related to changes between 1.57 and latest version.
But it seems like Jenkins ansible plugin dependency is missing in the plugin (Faced same issues while running DSL script from seed job without having Jenkins ansible plugin installed on my local jenkins)
Is there a way to verify it somehow ?

Exception in thread "main" javaposse.jobdsl.dsl.DslScriptException: (RMRTUtilities.groovy, line 2410) No signature of method: javaposse.jobdsl.dsl.helpers.step.StepContext.ansiblePlaybook() is applicable for argument types: (java.lang.String, com.amdocs.rm.ci.lib.rt.RMRTUtilities$_refUpgradeDBPatch_closure41$_closure258$_closure262) values: [/tccc/adjcc9/PCI_TOOLS/Scripts/ACD/pre_tasks/pre_installation.yaml, ...]

@mnonnenmacher
Copy link
Contributor

Support for this plugin is not part of job-dsl-core, but the plugin provides an extension [1]. This is not yet supported by this Gradle plugin, but something I am working on [2]. Unfortunately I cannot give an estimate on how long the implementation will take. Until then you can always use a configure block [3] to configure the plugin. Of course this is not as convenient as using the extension, but it works pretty well.

Another option is that you could take the extension module code from the ansible plugin [4] and adapt it to a normal Groovy extension module [5] for the StepContext class. This is more work than using the configure block, but results in nicer DSL.

[1] https://github.com/jenkinsci/job-dsl-plugin/wiki/Extending-the-DSL
[2] #12
[3] https://github.com/jenkinsci/job-dsl-plugin/wiki/The-Configure-Block
[4] https://github.com/jcsirot/ansible-plugin/tree/master/src/main/java/org/jenkinsci/plugins/ansible/jobdsl
[5] http://mrhaki.blogspot.de/2013/01/groovy-goodness-adding-extra-methods.html

@rgaduput
Copy link
Author

rgaduput commented Dec 13, 2017

Ok @mnonnenmacher , thanks for the suggestion.
But we are using many other plugins also which are Auto Generated DSL + Extensions .
Can you share your ideas about how are you thinking to implement this in this plugin. So we will check if we can have some quick solution to support this until it is implemented in this plugin(Or will check if we can contribute to it).

@mnonnenmacher
Copy link
Contributor

I don't know any quick solution, but I am testing now an approach that could fix this issue. I will let you know how it turned out later.

@rgaduput
Copy link
Author

rgaduput commented Dec 15, 2017

Thanks 👍 , waiting for it

@mnonnenmacher
Copy link
Contributor

Hi @rgaduput, I managed to implement a proof of concept, but it will take some time to make a proper implementation. If everything turns out well, I hope I can make a new release next week.

@rgaduput
Copy link
Author

Thanks @mnonnenmacher , that's great news. Good luck with :)

@mnonnenmacher
Copy link
Contributor

Hi @rgaduput, I have published a snapshot version 3.0.0-SNAPSHOT of the plugin. If you want to give it a try, check the example in the autogenerated-dsl-support branch. It is still work in progress, but mostly works, so you could check if your Job DSL scripts can be processed now. However, I expect that I won't be able to finish the implementation before January.

@rgaduput
Copy link
Author

Hi @mnonnenmacher , this will be really helpful thanks a lot :)
While testing my code it is failing with below, but i am not able figure out what it is exactly failing with (FYI i am testing the same code which passed successfully with 2.1.1 plugin, of course without extended and auto generated code just to check if everything is fine) .
Below is the debug log, can you assist if you are familiar with this ?
Earlier it was failing as below dependency not available in repo so i added it to exclude list.
Could not find org-netbeans-insane.jar (org.netbeans.modules:org-netbeans-insane:RELEASE72).

16:26:51.486 [ERROR] [system.err] 0.054 [id=13] INFO o.jvnet.hudson.test.WarExploder#explode: Exploding /jphome/jp/ccjp/mb_ccjp/.gradle/caches/modules-2/files-2.1/org.jenkins-ci.main/jenkins-war/2.92/131801e769febccd38d5128f587c4ac446ac596/jenkins-war-2.92.war into /jphome/jp/ccjp/mb_ccjp/workspace/Test_DSL_Scripts/build/jenkins-for-test
16:26:51.782 [DEBUG] [org.gradle.process.internal.health.memory.MemoryManager] Emitting JVM memory status event {Maximum: 8867807232, Committed: 599261184}
16:26:52.712 [ERROR] [system.err] 1.281 [id=13] INFO o.jvnet.hudson.test.JenkinsRule#createWebServer: Running on http://localhost:51641/jenkins/
16:26:53.058 [ERROR] [system.err] 1.628 [id=20] INFO jenkins.InitReactorRunner$1#onAttained: Started initialization
16:26:53.216 [ERROR] [system.err] 1.785 [id=38] WARNING hudson.ClassicPluginStrategy#createClassJarFromWebInfClasses: Created /tmp/jenkins5164201396774763297tmp/timestamper-1.5.1/WEB-INF/lib/classes.jar; update plugin to a version created with a newer harness
16:26:53.579 [ERROR] [system.err] 2.148 [id=22] WARNING hudson.ClassicPluginStrategy#createClassJarFromWebInfClasses: Created /tmp/jenkins5164201396774763297tmp/job-dsl-1.66/WEB-INF/lib/classes.jar; update plugin to a version created with a newer harness
16:26:53.625 [ERROR] [system.err] 2.194 [id=38] WARNING hudson.ClassicPluginStrategy#createClassJarFromWebInfClasses: Created /tmp/jenkins5164201396774763297tmp/token-macro-1.5.1/WEB-INF/lib/classes.jar; update plugin to a version created with a newer harness
16:26:53.677 [ERROR] [system.err] 2.247 [id=24] INFO jenkins.InitReactorRunner$1#onAttained: Listed all plugins
16:26:55.454 [ERROR] [system.err] 4.024 [id=22] INFO jenkins.InitReactorRunner$1#onAttained: Prepared all plugins
16:26:56.651 [ERROR] [system.err] 5.220 [id=34] WARNING hudson.ExtensionComponent#compareTo
16:26:56.651 [ERROR] [system.err] java.lang.NoSuchMethodError: hudson.slaves.Messages.CommandLauncher_displayName()Ljava/lang/String;
16:26:56.651 [ERROR] [system.err] at hudson.slaves.CommandLauncher$DescriptorImpl.getDisplayName(CommandLauncher.java:176)
16:26:56.651 [ERROR] [system.err] at hudson.ExtensionComponent.compareTo(ExtensionComponent.java:97)
16:26:56.651 [ERROR] [system.err] at hudson.ExtensionComponent.compareTo(ExtensionComponent.java:42)
16:26:56.651 [ERROR] [system.err] at java.util.ComparableTimSort.binarySort(ComparableTimSort.java:262)
16:26:56.651 [ERROR] [system.err] at java.util.ComparableTimSort.sort(ComparableTimSort.java:207)
16:26:56.651 [ERROR] [system.err] at java.util.Arrays.sort(Arrays.java:1312)
16:26:56.651 [ERROR] [system.err] at java.util.Arrays.sort(Arrays.java:1506)
16:26:56.651 [ERROR] [system.err] at java.util.ArrayList.sort(ArrayList.java:1454)
16:26:56.651 [ERROR] [system.err] at java.util.Collections.sort(Collections.java:141)
16:26:56.651 [ERROR] [system.err] at hudson.ExtensionList.sort(ExtensionList.java:386)
16:26:56.652 [ERROR] [system.err] at hudson.ExtensionList.ensureLoaded(ExtensionList.java:306)
16:26:56.652 [ERROR] [system.err] at hudson.ExtensionList.iterator(ExtensionList.java:158)
16:26:56.652 [ERROR] [system.err] at jenkins.model.Jenkins.getDescriptorByType(Jenkins.java:1521)
16:26:56.652 [ERROR] [system.err] at hudson.plugins.copyartifact.BuildSelectorParameter.initAliases(BuildSelectorParameter.java:156)
16:26:56.652 [ERROR] [system.err] at hudson.plugins.copyartifact.CopyArtifactPlugin.postInitialize(CopyArtifactPlugin.java:35)
16:26:56.652 [ERROR] [system.err] at hudson.PluginManager$2$1$2.run(PluginManager.java:539)
16:26:56.652 [ERROR] [system.err] at org.jvnet.hudson.reactor.TaskGraphBuilder$TaskImpl.run(TaskGraphBuilder.java:169)
16:26:56.652 [ERROR] [system.err] at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:282)
16:26:56.652 [ERROR] [system.err] at jenkins.model.Jenkins$5.runTask(Jenkins.java:1065)
16:26:56.652 [ERROR] [system.err] at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:210)
16:26:56.652 [ERROR] [system.err] at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
16:26:56.652 [ERROR] [system.err] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
16:26:56.652 [ERROR] [system.err] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
16:26:56.652 [ERROR] [system.err] at java.lang.Thread.run(Thread.java:745)
16:26:56.652 [ERROR] [system.err] 5.220 [id=34] WARNING hudson.ExtensionComponent#compareTo
16:26:56.652 [ERROR] [system.err] java.lang.NoSuchMethodError: hudson.slaves.Messages.CommandLauncher_displayName()Ljava/lang/String;
16:26:56.652 [ERROR] [system.err] at hudson.slaves.CommandLauncher$DescriptorImpl.getDisplayName(CommandLauncher.java:176)
16:26:56.652 [ERROR] [system.err] at hudson.ExtensionComponent.compareTo(ExtensionComponent.java:97)
16:26:56.652 [ERROR] [system.err] at hudson.ExtensionComponent.compareTo(ExtensionComponent.java:42)
16:26:56.652 [ERROR] [system.err] at java.util.ComparableTimSort.binarySort(ComparableTimSort.java:262)
16:26:56.652 [ERROR] [system.err] at java.util.ComparableTimSort.sort(ComparableTimSort.java:207)
16:26:56.652 [ERROR] [system.err] at java.util.Arrays.sort(Arrays.java:1312)
16:26:56.652 [ERROR] [system.err] at java.util.Arrays.sort(Arrays.java:1506)
16:26:56.652 [ERROR] [system.err] at java.util.ArrayList.sort(ArrayList.java:1454)
16:26:56.652 [ERROR] [system.err] at java.util.Collections.sort(Collections.java:141)
16:26:56.652 [ERROR] [system.err] at hudson.ExtensionList.sort(ExtensionList.java:386)
16:26:56.652 [ERROR] [system.err] at hudson.ExtensionList.ensureLoaded(ExtensionList.java:306)
16:26:56.652 [ERROR] [system.err] at hudson.ExtensionList.iterator(ExtensionList.java:158)
16:26:56.652 [ERROR] [system.err] at jenkins.model.Jenkins.getDescriptorByType(Jenkins.java:1521)
16:26:56.652 [ERROR] [system.err] at hudson.plugins.copyartifact.BuildSelectorParameter.initAliases(BuildSelectorParameter.java:156)
16:26:56.652 [ERROR] [system.err] at hudson.plugins.copyartifact.CopyArtifactPlugin.postInitialize(CopyArtifactPlugin.java:35)
16:26:56.652 [ERROR] [system.err] at hudson.PluginManager$2$1$2.run(PluginManager.java:539)
16:26:56.652 [ERROR] [system.err] at org.jvnet.hudson.reactor.TaskGraphBuilder$TaskImpl.run(TaskGraphBuilder.java:169)
16:26:56.652 [ERROR] [system.err] at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:282)
16:26:56.652 [ERROR] [system.err] at jenkins.model.Jenkins$5.runTask(Jenkins.java:1065)
16:26:56.652 [ERROR] [system.err] at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:210)
16:26:56.652 [ERROR] [system.err] at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
16:26:56.652 [ERROR] [system.err] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
16:26:56.652 [ERROR] [system.err] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
16:26:56.652 [ERROR] [system.err] at java.lang.Thread.run(Thread.java:745)
16:26:56.652 [ERROR] [system.err] 5.221 [id=34] WARNING hudson.ExtensionComponent#compareTo
16:26:56.652 [ERROR] [system.err] java.lang.NoSuchMethodError: hudson.slaves.Messages.CommandLauncher_displayName()Ljava/lang/String;
16:26:58.149 [ERROR] [system.err] 6.718 [id=13] INFO j.j.plugin.JenkinsJobManagement#createOrUpdateConfig: createOrUpdateConfig for ACD_mainline_REF_Dump_Generate_Property_File
16:26:58.200 [ERROR] [system.err] 6.769 [id=13] INFO j.j.plugin.JenkinsJobManagement#createOrUpdateConfig: createOrUpdateConfig for ACD_mainline_REF_Dump_Unpack_Tiger_Repository
16:26:58.213 [ERROR] [system.err] 6.782 [id=13] INFO j.j.plugin.JenkinsJobManagement#createOrUpdateConfig: createOrUpdateConfig for ACD_mainline_REF_Dump_Upgrade_DB_Patch
16:26:58.233 [ERROR] [system.err] 6.802 [id=13] INFO j.j.plugin.JenkinsJobManagement#createOrUpdateConfig: createOrUpdateConfig for ACD_mainline_REF_Dump_Yum_Repo_Configuration
16:26:58.248 [ERROR] [system.err] 6.817 [id=13] INFO j.j.plugin.JenkinsJobManagement#createOrUpdateConfig: createOrUpdateConfig for ACD_mainline_REF_Dump_Prepare_ACD_Installer
16:26:58.270 [ERROR] [system.err] 6.839 [id=13] INFO j.j.plugin.JenkinsJobManagement#createOrUpdateConfig: createOrUpdateConfig for ACD_mainline_REF_Dump_Consul_Server_Configuration
16:26:58.280 [ERROR] [system.err] 6.849 [id=13] INFO j.j.plugin.JenkinsJobManagement#createOrUpdateConfig: createOrUpdateConfig for ACD_mainline_REF_Dump_Install_Ref_Env
16:26:58.291 [ERROR] [system.err] 6.860 [id=13] INFO j.j.plugin.JenkinsJobManagement#createOrUpdateConfig: createOrUpdateConfig for ACD_mainline_REF_Dump_Create_Ref_Dump
16:26:58.302 [ERROR] [system.err] 6.871 [id=13] INFO j.j.plugin.JenkinsJobManagement#createOrUpdateConfig: createOrUpdateConfig for ACD_mainline_REF_Dump_Copy_dump_to_NAS
16:26:58.312 [ERROR] [system.err] 6.881 [id=13] INFO j.j.plugin.JenkinsJobManagement#createOrUpdateConfig: createOrUpdateConfig for ACD_mainline_REF_Dump_Create_Dummy
16:26:58.320 [ERROR] [system.err] 6.889 [id=13] INFO j.j.plugin.JenkinsJobManagement#createOrUpdateConfig: createOrUpdateConfig for ACD_mainline_REF_Dump_Flow
16:26:58.351 [ERROR] [system.err] 6.920 [id=13] INFO jenkins.model.Jenkins#cleanUp: Stopping Jenkins
16:26:58.369 [QUIET] [system.out] WARN: The method class org.apache.commons.logging.impl.SLF4JLogFactory#release() was invoked.
16:26:58.369 [QUIET] [system.out] WARN: Please see http://www.slf4j.org/codes.html#release for an explanation.
16:26:58.369 [ERROR] [system.err] 6.938 [id=13] INFO jenkins.model.Jenkins#cleanUp: Jenkins stopped
16:26:59.052 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Exception is:
16:26:59.052 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':dslGenerateXml'.
16:26:59.052 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100)
16:26:59.052 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70)
16:26:59.052 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
16:26:59.052 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62)
16:26:59.052 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
16:26:59.052 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:60)
16:26:59.052 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:97)
16:26:59.052 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:87)
16:26:59.052 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52)
16:26:59.052 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
16:26:59.052 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
16:26:59.052 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)

@rgaduput
Copy link
Author

rgaduput commented Dec 26, 2017

Hi @mnonnenmacher ,
With this new version of plugin, it seems nearly impossible to find what causing issues to fail the dslGenerateXml task :( (even in debug mode with full stack trace on).
Below is the simple dsl script with syntax issue, i tried to test.

freeStyleJob('Sample_Job'){
steps {
shell('''#!/bin/ksh
echo "hello, this is test"
''')
}
}
}

Below is the exception,
Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':dslGenerateXml'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70)
at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62)
at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:60)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:97)
at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:87)
at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:248)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:241)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:230)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:123)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:79)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:104)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:98)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:626)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:581)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:98)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.gradle.process.internal.ExecException: Process 'command '/usr/java/jdk1.8.0_102/bin/java'' finished with non-zero exit value 1
at org.gradle.process.internal.DefaultExecHandle$ExecResultImpl.assertNormalExitValue(DefaultExecHandle.java:382)
at org.gradle.process.internal.DefaultJavaExecAction.execute(DefaultJavaExecAction.java:31)
at org.gradle.api.tasks.JavaExec.exec(JavaExec.java:74)
at com.here.gradle.plugins.jobdsl.tasks.AbstractDslTask.super$5$exec(AbstractDslTask.groovy)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1213)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:132)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:152)
at com.here.gradle.plugins.jobdsl.tasks.AbstractDslTask.exec(AbstractDslTask.groovy:62)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:46)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:784)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:751)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:121)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:110)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:92)
... 32 more

But with the older version of plugin logging is really good.
Tried same DSL with version 2.1.1 and below is the exception.
Exception in thread "main" javaposse.jobdsl.dsl.DslException: startup failed:
script: 8: unexpected token: } @ line 8, column 1.
}

@mnonnenmacher
Copy link
Contributor

Thanks for the feedback @rgaduput, I have tested your script with the current master and made sure that it prints the same error message as the old version. I hope that I can release the new version with generated DSL support next week.

@rgaduput
Copy link
Author

rgaduput commented Jan 6, 2018

That's cool @mnonnenmacher , thanks a lot . waiting for new release.
Do we have any SNAPSHOT version with this fix, which i can use and test my real code?

@mnonnenmacher
Copy link
Contributor

No, I didn't publish a snapshot, but you can easily build your own by running ./gradlew plugin:publishToMavenLocal.

@mnonnenmacher
Copy link
Contributor

Hi @rgaduput , I have released version 3.0.0, could you give it a try and check if it works for you? The readme and example project have also been updated.

@rgaduput
Copy link
Author

Thanks a lot @mnonnenmacher , It is working fine now for Auto generated and extension Jenkins plugins, also print exact errors like before :) 👍 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants