pom.xml 8.42 KB
<?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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <artifactId>alfresco-trashcan-cleaner</artifactId>
    <version>2.1-SNAPSHOT</version>
    <name>alfresco-trashcan-cleaner project</name>
    <packaging>jar</packaging>
    <description>The Alfresco Trash Can Cleaner (Alfresco Module)</description>

    <parent>
        <groupId>org.alfresco</groupId>
        <artifactId>alfresco-super-pom</artifactId>
        <version>7</version>
    </parent>

    <properties>
        <!-- Defines the alfresco edition to compile against. Allowed values 
            are [org.alfresco|org.alfresco.enterprise] -->
        <alfresco.groupId>org.alfresco</alfresco.groupId>
        <!-- Defines the alfresco version to compile against -->
        <alfresco.version>5.2.1-SNAPSHOT</alfresco.version>

        <db.drop.command>drop database if exists ${db.name}</db.drop.command>
        <db.create.command>create database ${db.name}</db.create.command>
        <db.driver>org.postgresql.Driver</db.driver>
        <db.name>alfresco</db.name>
        <db.url>jdbc:postgresql:${db.name}</db.url>
        <db.master.url>jdbc:postgresql:template1</db.master.url>
        <db.master.username>alfresco</db.master.username>
        <db.master.password>alfresco</db.master.password>
    </properties>

    <!-- Here we realize the connection with the Alfresco selected platform 
        (e.g.version and edition) -->
    <dependencyManagement>
        <dependencies>
            <!-- This will import the dependencyManagement for all artifacts 
                in the selected Alfresco version/edition (see http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Importing_Dependencies) 
                NOTE: You still need to define dependencies in your POM, but you can omit 
                version as it's enforced by this dependencyManagement. NOTE: It defaults 
                to the latest version this SDK pom has been tested with, but alfresco version 
                can/should be overridden in your project's pom -->
            <dependency>
                <groupId>${alfresco.groupId}</groupId>
                <artifactId>alfresco-platform-distribution</artifactId>
                <version>${alfresco.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <!-- Following dependencies are needed for compiling Java code in src/main/java; 
        <scope>provided</scope> is inherited for each of the following; for more 
        info, please refer to alfresco-platform-distribution POM -->
    <dependencies>
        <dependency>
            <groupId>${alfresco.groupId}</groupId>
            <artifactId>alfresco-repository</artifactId>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.5</version>
            <scope>provided</scope>
        </dependency>
        <!-- Test dependencies -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>xml-apis</groupId>
            <artifactId>xml-apis</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <resources>
            <resource>
                <filtering>true</filtering>
                <directory>src/main/config</directory>
            </resource>
        </resources>

        <pluginManagement>
            <plugins>
                <!--This plugin's configuration is used to store Eclipse 
                    m2e settings only. It has no influence on the Maven build itself. -->
                <plugin>
                    <groupId>org.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>org.codehaus.mojo</groupId>
                                        <artifactId>sql-maven-plugin</artifactId>
                                        <versionRange>[1.5,)</versionRange>
                                        <goals>
                                            <goal>execute</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore></ignore>
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

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

    <profiles>
        <profile>
            <!-- Wipe the database before starting tests -->
            <id>wipe-db</id>
            <activation>
                <property>
                    <name>wipeDB</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>sql-maven-plugin</artifactId>
                        <dependencies>
                            <dependency>
                                <groupId>org.postgresql</groupId>
                                <artifactId>postgresql</artifactId>
                                <version>${dependency.postgresql.version}</version>
                            </dependency>
                        </dependencies>
                        <configuration>
                            <skip>${db.skip}</skip>
                            <autocommit>true</autocommit>
                            <driver>${db.driver}</driver>
                            <url>${db.master.url}</url>
                            <username>${db.master.username}</username>
                            <password>${db.master.password}</password>
                        </configuration>
                        <executions>
                            <execution>
                                <id>drop-db</id>
                                <phase>initialize</phase>
                                <goals>
                                    <goal>execute</goal>
                                </goals>
                                <configuration>
                                    <skip>false</skip><!-- always run -->
                                    <sqlCommand>${db.drop.command}</sqlCommand>
                                </configuration>
                            </execution>
                            <execution>
                                <id>create-db</id>
                                <phase>initialize</phase>
                                <goals>
                                    <goal>execute</goal>
                                </goals>
                                <configuration>
                                    <skip>false</skip><!-- always run -->
                                    <sqlCommand>${db.create.command}</sqlCommand>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>