<?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>

    <parent>
        <groupId>org.apache.aries</groupId>
        <artifactId>parent</artifactId>
        <version>3.2.0</version>
        <relativePath>../../parent/pom.xml</relativePath>
    </parent>

    <groupId>org.apache.aries.proxy</groupId>
    <artifactId>org.apache.aries.proxy</artifactId>
    <packaging>bundle</packaging>
    <name>Apache Aries Proxy Service</name>
    <version>2.0.0</version>
    <description>
        This bundle contains the proxy service implementation for Apache Aries
    </description>

    <scm>
        <connection>scm:git:git@github.com:apache/aries.git</connection>
        <developerConnection>scm:git:git@github.com:apache/aries.git</developerConnection>
        <url>https://github.com/apache/aries</url>
        <tag>org.apache.aries.proxy-2.0.0</tag>
    </scm>

    <properties>
        <aries.javadoc.doclint>none</aries.javadoc.doclint>
        <aries.osgi.export.pkg>
            org.apache.aries.proxy;,
            org.apache.aries.proxy.weaving;,
            org.apache.aries.proxy.weavinghook;
        </aries.osgi.export.pkg>
        <aries.osgi.activator>
            org.apache.aries.proxy.impl.ProxyManagerActivator
        </aries.osgi.activator>
        <aries.osgi.import.pkg>
            org.apache.aries.proxy.weavinghook;resolution:=optional;provide:=true,
            org.apache.aries.proxy*;provide:=true,
            org.objectweb.asm*;resolution:=optional;version="[9,10)",
            sun.reflect*;resolution:=optional,
            *
        </aries.osgi.import.pkg>
        <aries.osgi.private.pkg>
            org.apache.aries.proxy.impl*
        </aries.osgi.private.pkg>
        <org.apache.aries.versioning.plugin.version>0.4.0</org.apache.aries.versioning.plugin.version>
        <lastReleaseVersion>1.1.14</lastReleaseVersion>
        <aries.skip.version.check>true</aries.skip.version.check>

        <asm.version>9.11</asm.version>
        <commons-io.version>2.22.0</commons-io.version>
        <geronimo-j2ee-connector_1.6_spec.version>1.0</geronimo-j2ee-connector_1.6_spec.version>
        <javax.transaction-api.version>1.3</javax.transaction-api.version>
        <junit.version>4.13.2</junit.version>
        <mockito-core.version>4.11.0</mockito-core.version>
        <objenesis.version>3.6</objenesis.version>
        <org.apache.aries.proxy.api.version>1.1.2</org.apache.aries.proxy.api.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.apache.aries.proxy</groupId>
            <artifactId>org.apache.aries.proxy.api</artifactId>
            <version>${org.apache.aries.proxy.api.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.objenesis</groupId>
            <artifactId>objenesis</artifactId>
            <version>${objenesis.version}</version>
        </dependency>
        <dependency>
            <groupId>org.ow2.asm</groupId>
            <artifactId>asm</artifactId>
            <optional>true</optional>
            <version>${asm.version}</version>
        </dependency>
        <dependency>
            <groupId>org.ow2.asm</groupId>
            <artifactId>asm-commons</artifactId>
            <optional>true</optional>
            <version>${asm.version}</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${slf4j.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>osgi.core</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>osgi.cmpn</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>${commons-io.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>${mockito-core.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>javax.transaction</groupId>
            <artifactId>javax.transaction-api</artifactId>
            <version>${javax.transaction-api.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.geronimo.specs</groupId>
            <artifactId>geronimo-j2ee-connector_1.6_spec</artifactId>
            <version>${geronimo-j2ee-connector_1.6_spec.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <configuration>
                    <instructions>
                        <Provide-Capability>
                            osgi.service;objectClass:List&lt;String&gt;=org.apache.aries.proxy.ProxyManager
                        </Provide-Capability>
                    </instructions>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>java9To27</id>
            <activation>
                <jdk>(8,28)</jdk>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <!-- necessary for making method defineClass accessible -->
                            <argLine>
                                --add-opens java.base/java.lang=ALL-UNNAMED
                            </argLine>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>java8To17</id>
            <activation>
                <jdk>[1.8,18)</jdk>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <executions>
                            <execution>
                                <phase>process-classes</phase>
                                <configuration>
                                    <target>
                                        <!-- run the Synthesizer on the WovenProxy class -->
                                        <java classname="org.apache.aries.proxy.synthesizer.Synthesizer" classpathref="maven.runtime.classpath" fork="false">
                                            <arg value="${project.build.outputDirectory}/org/apache/aries/proxy/weaving/WovenProxy.class" />
                                        </java>
                                        <delete dir="${project.build.outputDirectory}/org/apache/aries/proxy/synthesizer" />
                                    </target>
                                </configuration>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>java21</id>
            <activation>
                <jdk>21</jdk>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <executions>
                            <execution>
                                <phase>process-classes</phase>
                                <configuration>
                                    <target>
                                        <!-- run the Synthesizer on the WovenProxy class -->
                                        <!-- diff from previous java versions: fork and jvmarg -->
                                        <java classname="org.apache.aries.proxy.synthesizer.Synthesizer" classpathref="maven.runtime.classpath" fork="true">
                                            <jvmarg value="-Djava.security.manager=allow" />
                                            <arg value="${project.build.outputDirectory}/org/apache/aries/proxy/weaving/WovenProxy.class" />
                                        </java>
                                        <delete dir="${project.build.outputDirectory}/org/apache/aries/proxy/synthesizer" />
                                    </target>
                                </configuration>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>java25To27</id>
            <activation>
                <jdk>(24,28)</jdk>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <executions>
                            <execution>
                                <phase>process-classes</phase>
                                <configuration>
                                    <target>
                                        <!-- run the Synthesizer on the WovenProxy class -->
                                        <!-- diff from previous java versions: fork and jvmarg -->
                                        <java classname="org.apache.aries.proxy.synthesizer.Synthesizer" classpathref="maven.runtime.classpath" fork="true">
                                            <arg value="${project.build.outputDirectory}/org/apache/aries/proxy/weaving/WovenProxy.class" />
                                        </java>
                                        <delete dir="${project.build.outputDirectory}/org/apache/aries/proxy/synthesizer" />
                                    </target>
                                </configuration>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
