<?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.felix</groupId>
        <artifactId>felix-parent</artifactId>
        <version>9</version>
        <relativePath />
    </parent>

    <artifactId>dependencymanager-parent</artifactId>
    <version>1.0.2</version>
    <packaging>pom</packaging>

    <name>Apache Felix Dependency Manager (parent)</name>
    <description>Apache Felix Dependency Manager Subproject</description>
    <url>https://felix.apache.org/</url>

    <scm>
        <connection>scm:git:https://github.com/apache/felix-dev.git</connection>
        <developerConnection>scm:git:https://github.com/apache/felix-dev.git</developerConnection>
        <url>https://gitbox.apache.org/repos/asf?p=felix-dev.git;f=dependencymanager</url>
        <tag>dependencymanager-parent-1.0.2</tag>
    </scm>

    <modules>
        <module>org.apache.felix.dependencymanager</module>
        <module>org.apache.felix.dependencymanager.annotation</module>
        <module>org.apache.felix.dependencymanager.runtime</module>
        <module>org.apache.felix.dependencymanager.shell</module>
        <module>org.apache.felix.dependencymanager.lambda</module>
        <module>org.apache.felix.dependencymanager.itest.bundle</module>
        <module>org.apache.felix.dependencymanager.itest.bundle2</module>
        <module>org.apache.felix.dependencymanager.itest.api</module>
        <module>org.apache.felix.dependencymanager.index.itest.dynamic.customindex</module>
        <module>org.apache.felix.dependencymanager.index.itest.static.customindex</module>
        <module>org.apache.felix.dependencymanager.index.itest.tests</module>
        <module>org.apache.felix.dependencymanager.index.itest.refresh.bundle</module>
        <module>org.apache.felix.dependencymanager.index.itest.refresh.tests</module>
        <module>org.apache.felix.dependencymanager.lambda.itest.lifecycle</module>
        <module>org.apache.felix.dependencymanager.lambda.itest.tests</module>
        <module>org.apache.felix.dependencymanager.runtime.itest</module>
        <module>org.apache.felix.dependencymanager.samples</module>
        <module>org.apache.felix.dependencymanager.lambda.samples</module>
        <module>org.apache.felix.dependencymanager.benchmark</module>
    </modules>

    <properties>
        <felix.java.version>11</felix.java.version>
        <project.build.outputTimestamp>2026-11-26T15:09:04Z</project.build.outputTimestamp>
        <!-- compile against the OSGi R6 API, the lowest one supported, so the imports stay as they were in r16 -->
        <osgi.core.version>6.0.0</osgi.core.version>
        <osgi.cmpn.version>6.0.0</osgi.cmpn.version>
        <osgi.annotation.version>6.0.1</osgi.annotation.version>
        <junit.version>4.13.2</junit.version>
        <mockito.version>5.24.0</mockito.version>
        <bnd.version>7.4.0</bnd.version>
        <gogo.runtime.version>1.2.0</gogo.runtime.version>
        <gogo.shell.version>1.1.4</gogo.shell.version>
        <gogo.command.version>1.1.2</gogo.command.version>
        <configadmin.version>1.10.0</configadmin.version>
        <framework.version>8.0.0</framework.version>
        <log.version>1.3.2</log.version>
        <metatype.version>1.2.4</metatype.version>
        <servicemix.junit.version>4.13.2_1</servicemix.junit.version>
        <!-- mvn -N exec:exec@release-plan -Dplan.only=true only prints the plan, and changes nothing -->
        <plan.only>false</plan.only>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.osgi</groupId>
                <artifactId>osgi.core</artifactId>
                <version>${osgi.core.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.osgi</groupId>
                <artifactId>osgi.cmpn</artifactId>
                <version>${osgi.cmpn.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.osgi</groupId>
                <artifactId>osgi.annotation</artifactId>
                <version>${osgi.annotation.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>${junit.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>${mockito.version}</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.rat</groupId>
                    <artifactId>apache-rat-plugin</artifactId>
                    <configuration>
                        <excludes combine.children="append">
                            <!-- one line files holding the version of a package -->
                            <exclude>**/packageinfo</exclude>
                        </excludes>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <configuration>
                        <!-- the existing javadoc has doclint errors, which would fail the release -->
                        <doclint>none</doclint>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.felix</groupId>
                    <artifactId>maven-bundle-plugin</artifactId>
                    <version>6.0.2</version>
                    <extensions>true</extensions>
                    <configuration>
                        <instructions>
                            <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
                            <Bundle-Vendor>The Apache Software Foundation</Bundle-Vendor>
                            <Bundle-Category>osgi</Bundle-Category>
                            <Bundle-License>https://www.apache.org/licenses/LICENSE-2.0.txt</Bundle-License>
                            <_reproducible>true</_reproducible>
                            <_removeheaders>Bnd-LastModified,Tool,Created-By</_removeheaders>
                        </instructions>
                    </configuration>
                    <executions>
                        <execution>
                            <id>baseline</id>
                            <goals>
                                <goal>baseline</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>biz.aQute.bnd</groupId>
                    <artifactId>bnd-maven-plugin</artifactId>
                    <version>${bnd.version}</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>bnd-process</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>biz.aQute.bnd</groupId>
                    <artifactId>bnd-testing-maven-plugin</artifactId>
                    <version>${bnd.version}</version>
                    <configuration>
                        <resolve>true</resolve>
                        <failOnChanges>false</failOnChanges>
                    </configuration>
                    <executions>
                        <execution>
                            <goals>
                                <goal>testing</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <version>3.1.0</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>exec-maven-plugin</artifactId>
                    <version>3.5.0</version>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <!-- releases the bundles that changed, and asks what it needs: mvn -N exec:exec@release-plan -->
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <inherited>false</inherited>
                <executions>
                    <execution>
                        <id>release-plan</id>
                        <configuration>
                            <executable>${java.home}/bin/java</executable>
                            <!-- the program reads from the console, and runs Maven itself -->
                            <inheritIo>true</inheritIo>
                            <successCodes>
                                <successCode>0</successCode>
                                <successCode>3</successCode>
                            </successCodes>
                            <arguments>
                                <argument>-Dmaven.home=${maven.home}</argument>
                                <argument>-Dplan.only=${plan.only}</argument>
                                <argument>${project.basedir}/release/ReleasePlan.java</argument>
                            </arguments>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <!--
                The release plugin makes one tag for the whole reactor (dependencymanager-parent-x.y.z). The bundles
                are versioned and released separately though, so while performing a release (release:perform
                builds the tag that was just made, with the apache-release profile of the Felix parent pom, which
                this profile adds to; the profile is not activated by performRelease, as the release plugin 3.x
                does not set that):
                - a bundle whose version was released before, which is a bundle that did not change, is not deployed,
                - and a bundle that is deployed is tagged as <artifactId>-<version>, like the earlier releases.
                Only the bundles that list the antrun plugin in their build take part, see also release/ReleasePlan.java.
            -->
            <id>apache-release</id>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-antrun-plugin</artifactId>
                            <executions>
                                <execution>
                                    <id>skip-released-bundle</id>
                                    <phase>initialize</phase>
                                    <goals>
                                        <goal>run</goal>
                                    </goals>
                                    <configuration>
                                        <exportAntProperties>true</exportAntProperties>
                                        <target xmlns:if="ant:if">
                                            <!--
                                                A tag of this version on another commit than the one being released
                                                is from an earlier release: the bundle did not change and is skipped.
                                                A tag on this commit is from an earlier attempt of this perform. It
                                                does not count, as the bundle may not have made it to the staging
                                                repository.
                                            -->
                                            <exec executable="git" resultproperty="dm.head.rc" outputproperty="dm.head" failonerror="false">
                                                <arg value="rev-parse" />
                                                <arg value="HEAD" />
                                            </exec>
                                            <exec executable="git" resultproperty="dm.released.rc" outputproperty="dm.released.tag" failonerror="false">
                                                <arg value="ls-remote" />
                                                <arg value="--tags" />
                                                <arg value="origin" />
                                                <arg value="refs/tags/${project.artifactId}-${project.version}" />
                                            </exec>
                                            <fail message="Cannot find out if ${project.artifactId}-${project.version} was released before (git exit codes ${dm.head.rc} and ${dm.released.rc})">
                                                <condition>
                                                    <or>
                                                        <not>
                                                            <equals arg1="${dm.head.rc}" arg2="0" />
                                                        </not>
                                                        <not>
                                                            <equals arg1="${dm.released.rc}" arg2="0" />
                                                        </not>
                                                    </or>
                                                </condition>
                                            </fail>
                                            <condition property="maven.deploy.skip" value="true">
                                                <and>
                                                    <length string="${dm.released.tag}" when="greater" length="0" />
                                                    <not>
                                                        <contains string="${dm.released.tag}" substring="${dm.head}" />
                                                    </not>
                                                </and>
                                            </condition>
                                            <!-- no tag for a bundle that is not deployed, nor for a snapshot -->
                                            <condition property="dm.tag.skip" value="true">
                                                <or>
                                                    <istrue value="${maven.deploy.skip}" />
                                                    <contains string="${project.version}" substring="-SNAPSHOT" />
                                                </or>
                                            </condition>
                                            <echo level="info" if:true="${maven.deploy.skip}">${project.artifactId}-${project.version} was released before, it is not deployed again</echo>
                                        </target>
                                    </configuration>
                                </execution>
                                <execution>
                                    <id>tag-bundle</id>
                                    <phase>deploy</phase>
                                    <goals>
                                        <goal>run</goal>
                                    </goals>
                                    <configuration>
                                        <skip>${dm.tag.skip}</skip>
                                        <target>
                                            <exec executable="git" failonerror="true">
                                                <arg value="tag" />
                                                <arg value="-f" />
                                                <arg value="${project.artifactId}-${project.version}" />
                                            </exec>
                                            <exec executable="git" failonerror="true">
                                                <arg value="push" />
                                                <arg value="origin" />
                                                <arg value="refs/tags/${project.artifactId}-${project.version}" />
                                            </exec>
                                        </target>
                                    </configuration>
                                </execution>
                            </executions>
                        </plugin>
                    </plugins>
                </pluginManagement>
            </build>
        </profile>
    </profiles>
</project>
