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

Unable to release plugin with v0.38.0 #192

Closed
jamietanna opened this issue Oct 27, 2021 · 1 comment
Closed

Unable to release plugin with v0.38.0 #192

jamietanna opened this issue Oct 27, 2021 · 1 comment

Comments

@jamietanna
Copy link

Version report

Jenkins and plugins versions report:

Gradle v5.6.4
Java 1.8.0_292
JPI Plugin 0.38.0

Reproduction steps

As noted in https://groups.google.com/g/jenkinsci-dev/c/CDVvgj9dDMs:

Results

Expected result:

Plugin is released

Actual result:

Execution failed for task ':job-dsl-plugin:generatePomFileForMavenJpiPublication'.
> Could not apply withXml() to generated POM
   > Cannot get property 'version' on null object
Initialized native services in: /home/jamie/.gradle/native
The client will now receive all logging from the daemon (pid: 67009). The daemon log file: /home/jamie/.gradle/daemon/5.0/daemon-67009.out.log
Starting 9th build in daemon [uptime: 2 mins 57.098 secs, performance: 100%]
Using 16 worker leases.
Starting Build
Settings evaluated using settings file '/home/jamie/workspaces/job-dsl-plugin/settings.gradle'.
Projects loaded. Root project using build file '/home/jamie/workspaces/job-dsl-plugin/build.gradle'.
Included projects: [root project 'job-dsl-plugin-root', project ':job-dsl-api-viewer', project ':job-dsl-core', project ':job-dsl-plugin']

> Configure project :
Evaluating root project 'job-dsl-plugin-root' using build file '/home/jamie/workspaces/job-dsl-plugin/build.gradle'.

> Configure project :job-dsl-core
Evaluating project ':job-dsl-core' using build file '/home/jamie/workspaces/job-dsl-plugin/job-dsl-core/build.gradle'.

> Configure project :job-dsl-api-viewer
Evaluating project ':job-dsl-api-viewer' using build file '/home/jamie/workspaces/job-dsl-plugin/job-dsl-api-viewer/build.gradle'.

> Configure project :job-dsl-plugin
Evaluating project ':job-dsl-plugin' using build file '/home/jamie/workspaces/job-dsl-plugin/job-dsl-plugin/build.gradle'.
All projects evaluated.
Selected primary task 'publish' from project :
Tasks to be executed: [task ':job-dsl-core:publish', task ':job-dsl-plugin:generatePomFileForMavenJpiPublication', task ':job-dsl-core:compileAstJava', task ':job-dsl-core:compileAstGroovy', task ':job-dsl-core:processAstResources', task ':job-dsl-core:astClasses', task ':job-dsl-core:compileJava', task ':job-dsl-core:compileGroovy', task ':job-dsl-core:processResources', task ':job-dsl-core:classes', task ':job-dsl-core:generateApiDoc', task ':job-dsl-core:jar', task ':job-dsl-plugin:localizer', task ':job-dsl-plugin:compileJava', task ':job-dsl-plugin:compileGroovy', task ':job-dsl-plugin:processResources', task ':job-dsl-plugin:classes', task ':job-dsl-plugin:configureManifest', task ':job-dsl-plugin:jar', task ':job-dsl-plugin:javadoc', task ':job-dsl-plugin:javadocJar', task ':job-dsl-plugin:sourcesJar', task ':job-dsl-api-viewer:assetCompile', task ':job-dsl-api-viewer:extractWebJars', task ':job-dsl-api-viewer:combineCss', task ':job-dsl-api-viewer:combineJs', task ':job-dsl-api-viewer:concat', task ':job-dsl-api-viewer:copyData', task ':job-dsl-api-viewer:copyFonts', task ':job-dsl-api-viewer:downloadUpdateCenter', task ':job-dsl-api-viewer:processUpdateCenter', task ':job-dsl-api-viewer:build', task ':job-dsl-plugin:generateLicenseInfo', task ':job-dsl-plugin:war', task ':job-dsl-plugin:publishMavenJpiPublicationToJenkinsRepository', task ':job-dsl-plugin:publish']
:job-dsl-core:publish (Thread[Execution worker for ':',5,main]) started.

> Task :job-dsl-core:publish UP-TO-DATE
Skipping task ':job-dsl-core:publish' as it has no actions.
:job-dsl-core:publish (Thread[Execution worker for ':',5,main]) completed. Took 0.002 secs.
:job-dsl-plugin:generatePomFileForMavenJpiPublication (Thread[Execution worker for ':',5,main]) started.

> Task :job-dsl-plugin:generatePomFileForMavenJpiPublication FAILED
Task ':job-dsl-plugin:generatePomFileForMavenJpiPublication' is not up-to-date because:
  Task.upToDateWhen is false.
:job-dsl-plugin:generatePomFileForMavenJpiPublication (Thread[Execution worker for ':',5,main]) completed. Took 0.044 secs.
1 actionable task: 1 executed

* Try:
Run with --debug option to get more log output. Run with --scan to get full insights.

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':job-dsl-plugin:generatePomFileForMavenJpiPublication'.
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:96)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:65)
        at org.gradle.api.internal.tasks.execution.ActionEventFiringTaskExecuter.execute(ActionEventFiringTaskExecuter.java:44)
        at org.gradle.api.internal.tasks.execution.TimeoutTaskExecuter.execute(TimeoutTaskExecuter.java:53)
        at org.gradle.api.internal.tasks.execution.SnapshotAfterExecutionTaskExecuter.execute(SnapshotAfterExecutionTaskExecuter.java:38)
        at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
        at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:59)
        at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:49)
        at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:61)
        at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:101)
        at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:91)
        at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:44)
        at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:62)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:55)
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
        at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:35)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.run(EventFiringTaskExecuter.java:49)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:301)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:293)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:175)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:44)
        at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:43)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:337)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:325)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:318)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:304)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker$1.execute(DefaultPlanExecutor.java:134)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker$1.execute(DefaultPlanExecutor.java:129)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:202)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:193)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:129)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
Caused by: org.gradle.api.UncheckedIOException: Could not write to file '/home/jamie/workspaces/job-dsl-plugin/job-dsl-plugin/build/publications/mavenJpi/pom-default.xml'.
        at org.gradle.internal.IoActions$TextFileWriterIoAction.execute(IoActions.java:151)
        at org.gradle.internal.IoActions$TextFileWriterIoAction.execute(IoActions.java:127)
        at org.gradle.internal.IoActions.writeTextFile(IoActions.java:45)
        at org.gradle.internal.xml.XmlTransformer.transform(XmlTransformer.java:74)
        at org.gradle.api.publish.maven.internal.tasks.MavenPomFileGenerator.writeTo(MavenPomFileGenerator.java:298)
        at org.gradle.api.publish.maven.tasks.GenerateMavenPom.doGenerate(GenerateMavenPom.java:133)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:48)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:41)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:28)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:704)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:671)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:117)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:301)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:293)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:175)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:106)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:85)
        ... 35 more
Caused by: org.gradle.api.InvalidUserCodeException: Could not apply withXml() to generated POM
        at org.gradle.api.internal.UserCodeAction.execute(UserCodeAction.java:40)
        at org.gradle.internal.ImmutableActionSet$SingletonSet.execute(ImmutableActionSet.java:225)
        at org.gradle.internal.MutableActionSet.execute(MutableActionSet.java:37)
        at org.gradle.internal.xml.XmlTransformer$XmlProviderImpl.apply(XmlTransformer.java:174)
        at org.gradle.internal.xml.XmlTransformer.doTransform(XmlTransformer.java:146)
        at org.gradle.internal.xml.XmlTransformer.doTransform(XmlTransformer.java:134)
        at org.gradle.internal.xml.XmlTransformer.transform(XmlTransformer.java:98)
        at org.gradle.internal.xml.XmlTransformer$1.execute(XmlTransformer.java:76)
        at org.gradle.internal.xml.XmlTransformer$1.execute(XmlTransformer.java:74)
        at org.gradle.internal.IoActions$TextFileWriterIoAction.execute(IoActions.java:146)
        ... 54 more
Caused by: java.lang.NullPointerException: Cannot get property 'version' on null object
        at org.jenkinsci.gradle.plugins.jpi.JpiPomCustomizer$_fixDependencies_closure6.doCall(JpiPomCustomizer.groovy:131)
        at org.jenkinsci.gradle.plugins.jpi.JpiPomCustomizer.fixDependencies(JpiPomCustomizer.groovy:122)
        at org.jenkinsci.gradle.plugins.jpi.JpiPomCustomizer.additionalCustomizations(JpiPomCustomizer.groovy:106)
        at org.jenkinsci.gradle.plugins.jpi.JpiPomCustomizer$_customizePom_closure4.doCall(JpiPomCustomizer.groovy:95)
        at com.sun.proxy.$Proxy56.execute(Unknown Source)
        at org.gradle.api.internal.UserCodeAction.execute(UserCodeAction.java:38)
        ... 63 more


* Get more help at https://help.gradle.org
jamietanna added a commit to jenkinsci/job-dsl-plugin that referenced this issue Oct 27, 2021
Releases were broken with the previous version of the JPI plugin [0],
therefore we needed to try upgrading to the latest version.

As the latest version requires Gradle 6, we have a few changes to make:

- `jenkinsVersion` needs to be referenced through `project.properties`
- the `war` plugin needs to be explicitly added
- the CSS/JS plugins we're using are not yet released[1][2], so we can
  follow the tricks in Spotless[3] to use the version from the (pinned)
  latest commit on GitHub

Next, as we're upgrading the JPI plugin, we need to:

- migrate to using `implementation` / `testImplementation`
- add Feature Variants for each of the `optionalJenkinsPlugins` -
  although I'm not sure if they're needed right now, we'll produce them
  for now and review later

See also https://groups.google.com/g/jenkinsci-dev/c/CDVvgj9dDMs

[0]: jenkinsci/gradle-jpi-plugin#192
[1]: eriwen/gradle-css-plugin#58
[2]: eriwen/gradle-js-plugin#177
[3]: https://github.com/diffplug/spotless/blob/a7f25eb51c6d4006591ea911157e62d0213e320b/CONTRIBUTING.md
@sghill
Copy link

sghill commented Oct 27, 2021

I see from the mailing list this was resolved by jenkinsci/job-dsl-plugin@6b7a8d8.

@sghill sghill closed this as completed Oct 27, 2021
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