(maven-jlink-plugin) branch MJLINK-75 created (now 2b6b5cc)
This is an automated email from the ASF dual-hosted git repository. hboutemy pushed a change to branch MJLINK-75 in repository https://gitbox.apache.org/repos/asf/maven-jlink-plugin.git at 2b6b5cc [MJLINK-75] create reproducible zip archive This branch includes the following new commits: new 2b6b5cc [MJLINK-75] create reproducible zip archive The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference.
(maven-jlink-plugin) 01/01: [MJLINK-75] create reproducible zip archive
This is an automated email from the ASF dual-hosted git repository. hboutemy pushed a commit to branch MJLINK-75 in repository https://gitbox.apache.org/repos/asf/maven-jlink-plugin.git commit 2b6b5cc54860f15cfe1b0ce2bcd1951e9286 Author: Hervé Boutemy AuthorDate: Tue Jan 23 04:40:06 2024 +0100 [MJLINK-75] create reproducible zip archive --- pom.xml| 7 ++- .../java/org/apache/maven/plugins/jlink/JLinkMojo.java | 18 ++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 693342c..ad800ca 100644 --- a/pom.xml +++ b/pom.xml @@ -28,7 +28,7 @@ maven-jlink-plugin - 3.1.1-SNAPSHOT + 3.2.0-SNAPSHOT maven-plugin Apache Maven JLink Plugin @@ -112,6 +112,11 @@ maven-shared-utils 3.4.2 + + org.apache.maven + maven-archiver + 3.6.1 + org.codehaus.plexus plexus-archiver diff --git a/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java b/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java index c9b135f..fcb57c0 100644 --- a/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java +++ b/src/main/java/org/apache/maven/plugins/jlink/JLinkMojo.java @@ -42,6 +42,7 @@ import java.io.IOException; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; +import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -50,6 +51,7 @@ import java.util.NoSuchElementException; import java.util.Optional; import org.apache.commons.io.FileUtils; +import org.apache.maven.archiver.MavenArchiver; import org.apache.maven.artifact.Artifact; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; @@ -339,6 +341,16 @@ public class JLinkMojo extends AbstractJLinkMojo { @Parameter(defaultValue = "${project.build.finalName}", readonly = true) private String finalName; +/** + * Timestamp for reproducible output archive entries, either formatted as ISO 8601 + * -MM-dd'T'HH:mm:ssXXX or as an int representing seconds since the epoch (like + * https://reproducible-builds.org/docs/source-date-epoch/;>SOURCE_DATE_EPOCH). + * + * @since 3.2.0 + */ +@Parameter(defaultValue = "${project.build.outputTimestamp}") +private String outputTimestamp; + /** * Convenience interface for plugins to add or replace artifacts and resources on projects. */ @@ -510,6 +522,12 @@ public class JLinkMojo extends AbstractJLinkMojo { throws MojoExecutionException { zipArchiver.addDirectory(outputDirectoryImage); +// configure for Reproducible Builds based on outputTimestamp value +Date lastModified = new MavenArchiver().parseOutputTimestamp(outputTimestamp); +if (lastModified != null) { +zipArchiver.configureReproducible(lastModified); +} + File resultArchive = getArchiveFile(outputDirectory, finalName, getClassifier(), "zip"); zipArchiver.setDestFile(resultArchive);
(maven-shade-plugin) branch MSHADE-420 updated (079560e -> 8fa3133)
This is an automated email from the ASF dual-hosted git repository. hboutemy pushed a change to branch MSHADE-420 in repository https://gitbox.apache.org/repos/asf/maven-shade-plugin.git from 079560e [MSHADE-420] fix time when read from extra field add 8fa3133 [MSHADE-420] small adjustments No new revisions were added by this update. Summary of changes: src/it/projects/MSHADE-420/invoker.properties | 2 +- src/it/projects/MSHADE-420/verify.groovy | 6 +++--- src/it/projects/MSHADE-420/zipdetails.txt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-)
(maven-shade-plugin) branch master updated (4753d8e -> e7077c6)
This is an automated email from the ASF dual-hosted git repository. rmannibucau pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/maven-shade-plugin.git from 4753d8e Bump org.codehaus.plexus:plexus-utils from 3.5.1 to 4.0.0 new 87a4f14 [MSHADE-467] Reproduce concurrency problem in an IT new ae907a8 [MSHADE-467] Fix concurrency problem with dependency-reduced POM new e7077c6 [MSHADE-467] Improved concurrency problem fix The 3 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .../invoker.properties | 2 +- .../pom.xml| 184 + .../shadeMT1}/pom.xml | 31 ++-- .../shadeMT2}/pom.xml | 31 ++-- .../shadeMT3}/pom.xml | 31 ++-- .../shadeMT4}/pom.xml | 31 ++-- .../verify.groovy | 9 +- .../apache/maven/plugins/shade/mojo/ShadeMojo.java | 16 +- 8 files changed, 261 insertions(+), 74 deletions(-) copy src/it/projects/{MSHADE-382_skip_execution => MSHADE-467_parallel-dependency-reduced-pom}/invoker.properties (96%) create mode 100644 src/it/projects/MSHADE-467_parallel-dependency-reduced-pom/pom.xml copy src/it/projects/{MSHADE-413-parallel => MSHADE-467_parallel-dependency-reduced-pom/shadeMT1}/pom.xml (64%) copy src/it/projects/{MSHADE-413-parallel => MSHADE-467_parallel-dependency-reduced-pom/shadeMT2}/pom.xml (64%) copy src/it/projects/{MSHADE-413-parallel => MSHADE-467_parallel-dependency-reduced-pom/shadeMT3}/pom.xml (64%) copy src/it/projects/{MSHADE-413-parallel => MSHADE-467_parallel-dependency-reduced-pom/shadeMT4}/pom.xml (64%) copy src/it/projects/{MSHADE-382_skip_execution => MSHADE-467_parallel-dependency-reduced-pom}/verify.groovy (78%)
(maven-shade-plugin) 03/03: [MSHADE-467] Improved concurrency problem fix
This is an automated email from the ASF dual-hosted git repository. rmannibucau pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/maven-shade-plugin.git commit e7077c628c2cbb059c829ffb124690f211ba36b0 Author: Alexander Kriegisch AuthorDate: Sun Jan 21 03:44:15 2024 +0700 [MSHADE-467] Improved concurrency problem fix Code review: Synchronising on session.getProjectBuildingRequest() is less invasive than a global reentrant lock and therefore preferable to the reviewer. Co-authored-by: Romain Manni-Bucau --- .../java/org/apache/maven/plugins/shade/mojo/ShadeMojo.java| 10 +- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/main/java/org/apache/maven/plugins/shade/mojo/ShadeMojo.java b/src/main/java/org/apache/maven/plugins/shade/mojo/ShadeMojo.java index 3a7eaaa..a8475d9 100644 --- a/src/main/java/org/apache/maven/plugins/shade/mojo/ShadeMojo.java +++ b/src/main/java/org/apache/maven/plugins/shade/mojo/ShadeMojo.java @@ -35,8 +35,6 @@ import java.util.LinkedHashSet; import java.util.List; import java.util.Map; import java.util.Set; -import java.util.concurrent.locks.Lock; -import java.util.concurrent.locks.ReentrantLock; import org.apache.maven.RepositoryUtils; import org.apache.maven.artifact.Artifact; @@ -1050,8 +1048,6 @@ public class ShadeMojo extends AbstractMojo { rewriteDependencyReducedPomIfWeHaveReduction(dependencies, modified, transitiveDeps, model); } -private static final Lock LOCK = new ReentrantLock(); - private void rewriteDependencyReducedPomIfWeHaveReduction( List dependencies, boolean modified, List transitiveDeps, Model model) throws IOException, ProjectBuildingException, DependencyGraphBuilderException { @@ -1116,9 +1112,7 @@ public class ShadeMojo extends AbstractMojo { w.close(); } -// Lock critical section to fix MSHADE-467 -try { -LOCK.lock(); +synchronized (session.getProjectBuildingRequest()) { // Lock critical section to fix MSHADE-467 ProjectBuildingRequest projectBuildingRequest = new DefaultProjectBuildingRequest(session.getProjectBuildingRequest()); projectBuildingRequest.setLocalRepository(session.getLocalRepository()); @@ -1128,8 +1122,6 @@ public class ShadeMojo extends AbstractMojo { getLog().debug("updateExcludesInDeps()"); modified = updateExcludesInDeps(result.getProject(), dependencies, transitiveDeps); -} finally { -LOCK.unlock(); } }
(maven-shade-plugin) 01/03: [MSHADE-467] Reproduce concurrency problem in an IT
This is an automated email from the ASF dual-hosted git repository. rmannibucau pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/maven-shade-plugin.git commit 87a4f14ef7e5ff898ec9dcb7ef47c71e31c448fd Author: Alexander Kriegisch AuthorDate: Sat Jan 20 13:03:50 2024 +0700 [MSHADE-467] Reproduce concurrency problem in an IT --- .../invoker.properties | 18 ++ .../pom.xml| 184 + .../shadeMT1/pom.xml | 38 + .../shadeMT2/pom.xml | 38 + .../shadeMT3/pom.xml | 38 + .../shadeMT4/pom.xml | 38 + .../verify.groovy | 25 +++ 7 files changed, 379 insertions(+) diff --git a/src/it/projects/MSHADE-467_parallel-dependency-reduced-pom/invoker.properties b/src/it/projects/MSHADE-467_parallel-dependency-reduced-pom/invoker.properties new file mode 100644 index 000..af49e5c --- /dev/null +++ b/src/it/projects/MSHADE-467_parallel-dependency-reduced-pom/invoker.properties @@ -0,0 +1,18 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +invoker.goals = package -T 4 diff --git a/src/it/projects/MSHADE-467_parallel-dependency-reduced-pom/pom.xml b/src/it/projects/MSHADE-467_parallel-dependency-reduced-pom/pom.xml new file mode 100644 index 000..99be908 --- /dev/null +++ b/src/it/projects/MSHADE-467_parallel-dependency-reduced-pom/pom.xml @@ -0,0 +1,184 @@ + + +http://maven.apache.org/POM/4.0.0; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd;> +4.0.0 + +org.apache.maven.its.shade.parallel +MSHADE-467 +1.0.0-SNAPSHOT + +pom + + +shadeMT1 +shadeMT2 +shadeMT3 +shadeMT4 + + + + +org.apache.commons +commons-vfs2 +2.9.0 + + +commons-logging +commons-logging + + +org.apache.hadoop +* + + + + +com.vividsolutions +jts +1.13 + + +xercesImpl +xerces + + + + +com.itextpdf +itextpdf +5.5.13.3 + + +* +* + + + + +org.apache.xmlgraphics +batik-swing +1.17 + + +xml-apis +xml-apis + + +org.apache.xmlgraphics +batik-ext + + + + +org.apache.xmlgraphics +batik-dom +1.17 + + +xerces +xercesImpl + + + + +org.apache.xmlgraphics +batik-transcoder +1.17 + + +* +org.apache.avalon + + +org.apache.xmlgraphics +fop + + + + +org.springframework.boot +spring-boot-starter-test +2.7.18 +test + + +org.junit.jupiter +junit-jupiter + + + + +io.grpc +grpc-core +1.58.0 + + +io.micrometer +micrometer-registry-stackdriver +1.9.16 + + +javax.annotation +javax.annotation-api + + + + +
(maven-shade-plugin) 02/03: [MSHADE-467] Fix concurrency problem with dependency-reduced POM
This is an automated email from the ASF dual-hosted git repository. rmannibucau pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/maven-shade-plugin.git commit ae907a870b8f585952a62eeaaa5a13fe6d7768ef Author: Alexander Kriegisch AuthorDate: Sat Jan 20 12:09:42 2024 +0700 [MSHADE-467] Fix concurrency problem with dependency-reduced POM It looks as if running MShade concurrently somehow bleeds MavenSession state into other mojo executions. Therefore, in the lower critical section of ShadeMojo::rewriteDependencyReducedPomIfWeHaveReduction, we use a final static ReentrantLock instance to block concurrent entry to the section. --- .../apache/maven/plugins/shade/mojo/ShadeMojo.java | 24 +++--- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/src/main/java/org/apache/maven/plugins/shade/mojo/ShadeMojo.java b/src/main/java/org/apache/maven/plugins/shade/mojo/ShadeMojo.java index 396bed1..3a7eaaa 100644 --- a/src/main/java/org/apache/maven/plugins/shade/mojo/ShadeMojo.java +++ b/src/main/java/org/apache/maven/plugins/shade/mojo/ShadeMojo.java @@ -35,6 +35,8 @@ import java.util.LinkedHashSet; import java.util.List; import java.util.Map; import java.util.Set; +import java.util.concurrent.locks.Lock; +import java.util.concurrent.locks.ReentrantLock; import org.apache.maven.RepositoryUtils; import org.apache.maven.artifact.Artifact; @@ -1048,6 +1050,8 @@ public class ShadeMojo extends AbstractMojo { rewriteDependencyReducedPomIfWeHaveReduction(dependencies, modified, transitiveDeps, model); } +private static final Lock LOCK = new ReentrantLock(); + private void rewriteDependencyReducedPomIfWeHaveReduction( List dependencies, boolean modified, List transitiveDeps, Model model) throws IOException, ProjectBuildingException, DependencyGraphBuilderException { @@ -1112,15 +1116,21 @@ public class ShadeMojo extends AbstractMojo { w.close(); } -ProjectBuildingRequest projectBuildingRequest = -new DefaultProjectBuildingRequest(session.getProjectBuildingRequest()); - projectBuildingRequest.setLocalRepository(session.getLocalRepository()); - projectBuildingRequest.setRemoteRepositories(project.getRemoteArtifactRepositories()); +// Lock critical section to fix MSHADE-467 +try { +LOCK.lock(); +ProjectBuildingRequest projectBuildingRequest = +new DefaultProjectBuildingRequest(session.getProjectBuildingRequest()); + projectBuildingRequest.setLocalRepository(session.getLocalRepository()); + projectBuildingRequest.setRemoteRepositories(project.getRemoteArtifactRepositories()); -ProjectBuildingResult result = projectBuilder.build(f, projectBuildingRequest); +ProjectBuildingResult result = projectBuilder.build(f, projectBuildingRequest); -getLog().debug("updateExcludesInDeps()"); -modified = updateExcludesInDeps(result.getProject(), dependencies, transitiveDeps); +getLog().debug("updateExcludesInDeps()"); +modified = updateExcludesInDeps(result.getProject(), dependencies, transitiveDeps); +} finally { +LOCK.unlock(); +} } project.setFile(dependencyReducedPomLocation);
(maven-apache-parent) branch bugfix/remove-orphaned-maven-apache-parent.marker deleted (was 96b9d7e)
This is an automated email from the ASF dual-hosted git repository. kwin pushed a change to branch bugfix/remove-orphaned-maven-apache-parent.marker in repository https://gitbox.apache.org/repos/asf/maven-apache-parent.git was 96b9d7e [MPOM-265] Remove no longer used ".maven-apache-parent.marker" file The revisions that were on this branch are still contained in other references; therefore, this change does not discard any commits from the repository.
(maven-apache-parent) branch master updated: [MPOM-265] Remove no longer used ".maven-apache-parent.marker" file (#189)
This is an automated email from the ASF dual-hosted git repository. kwin pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/maven-apache-parent.git The following commit(s) were added to refs/heads/master by this push: new 305f03e [MPOM-265] Remove no longer used ".maven-apache-parent.marker" file (#189) 305f03e is described below commit 305f03efd079eaac80854ae3bf0cd9c40ac83322 Author: Konrad Windszus AuthorDate: Mon Jan 22 16:35:38 2024 +0100 [MPOM-265] Remove no longer used ".maven-apache-parent.marker" file (#189) This has been introduced in MPOM-255 for enabling a profile only when building the ASF parent itself. --- .maven-apache-parent.marker | 17 - 1 file changed, 17 deletions(-) diff --git a/.maven-apache-parent.marker b/.maven-apache-parent.marker deleted file mode 100644 index 864fd14..000 --- a/.maven-apache-parent.marker +++ /dev/null @@ -1,17 +0,0 @@ - -This is just a marker file to make sure that profile "enforce-output-timestamp-property" is not active for builds of this project.
(maven-apache-parent) branch master updated: Document how to build site (#190)
This is an automated email from the ASF dual-hosted git repository. kwin pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/maven-apache-parent.git The following commit(s) were added to refs/heads/master by this push: new c61c83e Document how to build site (#190) c61c83e is described below commit c61c83e1ecc5d7b77e43497595a86a3315bfd6f0 Author: Konrad Windszus AuthorDate: Mon Jan 22 16:36:22 2024 +0100 Document how to build site (#190) Remove mentions of the non-existing profile "run-its" --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0a34755..b646516 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ There are some guidelines which will make applying PRs easier for us: Optional supplemental description. ``` + Make sure you have added the necessary tests (JUnit/IT) for your changes. -+ Run all the tests with `mvn -Prun-its verify` to assure nothing else was accidentally broken. ++ Update the [site documentation](https://maven.apache.org/pom/asf/) accordingly in `src/site-docs` and build it via `mvn site -f site-pom.xml` (uses a dedicated POM to not be inherited) + Submit a pull request to the repository in the Apache organization. + Update your JIRA ticket and include a link to the pull request in the ticket.
(maven) branch master updated: [MNG-8014] Fix multithreaded builder (#1386)
This is an automated email from the ASF dual-hosted git repository. gnodet pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/maven.git The following commit(s) were added to refs/heads/master by this push: new b6a84fcac6 [MNG-8014] Fix multithreaded builder (#1386) b6a84fcac6 is described below commit b6a84fcac6689e9b6b8052d0d204f1442bbbe88f Author: Guillaume Nodet AuthorDate: Mon Jan 22 18:27:48 2024 +0100 [MNG-8014] Fix multithreaded builder (#1386) --- .../maven/project/DefaultProjectBuilder.java | 105 +++-- .../maven/model/building/DefaultModelBuilder.java | 41 .../building/DefaultModelBuildingRequest.java | 4 +- .../building/DefaultTransformerContextBuilder.java | 6 +- .../org/apache/maven/model/building/Graph.java | 26 ++--- .../apache/maven/model/building/ModelCache.java| 4 +- .../repository/internal/DefaultModelCache.java | 63 ++--- .../maven/internal/xml}/ImmutableCollections.java | 30 +++--- .../org/apache/maven/internal/xml/XmlNodeImpl.java | 7 +- src/mdo/java/ImmutableCollections.java | 14 ++- 10 files changed, 183 insertions(+), 117 deletions(-) diff --git a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java index 76791a82b8..7c99136b6a 100644 --- a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java +++ b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java @@ -25,9 +25,8 @@ import javax.inject.Singleton; import java.io.File; import java.io.IOException; import java.util.*; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ForkJoinPool; -import java.util.concurrent.ForkJoinTask; +import java.util.concurrent.*; +import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Supplier; import java.util.stream.Collectors; @@ -88,7 +87,7 @@ import org.slf4j.LoggerFactory; @Singleton public class DefaultProjectBuilder implements ProjectBuilder { public static final String BUILDER_PARALLELISM = "maven.projectBuilder.parallelism"; -public static final int DEFAULT_BUILDER_PARALLELISM = 1; +public static final int DEFAULT_BUILDER_PARALLELISM = Runtime.getRuntime().availableProcessors() / 2 + 1; private final Logger logger = LoggerFactory.getLogger(getClass()); private final ModelBuilder modelBuilder; @@ -208,14 +207,14 @@ public class DefaultProjectBuilder implements ProjectBuilder { private final List repositories; private final ReactorModelPool modelPool; private final TransformerContextBuilder transformerContextBuilder; -private final ForkJoinPool forkJoinPool; +private final ExecutorService executor; BuildSession(ProjectBuildingRequest request, boolean localProjects) { this.request = request; this.session = RepositoryUtils.overlay(request.getLocalRepository(), request.getRepositorySession(), repoSystem); this.repositories = RepositoryUtils.toRepos(request.getRemoteRepositories()); -this.forkJoinPool = new ForkJoinPool(getParallelism(request)); +this.executor = createExecutor(getParallelism(request)); if (localProjects) { this.modelPool = new ReactorModelPool(); this.transformerContextBuilder = modelBuilder.newTransformerContextBuilder(); @@ -225,9 +224,42 @@ public class DefaultProjectBuilder implements ProjectBuilder { } } +ExecutorService createExecutor(int parallelism) { +// +// We need an executor that will not block. +// We can't use work stealing, as we are building a graph +// and this could lead to cycles where a thread waits for +// a task to finish, then execute another one which waits +// for the initial task... +// In order to work around that problem, we override the +// invokeAll method, so that whenever the method is called, +// the pool core size will be incremented before submitting +// all the tasks, then the thread will block waiting for all +// those subtasks to finish. +// This ensures the number of running workers is no more than +// the defined parallism, while making sure the pool will not +// be exhausted +// +return new ThreadPoolExecutor( +parallelism, Integer.MAX_VALUE, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>()) { +final AtomicInteger parked = new AtomicInteger(); + +@Override +public List> invokeAll(Collection> tasks) +throws InterruptedException { +