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

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

    This program and the accompanying materials are made available under the
    terms of the Eclipse Distribution License v. 1.0, which is available at
    http://www.eclipse.org/org/documents/edl-v10.php.

    SPDX-License-Identifier: BSD-3-Clause

-->

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

    <parent>
        <artifactId>docs</artifactId>
        <groupId>com.sun.xml.ws</groupId>
        <version>2.3.6</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <modelVersion>4.0.0</modelVersion>

    <artifactId>www</artifactId>
    <version>2.3.6</version>
    <packaging>pom</packaging>
    <name>JAX-WS RI WWW Help files</name>

    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>buildnumber-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>dstamp</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>create-timestamp</goal>
                        </goals>
                        <configuration>
                            <timestampPropertyName>dstamp</timestampPropertyName>
                            <timestampFormat>yyyyMMdd</timestampFormat>
                        </configuration>
                    </execution>
                    <execution>
                        <id>release-date</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>create-timestamp</goal>
                        </goals>
                        <configuration>
                            <timestampPropertyName>release-date</timestampPropertyName>
                            <timestampFormat>MMMM d, yyyy</timestampFormat>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <id>copy-resources</id>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${www.upload.dir}</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>${project.basedir}/src/main/resources</directory>
                                    <filtering>true</filtering>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>release-docs</id>
            <dependencies>
                <dependency>
                    <groupId>${project.groupId}</groupId>
                    <artifactId>jaxws-rt</artifactId>
                    <version>${project.version}</version>
                </dependency>
                <dependency>
                    <groupId>${project.groupId}</groupId>
                    <artifactId>jaxws-tools</artifactId>
                    <version>${project.version}</version>
                </dependency>
            </dependencies>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>unpack-rt-javadoc</id>
                                <goals>
                                    <goal>unpack-dependencies</goal>
                                </goals>
                                <configuration>
                                    <classifier>javadoc</classifier>
                                    <includeArtifactIds>jaxws-rt</includeArtifactIds>
                                    <excludeTransitive>true</excludeTransitive>
                                    <outputDirectory>${www.upload.dir}/javadocs/rt</outputDirectory>
                                </configuration>
                            </execution>
                            <execution>
                                <id>unpack-tools-javadoc</id>
                                <goals>
                                    <goal>unpack-dependencies</goal>
                                </goals>
                                <configuration>
                                    <classifier>javadoc</classifier>
                                    <includeArtifactIds>jaxws-tools</includeArtifactIds>
                                    <excludeTransitive>true</excludeTransitive>
                                    <outputDirectory>${www.upload.dir}/javadocs/tools</outputDirectory>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>checkin-www</id>
                                <phase>install</phase>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                                <configuration>
                                    <target>
                                        <taskdef name="soimp" classname="com.sun.istack.soimp.Soimp" classpathref="maven.plugin.classpath" />

                                        <!-- update the www -->
                                        <soimp dir="${www.upload.dir}"
                                                repository="${www.repository.url}"
                                                username="${userguide.scm.username}"
                                                password="${userguide.scm.password}"
                                                create="true"
                                                additionalOptions="--no-auth-cache"
                                                commitMessage="${project.artifactId}-${project.version}" />
                                    </target>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
