1<?xml version="1.0" encoding="UTF-8"?> 2<!-- 3 Copyright (c) 2009, 2021 Mountainminds GmbH & Co. KG and Contributors 4 This program and the accompanying materials are made available under 5 the terms of the Eclipse Public License 2.0 which is available at 6 http://www.eclipse.org/legal/epl-2.0 7 8 SPDX-License-Identifier: EPL-2.0 9 10 Contributors: 11 Evgeny Mandrikov - initial API and implementation 12--> 13<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"> 14 <modelVersion>4.0.0</modelVersion> 15 16 <parent> 17 <groupId>org.jacoco</groupId> 18 <artifactId>org.jacoco.build</artifactId> 19 <version>0.8.7</version> 20 <relativePath>../org.jacoco.build</relativePath> 21 </parent> 22 23 <artifactId>org.jacoco.ant</artifactId> 24 25 <name>JaCoCo :: Ant</name> 26 <description>JaCoCo Ant Tasks</description> 27 28 <dependencies> 29 <dependency> 30 <groupId>${project.groupId}</groupId> 31 <artifactId>org.jacoco.core</artifactId> 32 </dependency> 33 <dependency> 34 <groupId>${project.groupId}</groupId> 35 <artifactId>org.jacoco.report</artifactId> 36 </dependency> 37 <dependency> 38 <groupId>${project.groupId}</groupId> 39 <artifactId>org.jacoco.agent</artifactId> 40 </dependency> 41 <dependency> 42 <groupId>org.apache.ant</groupId> 43 <artifactId>ant</artifactId> 44 <scope>provided</scope> 45 </dependency> 46 </dependencies> 47 48 <build> 49 <sourceDirectory>src</sourceDirectory> 50 51 <plugins> 52 <plugin> 53 <groupId>org.apache.maven.plugins</groupId> 54 <artifactId>maven-shade-plugin</artifactId> 55 <executions> 56 <execution> 57 <phase>package</phase> 58 <goals> 59 <goal>shade</goal> 60 </goals> 61 <configuration> 62 <shadedArtifactAttached>true</shadedArtifactAttached> 63 <shadedClassifierName>nodeps</shadedClassifierName> 64 <minimizeJar>true</minimizeJar> 65 <relocations> 66 <relocation> 67 <pattern>org.objectweb.asm</pattern> 68 <shadedPattern>org.jacoco.asm</shadedPattern> 69 </relocation> 70 </relocations> 71 <filters> 72 <filter> 73 <artifact>org.ow2.asm:*</artifact> 74 <excludes> 75 <exclude>module-info.class</exclude> 76 </excludes> 77 </filter> 78 </filters> 79 <transformers> 80 <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> 81 <manifestEntries> 82 <Implementation-Title>${project.description}</Implementation-Title> 83 <Implementation-Vendor>${project.organization.name}</Implementation-Vendor> 84 <Implementation-Version>${project.version}</Implementation-Version> 85 </manifestEntries> 86 </transformer> 87 </transformers> 88 </configuration> 89 </execution> 90 </executions> 91 </plugin> 92 93 <plugin> 94 <groupId>org.apache.felix</groupId> 95 <artifactId>maven-bundle-plugin</artifactId> 96 <executions> 97 <execution> 98 <!-- 99 None of resource tranformers from maven-shade-plugin 100 (including combination of DontIncludeResourceTransformer and ManifestResourceTransformer) 101 does not allow us to leave only desired entries and remove others from META-INF/MANIFEST.MF 102 So we use goal "bundle" instead of "manifest". 103 This introduces some redundant operations, but their cost is negligible. 104 --> 105 <phase>package</phase> 106 <goals> 107 <goal>bundle</goal> 108 </goals> 109 <configuration> 110 <excludeDependencies>true</excludeDependencies> 111 <instructions> 112 <Require-Bundle>org.apache.ant;bundle-version="[1.7.0,2.0.0)"</Require-Bundle> 113 </instructions> 114 </configuration> 115 </execution> 116 </executions> 117 </plugin> 118 </plugins> 119 </build> 120</project> 121