Author: rfscholte Date: Sat Aug 19 11:42:02 2017 New Revision: 1805503 URL: http://svn.apache.org/viewvc?rev=1805503&view=rev Log: [MSHADE-258] RemappingClassAdapter is deprecated and throws an exception with ASM 6.0 beta Provide IT
Added: maven/plugins/trunk/maven-shade-plugin/src/it/MSHADE-258_module_relocation/ maven/plugins/trunk/maven-shade-plugin/src/it/MSHADE-258_module_relocation/pom.xml maven/plugins/trunk/maven-shade-plugin/src/it/MSHADE-258_module_relocation/verify.groovy Added: maven/plugins/trunk/maven-shade-plugin/src/it/MSHADE-258_module_relocation/pom.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-shade-plugin/src/it/MSHADE-258_module_relocation/pom.xml?rev=1805503&view=auto ============================================================================== --- maven/plugins/trunk/maven-shade-plugin/src/it/MSHADE-258_module_relocation/pom.xml (added) +++ maven/plugins/trunk/maven-shade-plugin/src/it/MSHADE-258_module_relocation/pom.xml Sat Aug 19 11:42:02 2017 @@ -0,0 +1,65 @@ +<?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> + <modelVersion>4.0.0</modelVersion> + <groupId>org.apache.maven.its.shade.csj</groupId> + <artifactId>mshade-258</artifactId> + <version>1.0-SNAPSHOT</version> + <url>https://issues.apache.org/jira/browse/MSHADE-258</url> + <description> + RemappingClassAdapter is deprecated and throws an exception with ASM 6.0 beta + </description> + + <dependencies> + <dependency> + <groupId>org.ow2.asm</groupId> + <artifactId>asm</artifactId> + <version>@asmVersion@</version> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-shade-plugin</artifactId> + <version>@project.version@</version> + <executions> + <execution> + <id>shade</id> + <goals> + <goal>shade</goal> + </goals> + <configuration> + <relocations> + <relocation> + <pattern>org.objectweb.asm</pattern> + <shadedPattern>org.shaded.objectweb.asm</shadedPattern> + </relocation> + </relocations> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> Added: maven/plugins/trunk/maven-shade-plugin/src/it/MSHADE-258_module_relocation/verify.groovy URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-shade-plugin/src/it/MSHADE-258_module_relocation/verify.groovy?rev=1805503&view=auto ============================================================================== --- maven/plugins/trunk/maven-shade-plugin/src/it/MSHADE-258_module_relocation/verify.groovy (added) +++ maven/plugins/trunk/maven-shade-plugin/src/it/MSHADE-258_module_relocation/verify.groovy Sat Aug 19 11:42:02 2017 @@ -0,0 +1,31 @@ +/* + * 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. + */ + +def buildLog = new File ( basedir , "build.log" ) +assert buildLog.text.contains( "[WARNING] Discovered module-info.class. Shading will break its strong encapsulation." ) + +def jarFile = new java.util.jar.JarFile( new File( basedir, "target/mshade-258-1.0-SNAPSHOT.jar" ) ) +try +{ + assert null == jarFile.getJarEntry( "module-info.class" ) +} +finally +{ + jarFile.close() +}