<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>org.alfresco.integrations</groupId>
    <artifactId>alfresco-googledrive</artifactId>
    <name>Alfresco / Google Drive Parent</name>
    <version>5.0.0</version>
    <packaging>pom</packaging>

    <scm>
        <connection>scm:git:https://github.com/Alfresco/googledrive.git</connection>
        <developerConnection>scm:git:https://github.com/Alfresco/googledrive.git
        </developerConnection>
        <url>https://github.com/Alfresco/googledrive</url>
        <tag>5.0.0</tag>
    </scm>

    <distributionManagement>
        <repository>
            <id>alfresco-public</id>
            <url>https://artifacts.alfresco.com/nexus/content/repositories/releases</url>
        </repository>
        <snapshotRepository>
            <id>alfresco-public-snapshots</id>
            <url>https://artifacts.alfresco.com/nexus/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>

    <properties>
        <!-- Override the Java 21 inherited from the ACS parent so the AMP also runs on the ACS 25.x family
             (JRE 17). Switch to 21 once 25.x support ends. -->
        <java.version>17</java.version>
        <maven.compiler.source>${java.version}</maven.compiler.source>
        <maven.compiler.target>${java.version}</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <buildnumber>local</buildnumber>
        
        <dependency.community.repo.version>26.3.0.19</dependency.community.repo.version>
        <dependency.share.version>26.3.0.17</dependency.share.version>
        <acs.version>latest</acs.version>

        <org.springframework.social-google-version>1.0.0.RELEASE</org.springframework.social-google-version>
        <alfresco.min.version>6.2.0</alfresco.min.version>

        <alfresco.google.config.version>1.0.1</alfresco.google.config.version>

        <app.filtering.enabled>true</app.filtering.enabled>
        <app.amp.folder>src/main/amp</app.amp.folder>
        <app.amp.output.folder>../${project.build.finalName}</app.amp.output.folder>

        <amp.classifier />
        <gdrive.repo.dockerfile>Dockerfile</gdrive.repo.dockerfile>
    </properties>
    
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.alfresco</groupId>
                <artifactId>alfresco-community-repo</artifactId>
                <version>${dependency.community.repo.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <!-- Default (zero-dependency) AMP: declares no platform libraries; the Drive SDK is inherited as
         'provided' from alfresco-repository so nothing is bundled. See README ("AMP variants"). -->

    <repositories>
        <repository>
            <id>alfresco-public</id>
            <url>https://artifacts.alfresco.com/nexus/content/groups/public</url>
        </repository>
    </repositories>

    <pluginRepositories>
        <pluginRepository>
            <id>alfresco-public</id>
            <url>https://artifacts.alfresco.com/nexus/content/groups/public</url>
        </pluginRepository>
    </pluginRepositories>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.8.1</version>
                    <configuration>
                        <source>${maven.compiler.source}</source>
                        <target>${maven.compiler.target}</target>
                        <encoding>${project.build.sourceEncoding}</encoding>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>2.5.3</version>
                    <configuration>
                        <tagNameFormat>@{project.version}</tagNameFormat>
                        <useReleaseProfile>false</useReleaseProfile>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.alfresco.maven.plugin</groupId>
                    <artifactId>alfresco-maven-plugin</artifactId>
                    <version>2.0.0</version>
                    <extensions>true</extensions>
                    <configuration>
                        <snapshotToTimestamp>true</snapshotToTimestamp>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>io.fabric8</groupId>
                    <artifactId>docker-maven-plugin</artifactId>
                    <version>0.48.1</version>
                    <configuration>
                        <!--<verbose>true</verbose>-->
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>2.8.2</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>3.0.0-M4</version>
                    <configuration>
                        <forkCount>1</forkCount>
                        <reuseForks>true</reuseForks>
                    </configuration>
                    <executions>
                        <execution>
                            <id>default-test</id>
                            <goals>
                                <goal>test</goal>
                            </goals>
                            <phase>test</phase>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>3.0.0-M4</version>
                    <configuration>
                        <forkCount>1</forkCount>
                        <reuseForks>true</reuseForks>
                    </configuration>
                    <executions>
                        <execution>
                            <goals>
                                <goal>integration-test</goal>
                                <goal>verify</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>3.1.2</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>3.1.0</version>
                </plugin>
            </plugins>
        </pluginManagement>

        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>${app.filtering.enabled}</filtering>
            </resource>
            <resource>
                <directory>${app.amp.folder}</directory>
                <targetPath>${app.amp.output.folder}</targetPath>
                <filtering>${app.filtering.enabled}</filtering>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <version>2.0.1.alfresco-1</version>
                <executions>
                    <execution>
                        <id>third-party-licenses</id>
                        <goals>
                            <goal>add-third-party</goal>
                        </goals>
                        <phase>generate-resources</phase>
                        <configuration>
                            <failOnMissing>true</failOnMissing>
                            <excludedScopes>provided,test</excludedScopes>
                            <excludedGroups>org.alfresco</excludedGroups>
                            <failIfWarning>true</failIfWarning>
                            <includedLicenses>https://raw.githubusercontent.com/Alfresco/third-party-license-overrides/master/includedLicenses.txt</includedLicenses>
                            <licenseMergesUrl>https://raw.githubusercontent.com/Alfresco/third-party-license-overrides/master/licenseMerges.txt</licenseMergesUrl>
                            <overrideUrl>https://raw.githubusercontent.com/Alfresco/third-party-license-overrides/master/override-THIRD-PARTY.properties</overrideUrl>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.0.1</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <modules>
        <module>alfresco-googledrive-repo-base</module>
        <module>alfresco-googledrive-repo-enterprise</module>
        <module>alfresco-googledrive-repo-community</module>
        <module>alfresco-googledrive-share</module>
        <module>alfresco-googledrive-end-to-end-tests</module>
    </modules>

    <profiles>
        <!-- Bundled AMP variant: self-contained SDK for ACS versions that do not ship it. See README. -->
        <profile>
            <id>bundled</id>
            <properties>
                <amp.classifier>+bundled</amp.classifier>
                <gdrive.repo.dockerfile>Dockerfile-bundled</gdrive.repo.dockerfile>
                <acs.version>26.2.1</acs.version>
            </properties>
            <!-- Kept 'provided' so their transitive copies are not bundled alongside the 'compile' SDK.
                 Versions come from the community-repo BOM except the annotation jars, which it omits. -->
            <dependencies>
                <dependency>
                    <groupId>com.google.guava</groupId>
                    <artifactId>guava</artifactId>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>org.apache.httpcomponents</groupId>
                    <artifactId>httpclient</artifactId>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>org.apache.httpcomponents</groupId>
                    <artifactId>httpcore</artifactId>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>com.fasterxml.jackson.core</groupId>
                    <artifactId>jackson-core</artifactId>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>commons-codec</groupId>
                    <artifactId>commons-codec</artifactId>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>com.google.j2objc</groupId>
                    <artifactId>j2objc-annotations</artifactId>
                    <version>3.0.0</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>com.google.errorprone</groupId>
                    <artifactId>error_prone_annotations</artifactId>
                    <version>2.28.0</version>
                    <scope>provided</scope>
                </dependency>
            </dependencies>
            <build>
                <plugins>
                    <!-- Bundled variant ships the SDK on purpose, so skip the zero-dependency guard test. -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <excludes>
                                <exclude>**/AmpAddsNoThirdPartyLibrariesTest.java</exclude>
                            </excludes>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
