From ff145daa207adaf3292233673851b0cc5d196e6f Mon Sep 17 00:00:00 2001 From: Tamas Cservenak Date: Mon, 13 Jun 2022 10:57:08 +0200 Subject: [PATCH 1/6] [MASSEMBLY-961] Update plexus-archiver to 3.6.0 --- pom.xml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index d2ab0c03c..655b7ff86 100644 --- a/pom.xml +++ b/pom.xml @@ -168,11 +168,6 @@ under the License. - - org.codehaus.plexus - plexus-archiver - 4.2.7 - commons-io commons-io @@ -191,7 +186,7 @@ under the License. org.apache.maven maven-archiver - 3.5.2 + 3.6.0-SNAPSHOT org.codehaus.plexus From 59063bbeb8dd7bea719a36e17a68d6e4ae781fcf Mon Sep 17 00:00:00 2001 From: Tamas Cservenak Date: Thu, 16 Jun 2022 15:00:40 +0200 Subject: [PATCH 2/6] To trigger CI --- pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/pom.xml b/pom.xml index 655b7ff86..2ed1cbe79 100644 --- a/pom.xml +++ b/pom.xml @@ -188,6 +188,7 @@ under the License. maven-archiver 3.6.0-SNAPSHOT + org.codehaus.plexus plexus-utils From 600451feedc5ba41100f395490655793b53af36a Mon Sep 17 00:00:00 2001 From: Tamas Cservenak Date: Tue, 21 Jun 2022 00:34:16 +0200 Subject: [PATCH 3/6] Leave comment who uses it --- pom.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pom.xml b/pom.xml index 7d994527d..44cdbe7ae 100644 --- a/pom.xml +++ b/pom.xml @@ -156,6 +156,8 @@ under the License. plexus-interpolation 1.26 + + org.codehaus.plexus plexus-slf4j-logging From a210879490bd485f8247e0fb384db1cca87f1b29 Mon Sep 17 00:00:00 2001 From: Tamas Cservenak Date: Wed, 22 Jun 2022 11:12:54 +0200 Subject: [PATCH 4/6] Update to latest bits, remove unused deps. --- pom.xml | 15 +--- .../archive/DefaultAssemblyArchiver.java | 8 +- .../archiver/AssemblyProxyArchiver.java | 18 ++++ .../internal/DebugConfigurationListener.java | 90 +++++++++++++++++++ .../internal/PlexusLoggingHelper.java | 39 -------- 5 files changed, 112 insertions(+), 58 deletions(-) create mode 100644 src/main/java/org/apache/maven/plugins/assembly/internal/DebugConfigurationListener.java delete mode 100644 src/main/java/org/apache/maven/plugins/assembly/internal/PlexusLoggingHelper.java diff --git a/pom.xml b/pom.xml index 44cdbe7ae..22dcc67ce 100644 --- a/pom.xml +++ b/pom.xml @@ -157,19 +157,6 @@ under the License. 1.26 - - - org.codehaus.plexus - plexus-slf4j-logging - 1.1 - - - org.codehaus.plexus - plexus-container-default - - - - commons-io commons-io @@ -183,7 +170,7 @@ under the License. org.codehaus.plexus plexus-io - 3.3.1 + 3.3.2-SNAPSHOT org.apache.maven diff --git a/src/main/java/org/apache/maven/plugins/assembly/archive/DefaultAssemblyArchiver.java b/src/main/java/org/apache/maven/plugins/assembly/archive/DefaultAssemblyArchiver.java index 116b75150..b933b8f0d 100644 --- a/src/main/java/org/apache/maven/plugins/assembly/archive/DefaultAssemblyArchiver.java +++ b/src/main/java/org/apache/maven/plugins/assembly/archive/DefaultAssemblyArchiver.java @@ -22,7 +22,6 @@ import javax.inject.Inject; import javax.inject.Named; -import org.apache.maven.plugin.DebugConfigurationListener; import org.apache.maven.plugins.assembly.AssemblerConfigurationSource; import org.apache.maven.plugins.assembly.InvalidAssemblerConfigurationException; import org.apache.maven.plugins.assembly.archive.archiver.AssemblyProxyArchiver; @@ -32,7 +31,7 @@ import org.apache.maven.plugins.assembly.filter.ComponentsXmlArchiverFileFilter; import org.apache.maven.plugins.assembly.filter.ContainerDescriptorHandler; import org.apache.maven.plugins.assembly.format.AssemblyFormattingException; -import org.apache.maven.plugins.assembly.internal.PlexusLoggingHelper; +import org.apache.maven.plugins.assembly.internal.DebugConfigurationListener; import org.apache.maven.plugins.assembly.interpolation.AssemblyExpressionEvaluator; import org.apache.maven.plugins.assembly.model.Assembly; import org.apache.maven.plugins.assembly.model.ContainerDescriptorHandlerConfig; @@ -332,7 +331,7 @@ else if ( "war".equals( format ) ) configSource.getWorkingDirectory() ); if ( configSource.isDryRun() ) { - archiver = new DryRunArchiver( archiver, PlexusLoggingHelper.wrap( LOGGER ) ); + archiver = new DryRunArchiver( archiver, LOGGER ); } archiver.setUseJvmChmod( configSource.isUpdateOnly() ); @@ -427,8 +426,7 @@ private void configureComponent( final Object component, final Xpp3Dom config, { final ComponentConfigurator configurator = container.lookup( ComponentConfigurator.class, "basic" ); - final ConfigurationListener listener = new DebugConfigurationListener( - PlexusLoggingHelper.wrap( LOGGER ) ); + final ConfigurationListener listener = new DebugConfigurationListener( LOGGER ); final ExpressionEvaluator expressionEvaluator = new AssemblyExpressionEvaluator( configSource ); diff --git a/src/main/java/org/apache/maven/plugins/assembly/archive/archiver/AssemblyProxyArchiver.java b/src/main/java/org/apache/maven/plugins/assembly/archive/archiver/AssemblyProxyArchiver.java index cf0099820..49382db44 100644 --- a/src/main/java/org/apache/maven/plugins/assembly/archive/archiver/AssemblyProxyArchiver.java +++ b/src/main/java/org/apache/maven/plugins/assembly/archive/archiver/AssemblyProxyArchiver.java @@ -42,6 +42,7 @@ import java.io.IOException; import java.io.InputStream; import java.nio.charset.Charset; +import java.nio.file.attribute.FileTime; import java.util.ArrayList; import java.util.Arrays; import java.util.Comparator; @@ -1099,4 +1100,21 @@ public String getOverrideGroupName() return delegate.getOverrideGroupName(); } + @Override + public void setLastModifiedTime( FileTime fileTime ) + { + delegate.setLastModifiedTime( fileTime ); + } + + @Override + public FileTime getLastModifiedTime() + { + return delegate.getLastModifiedTime(); + } + + @Override + public void configureReproducibleBuild( FileTime fileTime ) + { + delegate.configureReproducibleBuild( fileTime ); + } } diff --git a/src/main/java/org/apache/maven/plugins/assembly/internal/DebugConfigurationListener.java b/src/main/java/org/apache/maven/plugins/assembly/internal/DebugConfigurationListener.java new file mode 100644 index 000000000..5da66acac --- /dev/null +++ b/src/main/java/org/apache/maven/plugins/assembly/internal/DebugConfigurationListener.java @@ -0,0 +1,90 @@ +package org.apache.maven.plugins.assembly.internal; + +/* + * 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. + */ + +import java.lang.reflect.Array; + +import org.codehaus.plexus.component.configurator.ConfigurationListener; +import org.slf4j.Logger; + +/** + * Copy of deprecated {@link org.apache.maven.plugin.DebugConfigurationListener} updated to Slf4j. + */ +public class DebugConfigurationListener + implements ConfigurationListener +{ + private final Logger logger; + + public DebugConfigurationListener( Logger logger ) + { + this.logger = logger; + } + + @Override + public void notifyFieldChangeUsingSetter( String fieldName, Object value, Object target ) + { + if ( logger.isDebugEnabled() ) + { + logger.debug( " (s) " + fieldName + " = " + toString( value ) ); + } + } + + @Override + public void notifyFieldChangeUsingReflection( String fieldName, Object value, Object target ) + { + if ( logger.isDebugEnabled() ) + { + logger.debug( " (f) " + fieldName + " = " + toString( value ) ); + } + } + + /** + * Creates a human-friendly string representation of the specified object. + * + * @param obj The object to create a string representation for, may be null. + * @return The string representation, never null. + */ + private String toString( Object obj ) + { + String str; + if ( obj != null && obj.getClass().isArray() ) + { + int n = Array.getLength( obj ); + StringBuilder buf = new StringBuilder( 256 ); + buf.append( '[' ); + for ( int i = 0; i < n; i++ ) + { + if ( i > 0 ) + { + buf.append( ", " ); + } + buf.append( Array.get( obj, i ) ); + } + buf.append( ']' ); + str = buf.toString(); + } + else + { + str = String.valueOf( obj ); + } + return str; + } + +} diff --git a/src/main/java/org/apache/maven/plugins/assembly/internal/PlexusLoggingHelper.java b/src/main/java/org/apache/maven/plugins/assembly/internal/PlexusLoggingHelper.java deleted file mode 100644 index 6708a9c79..000000000 --- a/src/main/java/org/apache/maven/plugins/assembly/internal/PlexusLoggingHelper.java +++ /dev/null @@ -1,39 +0,0 @@ -package org.apache.maven.plugins.assembly.internal; - -/* - * 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. - */ - -import org.codehaus.plexus.logging.Logger; -import org.codehaus.plexus.logging.slf4j.Slf4jLogger; - -/** - * Support for plexus logging, as downstream component APIs still expect Plexus logger.. - */ -public final class PlexusLoggingHelper -{ - private PlexusLoggingHelper() - { - // nop - } - - public static Logger wrap( final org.slf4j.Logger logger ) - { - return new Slf4jLogger( 0, logger ); // set it lowest level, let SLF4J filter - } -} From d686e05e347fd3caacb8c83fe4155bc3f2436dec Mon Sep 17 00:00:00 2001 From: Tamas Cservenak Date: Thu, 23 Jun 2022 13:20:16 +0200 Subject: [PATCH 5/6] Push latest release changes And honor changes in plexus-archiver --- pom.xml | 7 ++++++- src/it/projects/reproducible/verify.groovy | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 22dcc67ce..da4ac88e8 100644 --- a/pom.xml +++ b/pom.xml @@ -170,7 +170,12 @@ under the License. org.codehaus.plexus plexus-io - 3.3.2-SNAPSHOT + 3.4.0 + + + org.codehaus.plexus + plexus-archiver + 4.4.0 org.apache.maven diff --git a/src/it/projects/reproducible/verify.groovy b/src/it/projects/reproducible/verify.groovy index 14b429c79..798c2fb8b 100644 --- a/src/it/projects/reproducible/verify.groovy +++ b/src/it/projects/reproducible/verify.groovy @@ -27,4 +27,4 @@ assert deployDir.exists() assert new File( deployDir, 'reproducible-1.0-src.zip.sha1' ).text == '5ce34fc133d47cbc9c81195877dbe10b9ec7d864' assert new File( deployDir, 'reproducible-1.0-src.tar.sha1' ).text == '0b9dc1da069705a93b4954a198c18bd248822bf8' -assert new File( deployDir, 'reproducible-1.0-src.jar.sha1' ).text == '2e84c54834ad80e58b4564471a02356904c7b1e3' +assert new File( deployDir, 'reproducible-1.0-src.jar.sha1' ).text == '289cb3ecd418b8099deefb930dc7aa39c06888cb' From 5c27e66c622cb049a297e70fde6f7b82a476dc18 Mon Sep 17 00:00:00 2001 From: Tamas Cservenak Date: Sun, 26 Jun 2022 15:22:51 +0200 Subject: [PATCH 6/6] Use released version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index da4ac88e8..e3dfe1375 100644 --- a/pom.xml +++ b/pom.xml @@ -180,7 +180,7 @@ under the License. org.apache.maven maven-archiver - 3.6.0-SNAPSHOT + 3.6.0