Skip to content

Commit

Permalink
Update assembly plugin to 3.1.0
Browse files Browse the repository at this point in the history
Update maven-assembly-plugin to 3.1.0 to fix several issues regarding
descriptor import and file permissions

Signed-off-by: Laurent Goujon <[email protected]>
  • Loading branch information
laurentgo committed May 14, 2018
1 parent 3e30064 commit dec36f1
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 55 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.6</version>
<version>3.1.0</version>
<exclusions>
<exclusion>
<groupId>org.apache.maven</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
import org.apache.maven.archiver.MavenArchiveConfiguration;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.execution.MavenSession;
import org.apache.maven.plugin.assembly.AssemblerConfigurationSource;
import org.apache.maven.plugin.assembly.utils.InterpolationConstants;
import org.apache.maven.plugins.assembly.AssemblerConfigurationSource;
import org.apache.maven.plugins.assembly.utils.InterpolationConstants;
import org.apache.maven.project.MavenProject;
import org.apache.maven.shared.filtering.MavenFileFilter;
import org.apache.maven.shared.filtering.MavenReaderFilter;
Expand Down Expand Up @@ -201,12 +201,6 @@ public boolean isDryRun() {
return false;
}

// X
@Override
public String getClassifier() {
return null;
}

// X
@Override
public List<String> getFilters() {
Expand All @@ -230,18 +224,6 @@ public File getArchiveBaseDirectory() {
return null;
}

// X
@Override
public String getDescriptorId() {
return null;
}

// X
@Override
public String getDescriptor() {
return null;
}

// X
@Override
public String getTarLongFileMode() {
Expand All @@ -254,12 +236,6 @@ public File getSiteDirectory() {
return null;
}

// X
@Override
public boolean isSiteIncluded() {
return false;
}

// X
@Override
public boolean isAssemblyIdAppended() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
import org.apache.maven.artifact.Artifact;
import org.apache.maven.model.Build;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.assembly.AssemblerConfigurationSource;
import org.apache.maven.plugin.assembly.InvalidAssemblerConfigurationException;
import org.apache.maven.plugin.assembly.archive.ArchiveCreationException;
import org.apache.maven.plugin.assembly.archive.AssemblyArchiver;
import org.apache.maven.plugin.assembly.format.AssemblyFormattingException;
import org.apache.maven.plugin.assembly.io.AssemblyReadException;
import org.apache.maven.plugin.assembly.io.AssemblyReader;
import org.apache.maven.plugin.assembly.model.Assembly;
import org.apache.maven.plugins.assembly.AssemblerConfigurationSource;
import org.apache.maven.plugins.assembly.InvalidAssemblerConfigurationException;
import org.apache.maven.plugins.assembly.archive.ArchiveCreationException;
import org.apache.maven.plugins.assembly.archive.AssemblyArchiver;
import org.apache.maven.plugins.assembly.format.AssemblyFormattingException;
import org.apache.maven.plugins.assembly.io.AssemblyReadException;
import org.apache.maven.plugins.assembly.io.AssemblyReader;
import org.apache.maven.plugins.assembly.model.Assembly;
import org.apache.maven.project.MavenProject;
import org.apache.maven.shared.utils.PathTool;
import org.apache.maven.shared.utils.io.FileUtils;
Expand Down Expand Up @@ -253,7 +253,7 @@ public AssemblyFiles getAssemblyFiles(String name, BuildImageConfiguration build
MappingTrackArchiver ta = (MappingTrackArchiver) trackArchiver;
ta.init(log, assemblyName);
assembly.setId("tracker");
assemblyArchiver.createArchive(assembly, assemblyName, "track", source, false);
assemblyArchiver.createArchive(assembly, assemblyName, "track", source, false, null);
return ta.getAssemblyFiles(mojoParams.getSession());
}
}
Expand Down Expand Up @@ -463,7 +463,7 @@ private void createAssemblyArchive(AssemblyConfiguration assemblyConfig, MojoPar
try {
originalArtifactFile = ensureThatArtifactFileIsSet(params.getProject());
assembly.setId("docker");
assemblyArchiver.createArchive(assembly, assemblyConfig.getName(), buildMode.getExtension(), source, false);
assemblyArchiver.createArchive(assembly, assemblyConfig.getName(), buildMode.getExtension(), source, false, null);
} catch (ArchiveCreationException | AssemblyFormattingException e) {
String error = "Failed to create assembly for docker image " +
" (with mode '" + buildMode + "'): " + e.getMessage() + ".";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import java.io.OutputStream;
import java.util.zip.GZIPOutputStream;

import org.codehaus.plexus.archiver.commonscompress.compressors.bzip2.BZip2CompressorOutputStream;
import org.apache.commons.compress.compressors.bzip2.BZip2CompressorOutputStream;
import org.codehaus.plexus.archiver.tar.TarArchiver;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import java.io.Serializable;

import org.apache.maven.plugin.assembly.model.Assembly;
import org.apache.maven.plugins.assembly.model.Assembly;
import org.apache.maven.plugins.annotations.Parameter;

public class AssemblyConfiguration implements Serializable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ private Reader getFilteredReader(File path, MavenProject project, MavenSession s
project,
Collections.<String>emptyList(),
false,
null,
session,
null);
//request.setEscapeString("$");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
import io.fabric8.maven.docker.util.Logger;
import io.fabric8.maven.docker.util.MojoParameters;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.assembly.InvalidAssemblerConfigurationException;
import org.apache.maven.plugin.assembly.archive.ArchiveCreationException;
import org.apache.maven.plugin.assembly.format.AssemblyFormattingException;
import org.apache.maven.plugins.assembly.InvalidAssemblerConfigurationException;
import org.apache.maven.plugins.assembly.archive.ArchiveCreationException;
import org.apache.maven.plugins.assembly.format.AssemblyFormattingException;

import java.io.File;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.apache.maven.plugin.assembly.interpolation.AssemblyInterpolator;
import org.apache.maven.plugin.assembly.io.DefaultAssemblyReader;
import org.apache.maven.plugins.assembly.interpolation.AssemblyInterpolator;
import org.apache.maven.plugins.assembly.io.DefaultAssemblyReader;
import org.codehaus.plexus.interpolation.fixed.FixedStringSearchInterpolator;

import io.fabric8.maven.docker.assembly.DockerAssemblyConfigurationSource;
Expand Down Expand Up @@ -112,10 +112,11 @@ public static FixedStringSearchInterpolator createInterpolator(MojoParameters pa
}

DockerAssemblyConfigurationSource configSource = new DockerAssemblyConfigurationSource(params, null, null);
// Patterned after org.apache.maven.plugin.assembly.interpolation.AssemblyExpressionEvaluator
// Patterned after org.apache.maven.plugins.assembly.interpolation.AssemblyExpressionEvaluator
return AssemblyInterpolator
.fullInterpolator(params.getProject(),
DefaultAssemblyReader.createProjectInterpolator(params.getProject()), configSource)
DefaultAssemblyReader.createProjectInterpolator(params.getProject())
.withExpressionMarkers(delimiters[0], delimiters[1]), configSource)
.withExpressionMarkers(delimiters[0], delimiters[1]);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.execution.MavenSession;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.assembly.AssemblerConfigurationSource;
import org.apache.maven.plugin.assembly.InvalidAssemblerConfigurationException;
import org.apache.maven.plugin.assembly.archive.ArchiveCreationException;
import org.apache.maven.plugin.assembly.archive.AssemblyArchiver;
import org.apache.maven.plugin.assembly.format.AssemblyFormattingException;
import org.apache.maven.plugin.assembly.io.AssemblyReadException;
import org.apache.maven.plugin.assembly.io.AssemblyReader;
import org.apache.maven.plugin.assembly.model.Assembly;
import org.apache.maven.plugins.assembly.AssemblerConfigurationSource;
import org.apache.maven.plugins.assembly.InvalidAssemblerConfigurationException;
import org.apache.maven.plugins.assembly.archive.ArchiveCreationException;
import org.apache.maven.plugins.assembly.archive.AssemblyArchiver;
import org.apache.maven.plugins.assembly.format.AssemblyFormattingException;
import org.apache.maven.plugins.assembly.io.AssemblyReadException;
import org.apache.maven.plugins.assembly.io.AssemblyReader;
import org.apache.maven.plugins.assembly.model.Assembly;
import org.apache.maven.plugin.logging.SystemStreamLog;
import org.apache.maven.project.MavenProject;
import org.apache.maven.settings.Settings;
Expand Down

0 comments on commit dec36f1

Please sign in to comment.