<?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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>eu.ciechanowiec</groupId>
    <artifactId>google-api-services-admin-directory</artifactId>
    <version>20260227</version>

    <name>Admin SDK API Directory v1</name>
    <description>Shaded OSGi bundle of Admin SDK API Directory v1</description>
    <url>${url}</url>
    <inceptionYear>2025</inceptionYear>

    <licenses>
        <license>
            <name>MIT No Attribution</name>
            <url>https://spdx.org/licenses/MIT-0.html</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>ciechanowiec</id>
            <name>${project.developer.name}</name>
            <email>${project.developer.email}</email>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:git@github.com:ciechanowiec/google-api-services-admin-directory_osgi.git</connection>
        <developerConnection>scm:git:git@github.com:ciechanowiec/google-api-services-admin-directory_osgi.git</developerConnection>
        <tag>${project.artifactId}-${project.version}</tag>
        <url>${url}</url>
    </scm>

    <issueManagement>
        <system>GitHub Issues</system>
        <url>${url}/issues</url>
    </issueManagement>

    <properties>
        <!-- ====================================================================== -->
        <!-- NON_VERSION_PROPS                                                      -->
        <!-- ====================================================================== -->
        <url>https://github.com/ciechanowiec/google-api-services-admin-directory_osgi</url>
        <project.developer.name>Herman Ciechanowiec</project.developer.name>
        <project.developer.email>herman@ciechanowiec.eu</project.developer.email>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.release>25</maven.compiler.release>
        <min.maven.version>3.9.6</min.maven.version>
        <bundle.category>utilities</bundle.category>
        <!-- ====================================================================== -->
        <!-- PLUGINS                                                                -->
        <!-- ====================================================================== -->
        <versions-maven-plugin.version>2.21.0</versions-maven-plugin.version>
        <maven-shade-plugin.version>3.6.2</maven-shade-plugin.version>
        <maven-resources-plugin.version>3.5.0</maven-resources-plugin.version>
        <bnd-maven-plugin.version>7.2.3</bnd-maven-plugin.version>
        <maven-jar-plugin.version>3.5.0</maven-jar-plugin.version>
        <maven-dependency-plugin.version>3.10.0</maven-dependency-plugin.version>
        <maven-antrun-plugin.version>3.2.0</maven-antrun-plugin.version>
        <build-helper-maven-plugin.version>3.6.1</build-helper-maven-plugin.version>
        <gmavenplus-plugin.version>4.3.1</gmavenplus-plugin.version>
        <groovy.version>5.0.5</groovy.version>
        <groovy-ant.version>5.0.5</groovy-ant.version>
        <maven-enforcer-plugin.version>3.6.2</maven-enforcer-plugin.version>
        <maven-deploy-plugin.version>3.1.2</maven-deploy-plugin.version>
        <maven-gpg-plugin.version>3.2.7</maven-gpg-plugin.version>
        <central-publishing-maven-plugin.version>0.7.0</central-publishing-maven-plugin.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.google.apis</groupId>
            <artifactId>google-api-services-admin-directory</artifactId>
            <version>directory_v1-rev${project.version}-2.0.0</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>versions-maven-plugin</artifactId>
                <version>${versions-maven-plugin.version}</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>display-parent-updates</goal>
                            <goal>display-property-updates</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <ruleSet>
                        <ignoreVersions>
                            <ignoreVersion>
                                <!-- Ignoring milestone versions, like 3.0.4-M5 and 1.0.0-m23 -->
                                <type>regex</type>
                                <version>(?i)[0-9].+-m[0-9]+</version>
                            </ignoreVersion>
                            <ignoreVersion>
                                <!-- Ignoring alpha versions, like 5.0.0.Alpha2 and 12.0.0.alpha3 -->
                                <type>regex</type>
                                <version>(?i).*ALPHA.*</version>
                            </ignoreVersion>
                            <ignoreVersion>
                                <!-- Ignoring beta versions, like 5.0.0.Beta2 and 12.0.0.beta3 -->
                                <type>regex</type>
                                <version>(?i).*BETA.*</version>
                            </ignoreVersion>
                            <ignoreVersion>
                                <!-- Ignoring preview versions, like 12.1.0.jre11-preview -->
                                <type>regex</type>
                                <version>(?i).*PREVIEW.*</version>
                            </ignoreVersion>
                            <ignoreVersion>
                                <!-- Ignoring candidate release versions, like 6.2.0.CR2 -->
                                <type>regex</type>
                                <version>(?i)[0-9].+\.CR[0-9]+</version>
                            </ignoreVersion>
                            <ignoreVersion>
                                <!-- Ignoring release candidate versions, like 2.16.1-rc1 and 1.8.20-RC -->
                                <type>regex</type>
                                <version>(?i)[0-9].+-rc[0-9]*</version>
                            </ignoreVersion>
                            <ignoreVersion>
                                <!-- Ignoring develop versions, like 15.0.0.Dev01 -->
                                <type>regex</type>
                                <version>(?i)[0-9].+\.dev[0-9]*</version>
                            </ignoreVersion>
                        </ignoreVersions>
                    </ruleSet>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>${maven-shade-plugin.version}</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <shadedArtifactAttached>true</shadedArtifactAttached>
                            <!--  Must stay not to override a jar created for bnd:  -->
                            <finalName>${project.artifactId}-${project.version}</finalName>
                            <createSourcesJar>true</createSourcesJar>
                            <outputDirectory>${project.build.directory}/shaded</outputDirectory>
                            <artifactSet>
                                <includes>
                                    <include>*:*</include>
                                </includes>
                                <excludes>
                                    <exclude>${project.groupId}:${project.artifactId}</exclude>
                                </excludes>
                            </artifactSet>
                            <filters>
                                <filter>
                                    <artifact>*:*</artifact>
                                    <excludes>
                                        <exclude>META-INF/*</exclude>
                                        <exclude>META-INF/**/*</exclude>
                                        <exclude>OSGI-INF/*</exclude>
                                        <exclude>module-info.class</exclude>
                                        <exclude>module-info.java</exclude>
                                    </excludes>
                                </filter>
                            </filters>
                        </configuration>
                    </execution>
                </executions>
                <configuration>
                    <createDependencyReducedPom>false</createDependencyReducedPom>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>${maven-resources-plugin.version}</version>
                <executions>
                    <execution>
                        <id>copy-license-and-readme-to-jar</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}/classes</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>${project.basedir}</directory>
                                    <includes>
                                        <include>LICENSE.txt</include>
                                        <include>README.adoc</include>
                                        <include>README-docinfo.html</include>
                                        <include>README-docinfo-footer.html</include>
                                    </includes>
                                    <!-- To enable variables in the resources files
                                         (https://maven.apache.org/plugins/maven-resources-plugin/examples/filter.html): -->
                                    <filtering>true</filtering>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>biz.aQute.bnd</groupId>
                <artifactId>bnd-maven-plugin</artifactId>
                <version>${bnd-maven-plugin.version}</version>
                <executions>
                    <execution>
                        <id>bnd-process</id>
                        <goals>
                            <goal>bnd-process</goal>
                        </goals>
                        <configuration>
                            <bnd><![CDATA[
                        Bundle-Category: ${bundle.category}
                        Bundle-Description: ${project.description}
                        Bundle-DocURL: ${url}
                        Bundle-Name: ${project.name}
                        Bundle-SymbolicName: ${project.groupId}.${project.artifactId}
                        Bundle-Vendor: ${project.developer.name}
                        Bundle-Version: ${project.version}
                        Export-Package: com.google.api.services.directory.*;-noimport:=true;-split-package:=merge-first
                        Import-Package: !android.os, \
                                        !io.grpc, \
                                        !com.google.appengine.*, \
                                        !com.google.apphosting.*, \
                                        !org.apache.avalon.*, \
                                        !org.apache.log.*, \
                                        com.google.api.client.http, \
                                        com.google.api.client.json, \
                                        com.google.api.client.util, \
                                        com.google.api.client.googleapis.services, \
                                        com.google.api.client.googleapis.services.json, \
                                        *
                        Private-Package: *;-split-package:=merge-first
                        Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=${maven.compiler.release}))"
                        # reproducible builds (https://github.com/bndtools/bnd/issues/3521)
                        -noextraheaders: true
                                                        ]]></bnd>

                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>${maven-jar-plugin.version}</version>
                <configuration>
                    <archive>
                        <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>${maven-dependency-plugin.version}</version>
                <executions>
                    <execution>
                        <id>unpack-sources</id>
                        <phase>package</phase>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                        <configuration>
                            <excludes>META-INF</excludes>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>${project.groupId}</groupId>
                                    <artifactId>${project.artifactId}</artifactId>
                                    <version>${project.version}</version>
                                    <classifier>shaded-sources</classifier>
                                    <outputDirectory>${project.build.directory}/extracted-sources</outputDirectory>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>${maven-antrun-plugin.version}</version>
                <executions>
                    <execution>
                        <id>adjust-artifacts</id>
                        <phase>package</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <target>
                                <copy file="${project.build.directory}/shaded/${project.build.finalName}-shaded-sources.jar"
                                      tofile="${project.build.directory}/${project.build.finalName}-sources.jar"/>
                                <copy file="${project.build.directory}/${project.build.finalName}-sources.jar"
                                      tofile="${project.build.directory}/${project.build.finalName}-javadoc.jar"/>
                                <delete dir="${project.build.directory}/shaded"/>
                            </target>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>${build-helper-maven-plugin.version}</version>
                <executions>
                    <execution>
                        <id>attach-artifacts</id>
                        <phase>package</phase>
                        <goals>
                            <goal>attach-artifact</goal>
                        </goals>
                        <configuration>
                            <artifacts>
                                <artifact>
                                    <file>${project.build.directory}/${project.build.finalName}-sources.jar</file>
                                    <type>jar</type>
                                    <classifier>sources</classifier>
                                </artifact>
                                <artifact>
                                    <file>${project.build.directory}/${project.build.finalName}-javadoc.jar</file>
                                    <type>jar</type>
                                    <classifier>javadoc</classifier>
                                </artifact>
                            </artifacts>
                        </configuration>
                    </execution>
                    <execution>
                        <id>timestamp-property</id>
                        <goals>
                            <goal>timestamp-property</goal>
                        </goals>
                        <configuration>
                            <name>current.year</name>
                            <pattern>yyyy</pattern>
                            <locale>GB</locale>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.gmavenplus</groupId>
                <artifactId>gmavenplus-plugin</artifactId>
                <version>${gmavenplus-plugin.version}</version>
                <executions>
                    <execution>
                        <id>remove-primary-artefact</id>
                        <phase>package</phase>
                        <goals>
                            <goal>execute</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <scripts>
                        <![CDATA[
                                import org.apache.maven.artifact.Artifact

                                def attachedArtifacts = project.getAttachedArtifacts()
                                def toRemove = attachedArtifacts.findAll { it.classifier?.contains("shaded") }
                                attachedArtifacts.removeAll(toRemove)
                                ]]>
                    </scripts>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.groovy</groupId>
                        <artifactId>groovy</artifactId>
                        <version>${groovy.version}</version>
                        <scope>runtime</scope>
                    </dependency>
                    <dependency>
                        <groupId>org.apache.groovy</groupId>
                        <artifactId>groovy-ant</artifactId>
                        <version>${groovy-ant.version}</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>${maven-enforcer-plugin.version}</version>
                <executions>
                    <execution>
                        <id>enforce-maven-version</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireMavenVersion>
                                    <version>[${min.maven.version},)</version>
                                    <message>Project must be built with Maven ${min.maven.version} or higher</message>
                                </requireMavenVersion>
                            </rules>
                        </configuration>
                    </execution>
                    <execution>
                        <id>enforce-jdk-version</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireJavaVersion>
                                    <version>${maven.compiler.release}</version>
                                    <message>The project requires JDK of ${maven.compiler.release} version</message>
                                </requireJavaVersion>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${maven-gpg-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <configuration>
                                    <signer>bc</signer>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.central</groupId>
                        <artifactId>central-publishing-maven-plugin</artifactId>
                        <version>${central-publishing-maven-plugin.version}</version>
                        <extensions>true</extensions>
                        <configuration>
                            <publishingServerId>central</publishingServerId>
                            <autoPublish>true</autoPublish>
                            <waitUntil>published</waitUntil>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
