diff --git a/src/it/projects/MSHADE-351/pom.xml b/src/it/projects/MSHADE-351/pom.xml new file mode 100644 index 00000000..e1728f33 --- /dev/null +++ b/src/it/projects/MSHADE-351/pom.xml @@ -0,0 +1,73 @@ + + + + + + 4.0.0 + + org.apache.maven.its.shade.srt + test + 1.0 + + MSHADE-351 + + Test the merging of META-INF/services/** entries. + + + + + org.apache.maven.its.shade.srt + one + 0.1 + + + org.apache.maven.its.shade.srt + two + 0.1 + + + + + + + org.apache.maven.plugins + maven-shade-plugin + @project.version@ + + + attach-shade + + shade + + + false + + + + + + + + + + + diff --git a/src/it/projects/MSHADE-351/verify.bsh b/src/it/projects/MSHADE-351/verify.bsh new file mode 100644 index 00000000..d7967a7d --- /dev/null +++ b/src/it/projects/MSHADE-351/verify.bsh @@ -0,0 +1,26 @@ +/* + * 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.io.*; +import java.util.jar.*; +import org.codehaus.plexus.util.*; + +JarFile jarFile = new JarFile( new File( basedir, "target/test-1.0.jar" ) ); +JarEntry jarEntry = jarFile.getEntry( "META-INF/services/org.apache.maven.Shade" ); +String service = IOUtil.toString( jarFile.getInputStream( jarEntry ), "UTF-8" ); +jarFile.close(); diff --git a/src/main/java/org/apache/maven/plugins/shade/resource/properties/MicroprofileConfigTransformer.java b/src/main/java/org/apache/maven/plugins/shade/resource/properties/MicroprofileConfigTransformer.java index ecc49b22..7d47f251 100644 --- a/src/main/java/org/apache/maven/plugins/shade/resource/properties/MicroprofileConfigTransformer.java +++ b/src/main/java/org/apache/maven/plugins/shade/resource/properties/MicroprofileConfigTransformer.java @@ -26,7 +26,7 @@ */ public class MicroprofileConfigTransformer extends PropertiesTransformer { - protected MicroprofileConfigTransformer() + public MicroprofileConfigTransformer() { super( null, "config_ordinal", 1000, false ); } diff --git a/src/main/java/org/apache/maven/plugins/shade/resource/properties/OpenWebBeansPropertiesTransformer.java b/src/main/java/org/apache/maven/plugins/shade/resource/properties/OpenWebBeansPropertiesTransformer.java index 180ac544..7c37d34d 100644 --- a/src/main/java/org/apache/maven/plugins/shade/resource/properties/OpenWebBeansPropertiesTransformer.java +++ b/src/main/java/org/apache/maven/plugins/shade/resource/properties/OpenWebBeansPropertiesTransformer.java @@ -26,7 +26,7 @@ */ public class OpenWebBeansPropertiesTransformer extends PropertiesTransformer { - protected OpenWebBeansPropertiesTransformer() + public OpenWebBeansPropertiesTransformer() { super( "META-INF/openwebbeans/openwebbeans.properties", "configuration.ordinal", 100, false ); } diff --git a/src/main/java/org/apache/maven/plugins/shade/resource/properties/SortedProperties.java b/src/main/java/org/apache/maven/plugins/shade/resource/properties/SortedProperties.java index f64f9f71..fb96b84b 100644 --- a/src/main/java/org/apache/maven/plugins/shade/resource/properties/SortedProperties.java +++ b/src/main/java/org/apache/maven/plugins/shade/resource/properties/SortedProperties.java @@ -35,7 +35,7 @@ * Internal Properties instance sorting its keys on iterations for store() usages. * It ensures properties persistence is deterministic. * - * IMPORTANT: this only overrides methods used accross JVM in store() so ordering is not guaranteed for other cases. + * IMPORTANT: this only overrides methods used across JVM in store() so ordering is not guaranteed for other cases. */ public class SortedProperties extends Properties {