-
Notifications
You must be signed in to change notification settings - Fork 98
[JENKINS-67912] Maven HPI plugin does not compile with Java 11 #310
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,7 +10,7 @@ | |
| import org.apache.maven.plugin.logging.Log; | ||
| import org.apache.maven.project.DefaultProjectBuildingRequest; | ||
| import org.apache.maven.project.MavenProject; | ||
| import org.apache.maven.project.MavenProjectBuilder; | ||
| import org.apache.maven.project.ProjectBuilder; | ||
| import org.apache.maven.project.ProjectBuildingException; | ||
| import org.apache.maven.project.ProjectBuildingRequest; | ||
| import org.apache.maven.shared.transfer.artifact.resolve.ArtifactResolver; | ||
|
|
@@ -32,7 +32,7 @@ | |
| */ | ||
| public class MavenArtifact implements Comparable<MavenArtifact> { | ||
| public final ArtifactFactory artifactFactory; | ||
| public final MavenProjectBuilder builder; | ||
| public final ProjectBuilder builder; | ||
| public final List<ArtifactRepository> remoteRepositories; | ||
| public final ArtifactRepository localRepository; | ||
| public final Artifact artifact; | ||
|
|
@@ -43,7 +43,7 @@ public MavenArtifact( | |
| Artifact artifact, | ||
| ArtifactResolver resolver, | ||
| ArtifactFactory artifactFactory, | ||
| MavenProjectBuilder builder, | ||
| ProjectBuilder builder, | ||
| List<ArtifactRepository> remoteRepositories, | ||
| ArtifactRepository localRepository, | ||
| MavenSession session) { | ||
|
|
@@ -57,7 +57,12 @@ public MavenArtifact( | |
| } | ||
|
|
||
| public MavenProject resolvePom() throws ProjectBuildingException { | ||
| return builder.buildFromRepository(artifact,remoteRepositories,localRepository); | ||
| ProjectBuildingRequest buildingRequest = | ||
| new DefaultProjectBuildingRequest(session.getProjectBuildingRequest()); | ||
| buildingRequest.setRemoteRepositories(remoteRepositories); | ||
| buildingRequest.setLocalRepository(localRepository); | ||
basil marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| buildingRequest.setProcessPlugins(false); // improve performance | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Disabling the processing of plugins has a significant effect on performance. I noticed build times had doubled compared to before this PR. Investigating further, I suspected the the Maven 2 APIs we were using before this PR never processed plugins. When I disabled plugin processing in fc9ae1e, performance went back to its old levels. You can see the difference between build 1 and build 2 of this PR. Build 1 took 29 minutes; build 2 took 12 minutes. Builds of the main branch typically take 15 minutes. So this PR keeps performance at similar levels. I repeated the manual testing I had done in core and plugins, and processing plugins didn't seem to have any noticeable effect. |
||
| return builder.build(artifact, buildingRequest).getProject(); | ||
| } | ||
|
|
||
| /** | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.