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

Refresh plugin #11

Merged
merged 1 commit into from
Oct 23, 2022
Merged

Refresh plugin #11

merged 1 commit into from
Oct 23, 2022

Conversation

basil
Copy link
Member

@basil basil commented Oct 22, 2022

Updates all dependencies to the latest version, including adapting to recent Maven plugin API changes. Since Kohsuke's parent POM is no longer maintained and the Jenkins parent POM publishes to the Jenkins Artifactory rather than Maven Central, I have chosen to remove any parent POM from this project. While this does entail a little duplication, it simplifies the management of this non-standard component by only pulling in exactly what we need. The ugliness of a solution that duplicates the code merely mirrors the ugliness of the deployment setup and GitHub organization of this repository, which does not follow our standard conventions.

Testing done

I ensured that Javadocs could be built by running (locally) mvn clean verify -Pcloudbees-release -Dgpg.skip on both Java 8 and Java 11.

I tested this on Java 19 with a Jenkins core build and verified that the generated license information was the same before and after this PR. Note that to adapt to Maven API changes the core build needed this patch:

@@ -565,7 +565,11 @@ THE SOFTWARE.
                 // add Winstone since we are bundling it.
                 def d = project.dependencies.find { it.artifactId=="winstone" };
                 def a = mojo.artifactFactory.createProjectArtifact(d.groupId,d.artifactId,d.version);
-                def p = mojo.projectBuilder.buildFromRepository(a, project.getRemoteArtifactRepositories(), mojo.localRepository)
+                def buildingRequest = new org.apache.maven.project.DefaultProjectBuildingRequest(mojo.session.projectBuildingRequest)
+                buildingRequest.remoteRepositories = project.remoteArtifactRepositories
+                buildingRequest.localRepository = mojo.localRepository
+                buildingRequest.processPlugins = false // improve performance
+                def p = mojo.projectBuilder.build(a, buildingRequest).project
                 models.put(a,p);

CC @jglick

Copy link
Member

@jglick jglick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Let me see if I can cut a release without tricks…

Comment on lines +122 to +125
<configuration>
<useReleaseProfile>false</useReleaseProfile>
<releaseProfiles>cloudbees-release</releaseProfiles>
</configuration>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect we could add anything needed (like GPG signing) to the standard release profile, but this is fine too.


<profiles>
<profile>
<id>jdk-8-and-below</id>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not think we still need this—can assume that releases run on 11 (or newer).

*/
@Mojo(name = "process", requiresDependencyResolution = ResolutionScope.RUNTIME)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@jglick jglick merged commit 0d1147b into jenkinsci:master Oct 23, 2022
@jglick
Copy link
Member

jglick commented Oct 23, 2022

Nope:

[INFO] [ERROR] Rule failure while trying to close staging repository with ID "comcloudbees-1211".
[INFO] [ERROR] 
[INFO] [ERROR] Nexus Staging Rules Failure Report
[INFO] [ERROR] ==================================
[INFO] [ERROR] 
[INFO] [ERROR] Repository "comcloudbees-1211" failures
[INFO] [ERROR]   Rule "pom-staging" failures
[INFO] [ERROR]     * Invalid POM: /com/cloudbees/maven-license-plugin/1.13/maven-license-plugin-1.13.pom: Project description missing, License information missing, Developer information missing

Probably things that came from the parent. I will try to fix.

jglick added a commit to jglick/maven-license-plugin that referenced this pull request Oct 23, 2022
Also updating `name`, `url`, & `scm` while I am here.
@jglick jglick mentioned this pull request Oct 23, 2022
@jglick
Copy link
Member

jglick commented Oct 23, 2022

After some trial & error, managed to get https://github.com/cloudbees/maven-license-plugin/releases/tag/maven-license-plugin-1.15 released. https://gist.github.com/jglick/b4ece94b38f139a66d3333f7cc925099 FTR

@basil basil deleted the refresh branch October 23, 2022 16:58
basil added a commit to jenkinsci/jenkins that referenced this pull request Oct 23, 2022
…maven-plugin#11

[ERROR] Failed to execute goal com.cloudbees:maven-license-plugin:1.15:process (default) on project jenkins-war: Execution default of goal com.cloudbees:maven-license-plugin:1.15:process failed: No signature of method: org.apache.maven.project.DefaultProjectBuilder.buildFromRepository() is applicable for argument types: (org.apache.maven.artifact.DefaultArtifact, ArrayList, org.apache.maven.artifact.repository.MavenArtifactRepository)
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.

2 participants