<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-webeditor-distribution</artifactId>
    <packaging>pom</packaging>
    <name>Alfresco WebEditor Distribution Zip</name>

    <parent>
        <groupId>org.alfresco</groupId>
        <artifactId>alfresco-share-packaging</artifactId>
        <version>23.6.0.13</version>
    </parent>


    <build>
        <finalName>alfresco-webeditor-${project.version}</finalName>
        <plugins>
            <plugin>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <!-- Extract necessary files to build the webeditor-taglib jar -->
                    <execution>
                        <id>unpack-taglib-files</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>org.alfresco</groupId>
                                    <artifactId>alfresco-web-editor</artifactId>
                                    <version>${project.version}</version>
                                    <classifier>classes</classifier>
                                    <includes>org/alfresco/web/awe/**</includes>
                                    <outputDirectory>${project.build.outputDirectory}/taglib</outputDirectory>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.alfresco</groupId>
                                    <artifactId>alfresco-web-editor</artifactId>
                                    <version>${project.version}</version>
                                    <type>war</type>
                                    <includes>**/awe.tld</includes>
                                    <outputDirectory>${project.build.outputDirectory}</outputDirectory>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>

                    <execution>
                        <id>fetch-artifacts</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>org.alfresco</groupId>
                                    <artifactId>alfresco-web-editor</artifactId>
                                    <version>${project.version}</version>
                                    <type>war</type>
                                    <destFileName>awe.war</destFileName>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.alfresco</groupId>
                                    <artifactId>alfresco-web-editor-samples</artifactId>
                                    <version>${project.version}</version>
                                    <type>war</type>
                                    <destFileName>customer.war</destFileName>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.alfresco</groupId>
                                    <artifactId>alfresco-web-editor-plugin</artifactId>
                                    <version>${project.version}</version>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.alfresco</groupId>
                                    <artifactId>alfresco-web-framework-commons</artifactId>
                                    <classifier>classes</classifier>
                                    <version>${project.version}</version>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.alfresco.surf</groupId>
                                    <artifactId>spring-webeditor</artifactId>
                                    <version>${dependency.surf.version}</version>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.alfresco.surf</groupId>
                                    <artifactId>spring-webeditor-client-jsp</artifactId>
                                    <version>${dependency.surf.version}</version>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>com.yahoo.platform.yui</groupId>
                                    <artifactId>yui</artifactId>
                                    <version>${dependency.yui.version}</version>
                                    <type>zip</type>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <executions>
                    <execution>
                        <id>make-assembly</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <appendAssemblyId>false</appendAssemblyId>
                    <descriptors>
                        <descriptor>src/assembly/webeditor-taglib.xml</descriptor>
                        <descriptor>src/assembly/webeditor-distribution.xml</descriptor>
                    </descriptors>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>
