<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.jboss</groupId>
        <artifactId>jboss-parent</artifactId>
        <version>20</version>
        <relativePath />
    </parent>

    <groupId>org.fcrepo</groupId>
    <artifactId>modeshape</artifactId>
    <version>5.5.1.fcr</version>

    <packaging>pom</packaging>
    <name>ModeShape</name>
    <description>Builds the entire ModeShape distribution.</description>

    <licenses>
        <license>
            <name>Apache Software License 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <scm>
        <connection>scm:git:git://github.com/ModeShape/modeshape.git</connection>
        <developerConnection>scm:git:git@github.com:ModeShape/modeshape.git</developerConnection>
        <url>http://github.com/ModeShape/modeshape</url>
      <tag>modeshape-5.5.1.fcr</tag>
  </scm>

    <modules>
        <!-- Order is important -->

        <!-- First these -->
        <module>checkstyle</module>
        <module>modeshape-parent</module>
        <module>modeshape-assembly-descriptors</module>
        <!-- Order is important -->
        <module>modeshape-jcr-api</module>
        <module>modeshape-common</module>
        <module>modeshape-schematic</module>
        <module>persistence</module>
        <module>modeshape-jcr</module>
        <module>modeshape-unit-test</module>
        <module>sequencers</module>
        <module>extractors</module>
        <module>index-providers</module>

        <!--Connectors-->
        <module>connectors</module>
        <!--
          The REST client needs the JDBC driver
        -->
        <module>web</module>
        <module>modeshape-jdbc-local</module>
        <module>modeshape-jdbc</module>
        <!-- 
          JCA Resource adapter
        -->
        <module>modeshape-jca</module>

        <module>deploy</module>
        <module>modeshape-distribution</module>

        <!-- Finally the BOMs -->
        <module>boms/modeshape-bom-embedded</module>
        <module>boms/modeshape-bom-jbossas</module>
        <module>boms/modeshape-bom-remote-client</module>
    </modules>
    <properties>
        <rootDir>${project.basedir}</rootDir>
        <gpg.plugin.version>1.6</gpg.plugin.version>
    </properties>

    <profiles>
        <!-- 
          This profile is used to run the build plus the integration tests
            and must be activated manually, as in "mvn ... -Pintegration ..."
        -->
        <profile>
            <id>integration</id>
            <modules>
              <!-- 
                Build the distribution before running the integration tests, 
                as some of the integration tests rely upon the distributions
              -->
                <module>integration</module>
            </modules>
        </profile>
        
        <!-- 
          This profile is used to run longer-running performance tests,
          and must be activated manually, as in "mvn ... -Pperformance ..."
        -->
        <profile>
            <id>performance</id>
            <modules>
                <!--
                    The JBoss AS7 subsystem needs the web components and (local) JDBC drivers.
                -->
                <module>modeshape-performance-tests</module>
            </modules>
        </profile>

        <profile>
            <id>persistence-integration</id>
            <modules>
                <module>modeshape-persistence-tests</module>
            </modules>
        </profile>
                        
        <!-- 
          This profile is used to build everything for a release, including all assemblies,
            and must be activated manually, as in "mvn ... -Passembly ..."
        -->
        <profile>
            <id>assembly</id>
            <modules>
                <module>modeshape-jca-rar</module>
                <module>modeshape-client</module>
                <module>integration</module>
            </modules>
        </profile>

        <profile>
            <id>release-sign-artifacts</id>
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-javadoc-plugin</artifactId>
                        </plugin>
                        <plugin>
                            <artifactId>maven-gpg-plugin</artifactId>
                            <version>${gpg.plugin.version}</version>
                            <executions>
                                <execution>
                                    <id>sign-artifacts</id>
                                    <phase>verify</phase>
                                    <goals>
                                        <goal>sign</goal>
                                    </goals>
                                </execution>
                            </executions>
                            <configuration>
                                <useAgent>true</useAgent>
                                <!-- https://github.com/actions/setup-java/issues/91 -->
                                <gpgArguments>
                                    <arg>--pinentry-mode</arg>
                                    <arg>loopback</arg>
                                </gpgArguments>
                                <!-- This is needed for github actions -->
                                <passphraseServerId>gpg.passphrase</passphraseServerId>
                            </configuration>
                        </plugin>
                    </plugins>
                </pluginManagement>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

    <distributionManagement>
        <snapshotRepository>
            <id>sonatype-nexus-snapshots</id>
            <name>Sonatype Nexus Shapshots</name>
            <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
        </snapshotRepository>
        <repository>
            <id>sonatype-nexus-staging</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>
</project>
