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

Upgrade Job-DSL dependency to 1.42 #68

Merged
merged 1 commit into from
Feb 21, 2016

Conversation

mnonnenmacher
Copy link
Contributor

Replace job with freeStyleJob and view with listView in most tests.

Remove tests that check for an exception to be thrown when no job name is
provided, since the new Job DSL syntax requires the job name as a
parameter. Also the name method does not exist in Job DSL anymore, so
replace usages with calls to the setter method for name.

javaposse.jobdsl.dsl.JobType was removed, so instead use the simlar class
com.terrafolio.gradle.plugins.jenkins.jobdsl.DSLJobType.

Replace job with freeStyleJob and view with listView in most tests.

Remove tests that check for an exception to be thrown when no job name is
provided, since the new Job DSL syntax requires the job name as a
parameter. Also the name method does not exist in Job DSL anymore, so
replace usages with calls to the setter method for name.

javaposse.jobdsl.dsl.JobType was removed, so instead use the simlar class
com.terrafolio.gradle.plugins.jenkins.jobdsl.DSLJobType.

Also add a direct dependency to Guava because it was removed from Job DSL.
@mnonnenmacher mnonnenmacher changed the title Upgrade Job-DSL dependency to 1.41 Upgrade Job-DSL dependency to 1.42 Jan 6, 2016
@realdadfish
Copy link
Contributor

+1 - waiting for a new release :)

@realdadfish
Copy link
Contributor

Hrm... a manual build of @mnonnenmacher's PR leads to the following exception for me:

org.gradle.api.GradleScriptException: A problem occurred evaluating root project 'project'.
    at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:93)
    at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl$1.run(DefaultScriptPluginFactory.java:148)
    at org.gradle.configuration.ProjectScriptTarget.addConfiguration(ProjectScriptTarget.java:72)
    at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:153)
    at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:38)
    at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:25)
    at org.gradle.configuration.project.ConfigureActionsProjectEvaluator.evaluate(ConfigureActionsProjectEvaluator.java:34)
    at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:55)
    at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:499)
    at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:86)
    at org.gradle.execution.TaskPathProjectEvaluator.configure(TaskPathProjectEvaluator.java:35)
    at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:33)
    at org.gradle.initialization.DefaultGradleLauncher$2.run(DefaultGradleLauncher.java:125)
    at org.gradle.internal.Factories$1.create(Factories.java:22)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:52)
    at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:122)
    at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:32)
    at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:99)
    at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:93)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:62)
    at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:93)
    at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:82)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:94)
    at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
    at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:43)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:28)
    at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:77)
    at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:47)
    at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:52)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
    at org.gradle.util.Swapper.swap(Swapper.java:38)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.health.DaemonHealthTracker.execute(DaemonHealthTracker.java:47)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:66)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:71)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.health.HintGCAfterBuild.execute(HintGCAfterBuild.java:41)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
    at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
    at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:246)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
    at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
Caused by: java.lang.NoClassDefFoundError: javaposse/jobdsl/dsl/AbstractJobManagement
    at com.terrafolio.gradle.plugins.jenkins.JenkinsPlugin.class$(JenkinsPlugin.groovy)
    at com.terrafolio.gradle.plugins.jenkins.JenkinsPlugin.$get$$class$com$terrafolio$gradle$plugins$jenkins$jobdsl$MapJobManagement(JenkinsPlugin.groovy)
    at com.terrafolio.gradle.plugins.jenkins.JenkinsPlugin.applyConventions(JenkinsPlugin.groovy:51)
    at com.terrafolio.gradle.plugins.jenkins.JenkinsPlugin$applyConventions$0.callCurrent(Unknown Source)
    at com.terrafolio.gradle.plugins.jenkins.JenkinsPlugin.apply(JenkinsPlugin.groovy:17)
    at com.terrafolio.gradle.plugins.jenkins.JenkinsPlugin.apply(JenkinsPlugin.groovy)
    at org.gradle.api.internal.plugins.ImperativeOnlyPluginApplicator.applyImperative(ImperativeOnlyPluginApplicator.java:35)
    at org.gradle.api.internal.plugins.RuleBasedPluginApplicator.applyImperative(RuleBasedPluginApplicator.java:44)
    at org.gradle.api.internal.plugins.DefaultPluginManager.doApply(DefaultPluginManager.java:144)
    at org.gradle.api.internal.plugins.DefaultPluginManager.apply(DefaultPluginManager.java:112)
    at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.applyType(DefaultObjectConfigurationAction.java:112)
    at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.access$200(DefaultObjectConfigurationAction.java:35)
    at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction$3.run(DefaultObjectConfigurationAction.java:79)
    at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.execute(DefaultObjectConfigurationAction.java:135)
    at org.gradle.api.internal.project.AbstractPluginAware.apply(AbstractPluginAware.java:46)
    at org.gradle.api.plugins.PluginAware$apply.call(Unknown Source)
    at org.gradle.api.internal.project.ProjectScript.apply(ProjectScript.groovy:34)
    at org.gradle.api.Script$apply$0.callCurrent(Unknown Source)
    at build_7xpt8m36ezzxm5s7hriof7gxk.run(/my/project/build.gradle:72)
    at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:91)
    ... 58 more
Caused by: java.lang.ClassNotFoundException: javaposse.jobdsl.dsl.AbstractJobManagement
    ... 78 more

and that happens right at the time the plugin is applied via apply plugin: .... I'm on Java 8 here, might this be an issue? The plain 1.3.1 works (almost) flawlessly.

@mnonnenmacher
Copy link
Contributor Author

@tommyd3mdi, I had similar issues before cleaning the project, but after a "gradlew clean" it did work. Did you try this already?

@foeser
Copy link

foeser commented Feb 8, 2016

Thanks for your effort! ;-)

@oliverbestmann
Copy link

@ghale Could you please merge this and release a new version?

@sschuberth
Copy link
Contributor

@ghale I'm also waiting for a new release with this merged :-)

@ghale
Copy link
Owner

ghale commented Feb 18, 2016

Sorry for the lack of movement on this. I've just been struggling to find the time to work on my side projects. I promise I will try to find some time to merge this and cut a new release in the next few days. Thanks for being (overly) patient.

@lkishalmi
Copy link

Waiting for this as well.

@ghale ghale merged commit 534b751 into ghale:master Feb 21, 2016
@ghale
Copy link
Owner

ghale commented Feb 21, 2016

Thanks for the contribution! This is in v1.3.2.

@oliverbestmann
Copy link

Thats great, but now i get an error:

A problem occurred configuring root project 'iwg-deployment'.
> Could not resolve all dependencies for configuration ':classpath'.
   > Could not find org.jenkins-ci.plugins:job-dsl-core:1.42.
     Searched in the following locations:
         https://plugins.gradle.org/m2/org/jenkins-ci/plugins/job-dsl-core/1.42/job-dsl-core-1.42.pom
         https://plugins.gradle.org/m2/org/jenkins-ci/plugins/job-dsl-core/1.42/job-dsl-core-1.42.jar
     Required by:
         :iwg-deployment:unspecified > com.terrafolio:gradle-jenkins-plugin:1.3.2

I am just using

plugins {
    id "com.terrafolio.jenkins" version "1.3.2"
}

@theqaguy
Copy link

@oliverbestmann
I had to add http://repo.jenkins-ci.org/releases/ as a repository as org.jenkins-ci.plugins:job-dsl-core:1.42 isn't available on plugins.gradle.org

@ghale Thanks for the new version!

@mpettigr
Copy link

mpettigr commented Apr 2, 2016

Here's my build.gradle buildscript to add the missing dependencies mentioned by oliverbestmann
`
buildscript {
repositories {
maven {
url "http://repo.jenkins-ci.org/releases/"
}
}
}

plugins {
id "com.terrafolio.jenkins" version "1.3.2"
}
`

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

Successfully merging this pull request may close these issues.

9 participants