<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright (c) 2009, 2021 Oracle and/or its affiliates. All rights reserved.

    This program and the accompanying materials are made available under the
    terms of the Eclipse Public License v. 2.0, which is available at
    http://www.eclipse.org/legal/epl-2.0.

    This Source Code may also be made available under the following Secondary
    Licenses when the conditions for such availability set forth in the
    Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
    version 2 with the GNU Classpath Exception, which is available at
    https://www.gnu.org/software/classpath/license.html.

    SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0

-->

<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>

    <parent>
        <groupId>org.glassfish.main.admingui</groupId>
        <artifactId>admingui</artifactId>
        <version>6.2.2</version>
    </parent>

    <artifactId>dist-fragment</artifactId>
    <packaging>distribution-fragment</packaging>

    <name>Admin Console Install Fragment for Web distro</name>

    <dependencies>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>war</artifactId>
            <version>${project.version}</version>
            <type>war</type>
            <optional>true</optional>
        </dependency>
    </dependencies>

    <build><!--
         In this module, all the files are statically stored as-is in the Subversion repository,
         so the simple copying from src/main/resources to target/classes that Maven does by default
         is suffice.

         But in more complex scenario, one can use maven-antrun-extended-plugin and use a series of Ant tasks
         to perform processing on resources, such as token replacement, file generation, pre-processing, etc.

         The following section shows how you can do this.
       -->
        <plugins>
            <plugin>
                <groupId>org.jvnet.maven-antrun-extended-plugin</groupId>
                <artifactId>maven-antrun-extended-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <configuration>
                            <tasks>
                                <!-- extract admin gui war file into the final location -->
                                <resolveArtifact artifactId="war" property="war" />
                                <unzip src="${war}" dest="target/classes/glassfish/lib/install/applications/__admingui" />
                            </tasks>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
