pom.xml 8.66 KB
<?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>
    <artifactId>repo</artifactId>
    <name>Alfresco Repository WAR Aggregator</name>
    <packaging>war</packaging>
    <description>Alfresco Repository aggregator, installs your repository AMPs in the Alfresco WAR for aggregation and easy deployment purposes</description>

    <parent>
        <groupId>org.alfresco.skype</groupId>
        <artifactId>alfresco-skype-parent</artifactId>
        <version>1.0-SNAPSHOT</version>
    </parent>

    <properties>
        <!-- During development we set log root level to Debug,
            this will be applicable to the log configuration in
            repo/src/main/resources/alfresco/extension/dev-log4j.properties,
            such as DemoComponent logging. -->
        <app.log.root.level>DEBUG</app.log.root.level>
    </properties>

    <dependencies>
        <dependency>
            <groupId>${alfresco.groupId}</groupId>
            <artifactId>${alfresco.repo.artifactId}</artifactId>
            <version>${alfresco.version}</version>
            <type>war</type>
        </dependency>
        <!-- Demonstrating the dependency / installation of the repo AMP developed in the 'repo-amp' module -->
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>alfresco-skype-repo-amp</artifactId>
            <version>${project.version}</version>
            <type>amp</type>
        </dependency>
        <!-- Uncomment if you are using SPP (SharePoint Protocol Support) for Online Edit etc -->
        <!--
        <dependency>
            <groupId>${alfresco.groupId}</groupId>
            <artifactId>alfresco-spp</artifactId>
            <version>${alfresco.version}</version>
            <type>amp</type>
        </dependency>
        -->
        <!-- Uncomment if you are using the RM (Records Management) module. -->
        <!--
        <dependency>
            <groupId>${alfresco.groupId}</groupId>
            <artifactId>alfresco-rm</artifactId>
            <version>${alfresco.rm.version}</version>
            <type>amp</type>
        </dependency>
        -->
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-war-plugin</artifactId>
                <configuration>
                    <!--  Here is can control the order of overlay of your (WAR, AMP, etc.) dependencies
                        | NOTE: At least one WAR dependency must be uncompressed first
                        | NOTE: In order to have a dependency effectively added to the WAR you need to 
                        | explicitly mention it in the overlay section.
                        | NOTE: First-win resource strategy is used by the WAR plugin
                         -->
                    <overlays>
                        <!-- Current project customizations. This is normally empty, since customizations come from the AMPs -->
                        <overlay/>
                        <!-- The Alfresco WAR -->
                        <overlay>
                            <groupId>${alfresco.groupId}</groupId>
                            <artifactId>${alfresco.repo.artifactId}</artifactId>
                            <type>war</type>
                            <!-- To allow inclusion of META-INF -->
                            <excludes/>
                        </overlay>
                        <!-- Add / sort your AMPs here -->
                        <overlay>
                            <groupId>${project.groupId}</groupId>
                            <artifactId>alfresco-skype-repo-amp</artifactId>
                            <type>amp</type>
                        </overlay>
                        <!-- Uncomment if you are using SPP -->
                        <!--
                        <overlay>
                            <groupId>${alfresco.groupId}</groupId>
                            <artifactId>alfresco-spp</artifactId>
                            <type>amp</type>
                        </overlay>
                        -->
                        <!-- Uncomment if you are using RM -->
                        <!--
                        <overlay>
                            <groupId>${alfresco.groupId}</groupId>
                            <artifactId>alfresco-rm</artifactId>
                            <type>amp</type>
                        </overlay>
                        -->
                    </overlays>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <!-- Overrides the run profile to disable securecomms and add rapid development configuration -->
        <profile>
            <id>run</id>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-war-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>prepare-exploded-war</id>
                                <goals>
                                    <goal>exploded</goal>
                                </goals>
                                <phase>prepare-package</phase>
                            </execution>
                            <execution>
                                <id>default-war</id>
                                <configuration>
                                    <webXml>${project.build.directory}/${project.build.finalName}-nossl/WEB-INF/web.xml</webXml>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <!-- Replaces web.xml where applicable, commenting out the security-constraints -->
                    <plugin>
                        <groupId>com.google.code.maven-replacer-plugin</groupId>
                        <artifactId>replacer</artifactId>
                        <executions>
                            <execution>
                                <id>disable-securecomms</id>
                                <phase>prepare-package</phase>
                                <goals>
                                    <goal>replace</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <ignoreErrors>true</ignoreErrors>
                            <file>${project.build.directory}/${project.build.finalName}/WEB-INF/web.xml</file>
                            <outputDir>${project.build.directory}/${project.build.finalName}-nossl/WEB-INF/</outputDir>
                            <preserveDir>false</preserveDir>
                            <replacements>
                                <replacement>
                                    <token><![CDATA[<!-- Toggle securecomms placeholder start -->]]></token>
                                    <value><![CDATA[<!--]]></value>
                                </replacement>
                                <replacement>
                                    <token><![CDATA[<!-- Toggle securecomms placeholder end -->]]></token>
                                    <value><![CDATA[-->]]></value>
                                </replacement>
                            </replacements>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
            <dependencies>
                <dependency>
                    <groupId>org.alfresco.maven</groupId>
                    <artifactId>alfresco-rad</artifactId>
                    <version>${maven.alfresco.version}</version>
                </dependency>
            </dependencies>
        </profile>
    </profiles>
</project>