<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>
    <artifactId>alfresco-public-javadoc</artifactId>
    <name>Alfresco Content Services Public API Javadoc</name>
    <parent>
        <groupId>org.alfresco</groupId>
        <artifactId>acs-community-packaging</artifactId>
	<version>6.0.5-SNAPSHOT</version>
	<relativePath>../pom.xml</relativePath>
    </parent>
    <packaging>pom</packaging>

    <properties>
        <docflex.version>1.6.1</docflex.version>
    </properties>

    <dependencies>
        <!-- The javadoc will be generated on the sources of these dependencies -->
        <dependency>
            <groupId>org.alfresco</groupId>
            <artifactId>alfresco-remote-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.alfresco</groupId>
            <artifactId>share</artifactId>
            <classifier>classes</classifier>
            <version>${alfresco.share.version}</version>
        </dependency>

        <!-- Downloads the docflex license -->
        <dependency>
            <groupId>com.docflex</groupId>
            <artifactId>docflex-alfresco-license</artifactId>
            <version>1.0</version>
            <type>license</type>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <!-- Extracts Docflex locally -->
    <build>
        <plugins>
            <plugin>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <!-- Unzips the docflex/javadoc doclet -->
                    <execution>
                        <id>default-cli</id>
                        <inherited>false</inherited>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>com.docflex</groupId>
                                    <artifactId>docflex-javadoc</artifactId>
                                    <version>${docflex.version}</version>
                                    <type>zip</type>
                                </artifactItem>
                            </artifactItems>
                            <outputDirectory>${project.build.directory}</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <artifactId>maven-javadoc-plugin</artifactId>
                <configuration>
                    <doclet>com.docflex.javadoc.Doclet</doclet>
                    <docletPath>${project.build.directory}/docflex-javadoc-${docflex.version}/lib/docflex-javadoc.jar</docletPath>
                    <additionalparam>
                        -license ${settings.localRepository}/com/docflex/docflex-alfresco-license/1.0/docflex-alfresco-license-1.0.license
                        -template ${project.build.directory}/docflex-javadoc-${docflex.version}/templates/JavadocPro/FramedDoc.tpl
                        -nodialog
                        -launchviewer=false
                        -p:filter.byAnns.include.classes=org.alfresco.api.AlfrescoPublicApi
                        -p:docTitle "Alfresco ${project.version} Public API"
                        -p:windowTitle "Alfresco ${project.version} Public API"
                    </additionalparam>
                    <includeDependencySources>true</includeDependencySources>
                    <includeTransitiveDependencySources>true</includeTransitiveDependencySources>
                    <dependencySourceIncludes>
                        <dependencySourceInclude>org.alfresco:*</dependencySourceInclude>
                    </dependencySourceIncludes>
                    <dependencySourceExcludes>
                        <dependencySourceExclude>org.alfresco:alfresco-xmlfactory</dependencySourceExclude>
                        <dependencySourceExclude>org.alfresco:alfresco-text-gen</dependencySourceExclude>
                    </dependencySourceExcludes>
                    <excludePackageNames>org.customer,org.apache</excludePackageNames>
                    <!-- Uncomment to generate javadoc on Java 8
                    <additionalparam>-Xdoclint:none</additionalparam>
                    -->
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>
