You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by be...@apache.org on 2009/12/28 18:56:25 UTC
svn commit: r894207 - in
/maven/plugins/trunk/maven-shade-plugin/src/it/manifest-retained: ./
pom.xml verify.bsh
Author: bentmann
Date: Mon Dec 28 17:56:24 2009
New Revision: 894207
URL: http://svn.apache.org/viewvc?rev=894207&view=rev
Log:
[MSHADE-20] Take care of Manifest attributes defined in maven-jar-plugin
Added:
maven/plugins/trunk/maven-shade-plugin/src/it/manifest-retained/
maven/plugins/trunk/maven-shade-plugin/src/it/manifest-retained/pom.xml (with props)
maven/plugins/trunk/maven-shade-plugin/src/it/manifest-retained/verify.bsh (with props)
Added: maven/plugins/trunk/maven-shade-plugin/src/it/manifest-retained/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-shade-plugin/src/it/manifest-retained/pom.xml?rev=894207&view=auto
==============================================================================
--- maven/plugins/trunk/maven-shade-plugin/src/it/manifest-retained/pom.xml (added)
+++ maven/plugins/trunk/maven-shade-plugin/src/it/manifest-retained/pom.xml Mon Dec 28 17:56:24 2009
@@ -0,0 +1,89 @@
+<?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 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.apache.maven.its.shade.mr</groupId>
+ <artifactId>test</artifactId>
+ <version>1.0</version>
+ <packaging>jar</packaging>
+
+ <name>MSHADE-20</name>
+ <description>
+ Test that existing manifest entries are retained upon shading.
+ </description>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.0.2</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-install-plugin</artifactId>
+ <version>2.2</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.2</version>
+ <configuration>
+ <archive>
+ <manifestEntries>
+ <Test-Entry>PASSED</Test-Entry>
+ </manifestEntries>
+ </archive>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>2.2</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-shade-plugin</artifactId>
+ <version>@project.version@</version>
+ <executions>
+ <execution>
+ <id>attach-shade</id>
+ <phase>package</phase>
+ <goals>
+ <goal>shade</goal>
+ </goals>
+ <configuration>
+ <shadedArtifactAttached>true</shadedArtifactAttached>
+ <shadedClassifierName>shaded</shadedClassifierName>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.3.1</version>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Propchange: maven/plugins/trunk/maven-shade-plugin/src/it/manifest-retained/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-shade-plugin/src/it/manifest-retained/pom.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/plugins/trunk/maven-shade-plugin/src/it/manifest-retained/verify.bsh
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-shade-plugin/src/it/manifest-retained/verify.bsh?rev=894207&view=auto
==============================================================================
--- maven/plugins/trunk/maven-shade-plugin/src/it/manifest-retained/verify.bsh (added)
+++ maven/plugins/trunk/maven-shade-plugin/src/it/manifest-retained/verify.bsh Mon Dec 28 17:56:24 2009
@@ -0,0 +1,13 @@
+import java.io.*;
+import java.util.jar.*;
+
+JarFile jarFile = new JarFile( new File( basedir, "target/test-1.0-shaded.jar" ) );
+Manifest mf = jarFile.getManifest();
+jarFile.close();
+
+if ( !"PASSED".equals( mf.getMainAttributes().getValue( "Test-Entry" ) ) )
+{
+ throw new IllegalStateException( "MANIFEST.MF is incomplete" );
+}
+
+return true;
Propchange: maven/plugins/trunk/maven-shade-plugin/src/it/manifest-retained/verify.bsh
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-shade-plugin/src/it/manifest-retained/verify.bsh
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision