Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/maven-verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ jobs:
name: Verify
uses: apache/maven-gh-actions-shared/.github/workflows/maven-verify.yml@v5
with:
jdk-matrix: '[ "17", "21", "25" ]'
maven4-enabled: true
24 changes: 19 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ under the License.
</contributors>

<prerequisites>
<maven>3.6.3</maven>
<!-- Earlier Maven versions cannot discover the Java 17 components with their bundled Sisu. -->
<maven>3.9.6</maven>
</prerequisites>

<scm>
Expand All @@ -71,7 +72,8 @@ under the License.
<properties>
<maven.compiler.showDeprecation>true</maven.compiler.showDeprecation>

<javaVersion>8</javaVersion>
<!-- Plexus Archiver 5 requires Java 17, including when hard-link preservation is disabled. -->
<javaVersion>17</javaVersion>
<mdoVersion>2.2.0</mdoVersion>
<mavenVersion>3.9.16</mavenVersion>
<slf4jVersion>1.7.36</slf4jVersion>
Expand Down Expand Up @@ -190,7 +192,8 @@ under the License.
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-io</artifactId>
<version>3.7.0</version>
<!-- TODO: use the release containing plexus-io PR #191 when available. -->
<version>3.7.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
Expand All @@ -201,7 +204,8 @@ under the License.
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-archiver</artifactId>
<version>4.14.0</version>
<!-- TODO: use the release containing plexus-archiver PR #493 when available. -->
<version>5.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
Expand Down Expand Up @@ -317,7 +321,12 @@ under the License.
<configuration>
<requirementsHistories>
<requirementsHistory>
<version>from 3.7.0</version>
<version>from 3.8.1</version>
<maven>3.9.6</maven>
<jdk>17</jdk>
</requirementsHistory>
<requirementsHistory>
<version>from 3.7.0 to 3.8.0</version>
<maven>3.6.3</maven>
<jdk>8</jdk>
</requirementsHistory>
Expand Down Expand Up @@ -415,6 +424,11 @@ under the License.
<artifactId>commons-compress</artifactId>
<version>1.28.0</version>
</dependency>
<dependency>
<groupId>org.tukaani</groupId>
<artifactId>xz</artifactId>
<version>1.12</version>
</dependency>
<dependency>
<groupId>com.github.luben</groupId>
<artifactId>zstd-jni</artifactId>
Expand Down
76 changes: 76 additions & 0 deletions src/it/projects/file-sets/tar-hard-links/assembly.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.2.0 https://maven.apache.org/xsd/assembly-2.2.0.xsd">
<id>dist</id>
<formats>
<format>tar</format>
<format>tar.gz</format>
<format>tar.bz2</format>
<format>tar.xz</format>
<format>tar.snappy</format>
<format>tar.zst</format>
</formats>
<includeBaseDirectory>true</includeBaseDirectory>
<baseDirectory>distribution</baseDirectory>
<fileSets>
<!-- File sets preserve identities through the output directory and assembly prefix. -->
<fileSet>
<directory>input/plain</directory>
<outputDirectory>plain</outputDirectory>
</fileSet>
<fileSet>
<directory>input/filtered</directory>
<outputDirectory>filtered-fileset</outputDirectory>
<filtered>true</filtered>
</fileSet>
</fileSets>
<files>
<!-- File items also change the leaf names, including the name used by the link header. -->
<file>
<source>input/mapped/data.txt</source>
<outputDirectory>mapped</outputDirectory>
<destName>renamed-data.txt</destName>
</file>
<file>
<source>input/mapped/alias.txt</source>
<outputDirectory>mapped</outputDirectory>
<destName>renamed-alias.txt</destName>
</file>
<!-- These source names share an inode but require three different output byte sequences. -->
<file>
<source>input/transformed/data.txt</source>
<outputDirectory>transformed</outputDirectory>
<destName>original.txt</destName>
</file>
<file>
<source>input/transformed/filtered.txt</source>
<outputDirectory>transformed</outputDirectory>
<destName>filtered.txt</destName>
<filtered>true</filtered>
</file>
<file>
<source>input/transformed/unix.txt</source>
<outputDirectory>transformed</outputDirectory>
<destName>unix.txt</destName>
<lineEnding>unix</lineEnding>
</file>
</files>
</assembly>
87 changes: 87 additions & 0 deletions src/it/projects/file-sets/tar-hard-links/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<project xmlns="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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.maven.plugin.assembly.test</groupId>
<artifactId>it-project-parent</artifactId>
<version>1</version>
<relativePath>../../../it-project-parent/pom.xml</relativePath>
</parent>
<artifactId>tar-hard-links</artifactId>
<packaging>pom</packaging>
<description>Opt-in TAR hard links survive name mapping but never merge transformed contents.</description>
<properties>
<hardlinks.value>filtered value</hardlinks.value>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptors>
<descriptor>assembly.xml</descriptor>
</descriptors>
<attach>false</attach>
</configuration>
<executions>
<execution>
<id>default</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<finalName>default</finalName>
</configuration>
</execution>
<execution>
<id>disabled</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<finalName>disabled</finalName>
<archiverConfig>
<preserveHardLinks>false</preserveHardLinks>
</archiverConfig>
</configuration>
</execution>
<execution>
<id>enabled</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<finalName>enabled</finalName>
<archiverConfig>
<preserveHardLinks>true</preserveHardLinks>
</archiverConfig>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
43 changes: 43 additions & 0 deletions src/it/projects/file-sets/tar-hard-links/setup.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* 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.nio.file.Files

// Git and the Invoker copy cannot store hard-link relationships, so create real aliases after cloning.
['plain': 'plain payload\n', 'mapped': 'mapped payload\n',
'transformed': 'value=${hardlinks.value}\r\n', 'filtered': 'value=${hardlinks.value}\r\n'].each { name, contents ->
def directory = new File(basedir, "input/$name").toPath()
Files.createDirectories(directory)
def source = directory.resolve('data.txt')
Files.writeString(source, contents)
def aliases = name == 'transformed' ? ['filtered.txt', 'unix.txt'] : ['alias.txt']
aliases.each { alias ->
def link = directory.resolve(alias)
Files.deleteIfExists(link)
Files.createLink(link, source)
assert Files.isSameFile(source, link)
}
}

// Matching bytes alone must not make an unrelated file eligible for preservation.
def copy = new File(basedir, 'input/plain/copy.txt').toPath()
Files.deleteIfExists(copy)
Files.copy(new File(basedir, 'input/plain/data.txt').toPath(), copy)
assert !Files.isSameFile(copy, new File(basedir, 'input/plain/data.txt').toPath())
return true
Loading