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

[MASSEMBLY-961] Update maven-archiver to 3.6.0 #70

Merged
merged 7 commits into from Jun 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
26 changes: 8 additions & 18 deletions pom.xml
Expand Up @@ -156,23 +156,7 @@ under the License.
<artifactId>plexus-interpolation</artifactId>
<version>1.26</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-slf4j-logging</artifactId>
<version>1.1</version>
<exclusions>
<exclusion>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-container-default</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-archiver</artifactId>
<version>4.2.7</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
Expand All @@ -186,13 +170,19 @@ under the License.
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-io</artifactId>
<version>3.3.1</version>
<version>3.4.0</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-archiver</artifactId>
<version>4.4.0</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-archiver</artifactId>
<version>3.5.2</version>
<version>3.6.0</version>
</dependency>

<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion src/it/projects/reproducible/verify.groovy
Expand Up @@ -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'
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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() );
Expand Down Expand Up @@ -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 );

Expand Down
Expand Up @@ -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;
Expand Down Expand Up @@ -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 );
}
}
@@ -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;
Copy link
Member

Choose a reason for hiding this comment

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

Maybe logger can be initialized here instead of pass as argument.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, but I would rather throw this class out in next major. The benefit is very little.


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 <code>null</code>.
* @return The string representation, never <code>null</code>.
*/
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;
}

}

This file was deleted.