<?xml version="1.0" encoding="UTF-8"?>
<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">
  <parent>
    <artifactId>parent</artifactId>
    <groupId>com.yahoo.vespa</groupId>
    <version>8.131.17</version>
    <relativePath>../parent/pom.xml</relativePath>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>container-spifly</artifactId>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
      </plugin>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <minimizeJar>false</minimizeJar>
              <filters>
                <filter>
                  <artifact>*:*</artifact>
                  <excludes>
                    <exclude>module-info.class</exclude>
                    <exclude>META-INF/*</exclude>
                  </excludes>
                </filter>
              </filters>
              <relocations>
                <relocation>
                  <pattern>org.apache.aries.spifly</pattern>
                  <shadedPattern>${relocation-pkg-prefix}.spifly</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>aQute</pattern>
                  <shadedPattern>${relocation-pkg-prefix}.aQute</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.objectweb.asm</pattern>
                  <shadedPattern>${relocation-pkg-prefix}.asm</shadedPattern>
                </relocation>
              </relocations>
              <transformers>
                <transformer>
                  <manifestEntries>
                    <Bundle-Name>container-spifly</Bundle-Name>
                    <Bundle-SymbolicName>container-spifly</Bundle-SymbolicName>
                    <Bundle-Version>${spifly.version}</Bundle-Version>
                    <Export-Package>${relocation-pkg-prefix}.spifly;version="${spifly.version}",
                                            ${relocation-pkg-prefix}.spifly.dynamic;version="${spifly.version}",
                                            ${relocation-pkg-prefix}.spifly.weaver;version="${spifly.version}"</Export-Package>
                    <Import-Package>org.osgi.framework;version="[1.7,2)",
                                            org.osgi.framework.hooks.weaving;version="[1.0,2)",
                                            org.osgi.framework.wiring;version="[1.1,2)",
                                            org.osgi.util.tracker;version="[1.5,2)"</Import-Package>
                    <Require-Capability>osgi.ee</Require-Capability>
                    <Provide-Capability>osgi.extender;osgi.extender="osgi.serviceloader.registrar";version:Version="1.0",
                                            osgi.extender;osgi.extender="osgi.serviceloader.processor";version:Version="1.0";uses:="${relocation-pkg-prefix}.spifly"</Provide-Capability>
                    <Bundle-Activator>${relocation-pkg-prefix}.spifly.dynamic.DynamicWeavingActivator</Bundle-Activator>
                  </manifestEntries>
                </transformer>
              </transformers>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <properties>
    <relocation-pkg-prefix>com.yahoo.vespa.spifly.repackaged</relocation-pkg-prefix>
  </properties>
</project>
