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

0.39.0 Migration Guide #139

Closed
sghill opened this issue Feb 12, 2020 · 1 comment
Closed

0.39.0 Migration Guide #139

sghill opened this issue Feb 12, 2020 · 1 comment
Milestone

Comments

@sghill
Copy link

sghill commented Feb 12, 2020

This migration guide accompanies version 0.39.0, a major release that uses Gradle Module Metadata to improve dependency resolution.

Prerequisites

Gradle

Gradle 6.0 or later is required.

Older projects can ensure a smooth experience by upgrading to Gradle 6.0 or later with gradle-jpi-plugin 0.38.0 before moving to 0.39.0.

Breaking Changes

Users of these features need to make some changes for 0.39.0.

Configurations

Previous versions of gradle-jpi-plugin included three custom configurations that have now been replaced with standard configurations from the java-library plugin.

Old New Notes
jenkinsPlugins implementation See Recognizing API and implementation dependencies
jenkinsTest testImplementation
optionalJenkinsPlugins (custom) See Declaring feature variants

Optional Example

If you previously had an optional dependency declared:

dependencies {
    optionalJenkinsPlugins 'org.jenkins-ci.plujgins.workflow-job:2.39'
}

A feature variant now needs to be registered. The same dependency will be declared on the feature's configuration:

java {
    registerFeature('workflowJob') { // any name you like
        usingSourceSet(sourceSets.main)
    }
}
dependencies {
    workflowJobApi 'org.jenkins-ci.plugins.workflow:workflow-job:2.39'
}

The older configurations exist for now, but will fail with a friendly error message if used. All three configurations will be removed in a future release.

Sources and Javadoc

If jenkinsPlugin.configurePublishing = false, the plugin no longer wires up tasks to create source and javadoc jars. This can be added back by configuring the Java Extension:

java {
    withJavadocJar()
    withSourcesJar()
}

war Task Configuration

This release stops applying the war plugin and instead defines a jpi task of type War. This means any configuration that was previously defined for war must be moved to jpi. See jenkinsci/job-dsl-plugin#1244 for an example.

Notable Differences

These changes alter output, but are not expected to break anything or require user action.

License Generation

The generateLicenseInfo task has been improved in two ways:

  1. It now handles POMs with and without xmlns, resulting in more comprehensive coverage.
  2. Warning instead of failing when dependencies do not have POMs. This is most commonly the case when some dependencies are resolved from ivy repos.

Here's an example of the output for a dependency org.example:myclient:2.0 without a POM:

Could not resolve license(s) via POM for 1 dependency:
    - org.example:myclient:2.0
The above will be missing from path/to/licenses.xml

POM Generation

POMs are now generated by the maven-publish plugin and can appear different in two ways after upgrade:

  1. provided scope dependencies are no longer included
  2. Global exclusions are written to each dependency
@sghill sghill added this to the 0.39.0 milestone Feb 21, 2020
@sghill sghill changed the title Migration Guide to 0.39.0 0.39.0 Migration Guide Apr 16, 2020
@sghill sghill pinned this issue Apr 16, 2020
@sghill sghill closed this as completed Apr 16, 2020
@sghill
Copy link
Author

sghill commented Apr 30, 2020

See jenkinsci/templating-engine-plugin#64 for an example migration

@sghill sghill unpinned this issue Dec 14, 2020
sghill added a commit to sghill/jira-trigger-plugin that referenced this issue Jan 24, 2021
Migrate deprecated configurations to recommended replacements.

jenkinsci/gradle-jpi-plugin#139
sghill added a commit to sghill/jira-trigger-plugin that referenced this issue Jan 24, 2021
Migrate deprecated configurations to recommended replacements.

jenkinsci/gradle-jpi-plugin#139
jenkinsci/gradle-jpi-plugin#181
janssen-tiobe pushed a commit to tiobe/tics-intellij-plugin that referenced this issue Apr 6, 2023
This includes the following changes:
- Upgraded to Gradle 6.5 everywhere, except for the IntelliJ plugin (it uses Gradle 5.6.2 for now due to warnings when using Gradle 6.x)
- Adjusted the Jenkins plugin to use Gradle-style dependencies; see jenkinsci/gradle-jpi-plugin#139
- Fixed the Jenkins makefile to run CheckStyle for every build and resolved all existing violations
- Fixed repository URLs (Nexus) to use https instead of http

Reviewed by @reniers.
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

1 participant