This is an automated email from the ASF dual-hosted git repository. sjaranowski pushed a commit to branch MASSEMBLY-1020 in repository https://gitbox.apache.org/repos/asf/maven-assembly-plugin.git
commit 685b3c81424630cf8741b9e6bd38a63e155c0280 Author: Slawomir Jaranowski <s.jaranow...@gmail.com> AuthorDate: Tue Mar 12 20:56:15 2024 +0100 [MASSEMBLY-1020] Reproduce a bug --- src/it/projects/bugs/massembly-1020/pom.xml | 64 ++++++++++++++++++++++ .../massembly-1020/src/main/assembly/component.xml | 32 +++++++++++ .../src/main/resources/config/test1.txt | 1 + .../src/main/resources/config/test2.txt | 1 + src/it/projects/bugs/massembly-1020/verify.groovy | 36 ++++++++++++ 5 files changed, 134 insertions(+) diff --git a/src/it/projects/bugs/massembly-1020/pom.xml b/src/it/projects/bugs/massembly-1020/pom.xml new file mode 100644 index 00000000..8d5164b8 --- /dev/null +++ b/src/it/projects/bugs/massembly-1020/pom.xml @@ -0,0 +1,64 @@ +<!-- +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 http://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> + </parent> + + <groupId>test</groupId> + <artifactId>massembly-1020</artifactId> + <version>0.0.1-SNAPSHOT</version> + <packaging>pom</packaging> + + <properties> + <resources.dir>src/main/resources</resources.dir> + </properties> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-assembly-plugin</artifactId> + <executions> + <execution> + <id>create-assembly</id> + <phase>package</phase> + <goals> + <goal>single</goal> + </goals> + <configuration> + <formats> + <format>zip</format> + </formats> + <descriptors> + <descriptor>src/main/assembly/component.xml</descriptor> + </descriptors> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + +</project> diff --git a/src/it/projects/bugs/massembly-1020/src/main/assembly/component.xml b/src/it/projects/bugs/massembly-1020/src/main/assembly/component.xml new file mode 100644 index 00000000..35269d3e --- /dev/null +++ b/src/it/projects/bugs/massembly-1020/src/main/assembly/component.xml @@ -0,0 +1,32 @@ +<!-- +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.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd"> + + <id>component</id> + <includeBaseDirectory>false</includeBaseDirectory> + + <fileSets> + <fileSet> + <directory>${resources.dir}/config</directory> + <outputDirectory>.</outputDirectory> + </fileSet> + </fileSets> +</assembly> \ No newline at end of file diff --git a/src/it/projects/bugs/massembly-1020/src/main/resources/config/test1.txt b/src/it/projects/bugs/massembly-1020/src/main/resources/config/test1.txt new file mode 100644 index 00000000..f079749c --- /dev/null +++ b/src/it/projects/bugs/massembly-1020/src/main/resources/config/test1.txt @@ -0,0 +1 @@ +test1 \ No newline at end of file diff --git a/src/it/projects/bugs/massembly-1020/src/main/resources/config/test2.txt b/src/it/projects/bugs/massembly-1020/src/main/resources/config/test2.txt new file mode 100644 index 00000000..d606037c --- /dev/null +++ b/src/it/projects/bugs/massembly-1020/src/main/resources/config/test2.txt @@ -0,0 +1 @@ +test2 \ No newline at end of file diff --git a/src/it/projects/bugs/massembly-1020/verify.groovy b/src/it/projects/bugs/massembly-1020/verify.groovy new file mode 100644 index 00000000..d8567a8e --- /dev/null +++ b/src/it/projects/bugs/massembly-1020/verify.groovy @@ -0,0 +1,36 @@ +/* + * 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.util.zip.ZipFile + +def f = new File(basedir, "target/massembly-1020-0.0.1-SNAPSHOT-component.zip") + +def expectedEntries = [ + "test1.txt", + "test2.txt", +] + +new ZipFile(f).withCloseable {zipFile -> + expectedEntries.each {entryName -> + def entry = zipFile.getEntry(entryName) + assert entry != null: "missing zip entry: " + entryName + } +} + +return true \ No newline at end of file