<?xml version="1.0" encoding="UTF-8"?>
<!--
  Copyright (C) 2006-2026 Talend Inc. - www.talend.com
   Licensed 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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>org.talend.sdk.component</groupId>
    <artifactId>component-runtime</artifactId>
    <version>1.93.0</version>
  </parent>

  <artifactId>documentation</artifactId>

  <name>Component Runtime :: Documentation</name>
  <description>Actually framework documentation, generated as a website and pushed to Github pages.</description>

  <properties>
    <antora.version>3.0.3</antora.version>

    <!-- -Dantora.site.mode=dev-poc to test new theme -->
    <antora.dev.site.mode>dev</antora.dev.site.mode>
    <project_version>${project.version}</project_version>
    <sample_project-base>${project.basedir}/../sample</sample_project-base>
    <sample_project>${sample_project-base}/src/main/java/org/talend/sdk/component/sample</sample_project>
    <sample_project_test>${sample_project-base}/src/test/java/org/talend/sdk/component/sample</sample_project_test>
    <site.rootpath>/component-runtime</site.rootpath>

    <args4j.version>2.33</args4j.version>
    <plexus-sec-dispatcher.version>1.4</plexus-sec-dispatcher.version>

    <talend.build.name>${talend.build.name.base}.documentation</talend.build.name>

    <asciidoctorj-diagram.version>1.5.4.1</asciidoctorj-diagram.version>
    <asciidoctor-pdf-gem.version>1.6.0</asciidoctor-pdf-gem.version>
    <crawler-commons.version>1.3</crawler-commons.version>
    <commons-net.version>3.9.0</commons-net.version>
    <!-- skip flags for the release -->
    <talend.documentation.generation.skip>false</talend.documentation.generation.skip>
    <talend.documentation.pdf.skip>false</talend.documentation.pdf.skip>
    <pdf.skip>false</pdf.skip>
    <swagger2markup.skip>false</swagger2markup.skip>
    <indexation.skip>false</indexation.skip>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.apache.geronimo.specs</groupId>
      <artifactId>geronimo-jaxrs_2.1_spec</artifactId>
      <version>${geronimo-jaxrs.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.talend.sdk.component</groupId>
      <artifactId>component-api</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.talend.sdk.component</groupId>
      <artifactId>component-server</artifactId>
      <version>${project.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.talend.sdk.component</groupId>
      <artifactId>talend-component-maven-plugin</artifactId>
      <version>${project.version}</version>
      <scope>provided</scope>
      <exclusions>
        <exclusion>
          <groupId>org.codehaus.plexus</groupId>
          <artifactId>plexus-utils</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.python</groupId>
          <artifactId>jython</artifactId>
        </exclusion>
        <exclusion>
          <groupId>commons-io</groupId>
          <artifactId>commons-io</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.talend.sdk.component</groupId>
      <artifactId>component-tools-webapp</artifactId>
      <version>${project.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.talend.sdk.component</groupId>
      <artifactId>component-runtime-junit</artifactId>
      <version>${project.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.talend.sdk.component</groupId>
      <artifactId>remote-engine-customizer</artifactId>
      <version>${project.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.talend.sdk.component</groupId>
      <artifactId>component-runtime-http-junit</artifactId>
      <version>${project.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.tomee</groupId>
      <artifactId>ziplock</artifactId>
      <version>${ziplock.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.xbean</groupId>
      <artifactId>xbean-finder-shaded</artifactId>
      <version>${xbean.version}</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>org.eclipse.microprofile.openapi</groupId>
      <artifactId>microprofile-openapi-api</artifactId>
      <version>${microprofile-openapi-api.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.geronimo</groupId>
      <artifactId>geronimo-openapi-impl</artifactId>
      <version>${geronimo-openapi.version}</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>commons-net</groupId>
      <artifactId>commons-net</artifactId>
      <version>${commons-net.version}</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>args4j</groupId>
      <artifactId>args4j</artifactId>
      <version>${args4j.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.cxf</groupId>
      <artifactId>cxf-rt-frontend-jaxrs</artifactId>
      <version>${cxf.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.cxf</groupId>
      <artifactId>cxf-core</artifactId>
      <version>${cxf.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.johnzon</groupId>
      <artifactId>johnzon-jsonb</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.asciidoctor</groupId>
      <artifactId>asciidoctorj</artifactId>
      <version>${asciidoctorj.version}</version>
      <scope>provided</scope>
      <exclusions>
        <exclusion>
          <groupId>org.jruby</groupId>
          <artifactId>*</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.jruby</groupId>
      <artifactId>jruby-complete</artifactId>
      <version>${jruby.version}</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-text</artifactId>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>com.github.crawler-commons</groupId>
      <artifactId>crawler-commons</artifactId>
      <version>${crawler-commons.version}</version>
      <scope>provided</scope>
      <exclusions>
        <exclusion>
          <groupId>commons-io</groupId>
          <artifactId>commons-io</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.jsoup</groupId>
      <artifactId>jsoup</artifactId>
      <version>${jsoup.version}</version>
      <scope>provided</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <skipIfEmpty>true</skipIfEmpty>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.gmavenplus</groupId>
        <artifactId>gmavenplus-plugin</artifactId>
        <dependencies>
          <dependency>
            <groupId>org.apache.johnzon</groupId>
            <artifactId>johnzon-jsonb</artifactId>
            <version>${johnzon.version}</version>
          </dependency>
          <dependency>
            <groupId>org.asciidoctor</groupId>
            <artifactId>asciidoctorj</artifactId>
            <version>${asciidoctorj.version}</version>
            <exclusions>
              <exclusion>
                <groupId>org.jruby</groupId>
                <artifactId>*</artifactId>
              </exclusion>
            </exclusions>
          </dependency>
          <dependency>
            <groupId>org.jsoup</groupId>
            <artifactId>jsoup</artifactId>
            <version>${jsoup.version}</version>
          </dependency>
        </dependencies>
        <executions>
          <execution>
            <id>groovy-scripts</id>
            <!-- before exec plugin -->
            <goals>
              <goal>execute</goal>
            </goals>
            <phase>compile</phase>
            <configuration>
              <allowSystemExits>true</allowSystemExits>
              <scripts>
                <script>${project.basedir}/src/build/DecryptCredentials.groovy</script>
                <script>${project.basedir}/src/build/CustomizeJavadoc.groovy</script>
              </scripts>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>1.6.0</version>
        <dependencies>
          <dependency>
            <groupId>org.eclipse.microprofile.openapi</groupId>
            <artifactId>microprofile-openapi-api</artifactId>
            <version>${microprofile-openapi-api.version}</version>
          </dependency>
          <dependency>
            <groupId>org.apache.geronimo</groupId>
            <artifactId>geronimo-openapi-impl</artifactId>
            <version>${geronimo-openapi.version}</version>
          </dependency>
          <dependency>
            <groupId>org.apache.geronimo.specs</groupId>
            <artifactId>geronimo-json_1.1_spec</artifactId>
            <version>${geronimo-json.version}</version>
          </dependency>
          <dependency>
            <groupId>org.apache.geronimo.specs</groupId>
            <artifactId>geronimo-jsonb_1.0_spec</artifactId>
            <version>${geronimo-jsonb.version}</version>
          </dependency>
          <dependency>
            <groupId>org.apache.johnzon</groupId>
            <artifactId>johnzon-jsonb</artifactId>
            <version>${johnzon.version}</version>
          </dependency>
          <dependency>
            <groupId>com.github.crawler-commons</groupId>
            <artifactId>crawler-commons</artifactId>
            <version>${crawler-commons.version}</version>
          </dependency>
          <dependency>
            <groupId>org.jsoup</groupId>
            <artifactId>jsoup</artifactId>
            <version>${jsoup.version}</version>
          </dependency>
          <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>${commons-io.version}</version>
          </dependency>
          <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-text</artifactId>
            <version>${commons-text.version}</version>
          </dependency>
          <dependency>
            <groupId>org.apache.geronimo.specs</groupId>
            <artifactId>geronimo-jaxrs_2.1_spec</artifactId>
            <version>${geronimo-jaxrs.version}</version>
          </dependency>
          <dependency>
            <groupId>org.asciidoctor</groupId>
            <artifactId>asciidoctorj</artifactId>
            <version>${asciidoctorj.version}</version>
            <exclusions>
              <exclusion>
                <groupId>org.jruby</groupId>
                <artifactId>jruby</artifactId>
              </exclusion>
            </exclusions>
          </dependency>
          <dependency>
            <groupId>org.jruby</groupId>
            <artifactId>jruby-complete</artifactId>
            <version>${jruby.version}</version>
          </dependency>
          <!-- to reuse maven one -->
          <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>1.5.6</version>
          </dependency>
          <dependency>
            <groupId>org.talend.sdk.component</groupId>
            <artifactId>component-api</artifactId>
            <version>${project.version}</version>
          </dependency>
          <dependency>
            <groupId>org.talend.sdk.component</groupId>
            <artifactId>component-server</artifactId>
            <version>${project.version}</version>
            <exclusions>
              <exclusion>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-slf4j-impl</artifactId>
              </exclusion>
            </exclusions>
          </dependency>
          <dependency>
            <groupId>org.talend.sdk.component</groupId>
            <artifactId>talend-component-maven-plugin</artifactId>
            <version>${project.version}</version>
            <exclusions>
              <exclusion>
                <groupId>org.python</groupId>
                <artifactId>jython</artifactId>
              </exclusion>
            </exclusions>
          </dependency>
          <dependency>
            <groupId>org.talend.sdk.component</groupId>
            <artifactId>component-runtime-junit</artifactId>
            <version>${project.version}</version>
          </dependency>
          <dependency>
            <groupId>org.apache.tomee</groupId>
            <artifactId>ziplock</artifactId>
            <version>${ziplock.version}</version>
            <exclusions>
              <exclusion>
                <groupId>org.apache.tomee</groupId>
                <artifactId>*</artifactId>
              </exclusion>
            </exclusions>
          </dependency>
          <dependency>
            <groupId>org.apache.xbean</groupId>
            <artifactId>xbean-finder-shaded</artifactId>
            <version>${xbean.version}</version>
          </dependency>
          <dependency>
            <groupId>args4j</groupId>
            <artifactId>args4j</artifactId>
            <version>${args4j.version}</version>
          </dependency>
          <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-frontend-jaxrs</artifactId>
            <version>${cxf.version}</version>
          </dependency>
          <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-rs-client</artifactId>
            <version>${cxf.version}</version>
          </dependency>
          <dependency>
            <groupId>org.sonatype.plexus</groupId>
            <artifactId>plexus-sec-dispatcher</artifactId>
            <version>${plexus-sec-dispatcher.version}</version>
          </dependency>
          <dependency>
            <groupId>org.apache.geronimo.specs</groupId>
            <artifactId>geronimo-jaxrs_2.1_spec</artifactId>
            <version>${geronimo-jaxrs.version}</version>
          </dependency>
          <dependency>
            <groupId>org.talend.sdk.component</groupId>
            <artifactId>remote-engine-customizer</artifactId>
            <version>${project.version}</version>
            <exclusions>
              <exclusion>
                <groupId>org.slf4j</groupId>
                <artifactId>*</artifactId>
              </exclusion>
              <exclusion>
                <groupId>${project.groupId}</groupId>
                <artifactId>slf4j-standard</artifactId>
              </exclusion>
            </exclusions>
          </dependency>
        </dependencies>
        <executions>
          <execution>
            <id>generated-doc</id>
            <goals>
              <goal>java</goal>
            </goals>
            <phase>process-classes</phase>
            <configuration>
              <mainClass>org.talend.runtime.documentation.Generator</mainClass>
              <includePluginDependencies>true</includePluginDependencies>
              <arguments>
                <argument>${project.basedir}/src/main/antora/modules/ROOT/pages</argument>
                <argument>${talend.jira.username}</argument>
                <argument>${talend.jira.password}</argument>
                <argument>${project.version}</argument>
                <argument>offline=${settings.offline}</argument>
                <argument>${talend.github.username}</argument>
                <argument>${talend.github.password}</argument>
                <argument>${talend.documentation.generation.skip}</argument>
              </arguments>
            </configuration>
          </execution>
          <execution>
            <!-- mvn gplus:execute@groovy-scripts -Dtalend.documentation.pdf.skip=true exec:java@indexation -->
            <id>indexation</id>
            <goals>
              <goal>java</goal>
            </goals>
            <phase>package</phase>
            <configuration>
              <skip>${indexation.skip}</skip>
              <mainClass>org.talend.runtime.documentation.SearchIndexation</mainClass>
              <includePluginDependencies>true</includePluginDependencies>
              <arguments>
                <argument>${project.build.directory}/${project.build.finalName}/sitemap.xml</argument>
                <argument>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}</argument>
              </arguments>
            </configuration>
          </execution>
          <execution>
            <!-- mvn gplus:execute@groovy-scripts -Dtalend.documentation.pdf.skip=true exec:java@redirect-latest -->
            <id>redirect-latest</id>
            <goals>
              <goal>java</goal>
            </goals>
            <phase>package</phase>
            <configuration>
              <skip>${indexation.skip}</skip>
              <mainClass>org.talend.runtime.documentation.StaticRedirector</mainClass>
              <includePluginDependencies>true</includePluginDependencies>
              <arguments>
                <argument>${project.build.directory}/${project.build.finalName}</argument>
              </arguments>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <id>create-files-from-templates</id>
            <goals>
              <goal>run</goal>
            </goals>
            <phase>initialize</phase>
            <configuration>
              <target>
                <copy todir="${project.basedir}/src/main/frontend" overwrite="true">
                  <fileset dir="${project.basedir}/src/main/frontend">
                    <include name="package-template.json" />
                  </fileset>
                  <mapper type="glob" from="package-template.json" to="package.json" />
                </copy>
                <copy todir="${project.basedir}/src/main/antora" overwrite="true">
                  <fileset dir="${project.basedir}/src/main/antora">
                    <include name="antora-template.yml" />
                    <include name="site-template.yml" />
                    <include name="site-${antora.dev.site.mode}-template.yml" />
                  </fileset>
                  <mapper>
                    <globmapper from="*-template.yml" to="*.yml" />
                  </mapper>
                </copy>
              </target>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <executions>
          <execution>
            <id>filter-frontend</id>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <phase>initialize</phase>
            <configuration>
              <outputDirectory>${project.basedir}/src/main/frontend</outputDirectory>
              <resources>
                <resource>
                  <directory>${project.basedir}/src/main/frontend</directory>
                  <includes>
                    <include>package.json</include>
                  </includes>
                  <filtering>true</filtering>
                </resource>
              </resources>
              <overwrite>true</overwrite>
            </configuration>
          </execution>
          <execution>
            <id>filter-antora</id>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <phase>process-sources</phase>
            <configuration>
              <outputDirectory>${project.basedir}/src/main/antora/</outputDirectory>
              <resources>
                <resource>
                  <directory>${project.basedir}/src/main/antora/</directory>
                  <includes>
                    <include>antora.yml</include>
                    <include>site-${antora.dev.site.mode}.yml</include>
                    <include>site.yml</include>
                  </includes>
                  <filtering>true</filtering>
                </resource>
              </resources>
              <overwrite>true</overwrite>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <!-- mvn package -Pgen-doc [once] && mvn frontend:npm@npm-dev -Pgen-doc -->
      <plugin>
        <groupId>com.github.eirslett</groupId>
        <artifactId>frontend-maven-plugin</artifactId>
        <configuration>
          <skip>${antora.skip}</skip>
          <installDirectory>${project.basedir}/.node</installDirectory>
          <workingDirectory>${project.basedir}/src/main/frontend</workingDirectory>
          <environmentVariables>
            <NODE_ENV>production</NODE_ENV>
          </environmentVariables>
        </configuration>
        <executions>
          <execution>
            <id>install-node-and-npm</id>
            <goals>
              <goal>install-node-and-npm</goal>
            </goals>
            <phase>generate-sources</phase>
            <configuration>
              <nodeVersion>${node.version}</nodeVersion>
              <npmVersion>${npm.version}</npmVersion>
            </configuration>
          </execution>
          <execution>
            <id>npm-install</id>
            <goals>
              <goal>npm</goal>
            </goals>
            <phase>generate-sources</phase>
            <configuration>
              <arguments>install</arguments>
            </configuration>
          </execution>
          <execution>
            <id>npm-build</id>
            <goals>
              <goal>npm</goal>
            </goals>
            <phase>prepare-package</phase>
            <configuration>
              <skip>${component.front.build.skip}</skip>
              <arguments>run antora:build</arguments>
            </configuration>
          </execution>
          <execution>
            <!-- mvn initialize git-commit-id:revision@get-the-git-infos-in-m2-properties gplus:execute@groovy-scripts frontend:npm@npm-dev -->
            <id>npm-dev</id>
            <goals>
              <goal>npm</goal>
            </goals>
            <phase />
            <configuration>
              <skip>${component.front.build.skip}</skip>
              <arguments>run antora:${antora.dev.site.mode}</arguments>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>unpack-api-javadoc</id>
            <goals>
              <goal>unpack</goal>
            </goals>
            <phase>process-resources</phase>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>org.talend.sdk.component</groupId>
                  <artifactId>component-api</artifactId>
                  <version>${project.version}</version>
                  <type>jar</type>
                  <classifier>javadoc</classifier>
                  <overWrite>true</overWrite>
                  <outputDirectory>${project.build.directory}/${project.build.finalName}/apidocs/${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}/api</outputDirectory>
                </artifactItem>
                <artifactItem>
                  <groupId>org.talend.sdk.component</groupId>
                  <artifactId>component-runtime-junit</artifactId>
                  <version>${project.version}</version>
                  <type>jar</type>
                  <classifier>javadoc</classifier>
                  <overWrite>true</overWrite>
                  <outputDirectory>${project.build.directory}/${project.build.finalName}/apidocs/${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}/junit</outputDirectory>
                </artifactItem>
                <artifactItem>
                  <groupId>org.talend.sdk.component</groupId>
                  <artifactId>component-runtime-http-junit</artifactId>
                  <version>${project.version}</version>
                  <type>jar</type>
                  <classifier>javadoc</classifier>
                  <overWrite>true</overWrite>
                  <outputDirectory>${project.build.directory}/${project.build.finalName}/apidocs/${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}/junit-http</outputDirectory>
                </artifactItem>
              </artifactItems>
            </configuration>
          </execution>
          <execution>
            <id>unpack-asciidoctor-pdf</id>
            <goals>
              <goal>unpack</goal>
            </goals>
            <phase>generate-resources</phase>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>org.asciidoctor</groupId>
                  <artifactId>asciidoctorj-pdf</artifactId>
                  <version>${asciidoctorj-pdf.version}</version>
                  <type>jar</type>
                  <overWrite>true</overWrite>
                  <outputDirectory>${project.build.directory}/build-dependencies/asciidoctorj-pdf</outputDirectory>
                  <includes>gems/asciidoctor-pdf-${asciidoctor-pdf-gem.version}/data/**</includes>
                </artifactItem>
              </artifactItems>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <!-- mvn initialize asciidoctor:process-asciidoc@pdf -e -->
      <plugin>
        <groupId>org.asciidoctor</groupId>
        <artifactId>asciidoctor-maven-plugin</artifactId>
        <version>2.2.6</version>
        <dependencies>
          <dependency>
            <groupId>org.asciidoctor</groupId>
            <artifactId>asciidoctorj</artifactId>
            <version>${asciidoctorj.version}</version>
            <exclusions>
              <exclusion>
                <groupId>org.jruby</groupId>
                <artifactId>*</artifactId>
              </exclusion>
            </exclusions>
          </dependency>
          <dependency>
            <groupId>org.asciidoctor</groupId>
            <artifactId>asciidoctorj-pdf</artifactId>
            <version>${asciidoctorj-pdf.version}</version>
            <exclusions>
              <exclusion>
                <groupId>org.jruby</groupId>
                <artifactId>*</artifactId>
              </exclusion>
            </exclusions>
          </dependency>
          <dependency>
            <groupId>org.jruby</groupId>
            <artifactId>jruby-complete</artifactId>
            <version>${jruby.version}</version>
          </dependency>
          <!-- until antora supports it we don't use that
          <dependency>
            <groupId>org.asciidoctor</groupId>
            <artifactId>asciidoctorj-diagram</artifactId>
            <version>${asciidoctorj-diagram.version}</version>
          </dependency>
          -->
        </dependencies>
        <executions>
          <!-- same as (but using java to avoid ruby setup, however it is x2 slower):
          asciidoctor-pdf \
            -a pdf-style=talend \
            -a pdf-stylesdir=$PWD/src/main/asciidoctor/pdf/theme \
            -a pdf-fonts=$PWD/target/build-dependencies/asciidoctorj-pdf/gems/asciidoctor-pdf-1.5.0.alpha.16/data/fonts \
            -a pagenums \
            -a toc \
            -a numbered \
            -a hide-uri-scheme \
            -a idprefix \
            -a icons=font \
            -a icon-set=fa \
            -a idseparator=- \
            -a partialsdir=$PWD/src/main/antora/modules/ROOT/pages/_partials \
            -a imagesdir=$PWD/src/main/antora/modules/ROOT/assets/images \
            -a project_version=1.1.8 \
            -a page-component-version=1.1.8 \
            -a deploymentRoot=https://talend.github.io/component-runtime \
            -a git.branch=master \
            src/main/antora/modules/ROOT/pages/all-in-one.adoc
          -->
          <execution>
            <id>pdf</id>
            <goals>
              <goal>process-asciidoc</goal>
            </goals>
            <phase>generate-resources</phase>
            <configuration>
              <skip>${talend.documentation.pdf.skip}</skip>
              <backend>pdf</backend>
              <sourceDirectory>src/main/antora/modules/ROOT/pages</sourceDirectory>
              <sourceDocumentName>all-in-one.adoc</sourceDocumentName>
              <attributes>
                <pdf-style>talend</pdf-style>
                <pdf-stylesdir>${project.basedir}/src/main/asciidoctor/pdf/theme</pdf-stylesdir>
                <pdf-fonts>${project.build.directory}/build-dependencies/asciidoctorj-pdf/gems/asciidoctor-pdf-${asciidoctor-pdf-gem.version}/data/fonts</pdf-fonts>
                <pagenums />
                <toc />
                <numbered />
                <hide-uri-scheme />
                <idprefix />
                <icons>font</icons>
                <icon-set>fa</icon-set>
                <idseparator>-</idseparator>
                <partialsdir>${project.basedir}/src/main/antora/modules/ROOT/pages/_partials</partialsdir>
                <imagesdir>${project.basedir}/src/main/antora/modules/ROOT/assets/images</imagesdir>
                <project_version>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}</project_version>
                <page-component-version>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}</page-component-version>
                <deploymentRoot>https://talend.github.io/component-runtime</deploymentRoot>
                <git_branch>${git.branch}</git_branch>
                <sourceHighlighter>coderay</sourceHighlighter>
              </attributes>
              <logHandler>
                <outputToConsole>false</outputToConsole>
              </logHandler>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>${build-helper-maven-plugin.version}</version>
        <executions>
          <execution>
            <id>parse-version</id>
            <goals>
              <goal>parse-version</goal>
            </goals>
            <phase>initialize</phase>
          </execution>
          <execution>
            <id>attach-artifacts</id>
            <goals>
              <goal>attach-artifact</goal>
            </goals>
            <phase>package</phase>
            <configuration>
              <skipAttach>${talend.documentation.pdf.skip}</skipAttach>
              <artifacts>
                <artifact>
                  <file>${project.build.directory}/generated-docs/all-in-one.pdf</file>
                  <type>pdf</type>
                  <classifier>all-in-one</classifier>
                </artifact>
              </artifacts>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.meecrowave</groupId>
        <artifactId>meecrowave-maven-plugin</artifactId>
        <version>${meecrowave.version}</version>
        <configuration>
          <webResourceCached>false</webResourceCached>
          <cdiConversation>false</cdiConversation>
          <useClasspathDeployment>true</useClasspathDeployment>
          <webapp>${project.build.directory}/${project.build.finalName}</webapp>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>gh-pages</id>
      <properties>
        <github.global.server>github</github.global.server>
        <!-- matches a server in your settings.xml -->
        <content.rootpath>/component-runtime</content.rootpath>
        <site.rootpath>/component-runtime</site.rootpath>
      </properties>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.gmavenplus</groupId>
            <artifactId>gmavenplus-plugin</artifactId>
            <dependencies>
              <dependency>
                <groupId>org.eclipse.jgit</groupId>
                <artifactId>org.eclipse.jgit</artifactId>
                <version>${jgit.version}</version>
              </dependency>
              <dependency>
                <groupId>org.apache.cxf</groupId>
                <artifactId>cxf-rt-frontend-jaxrs</artifactId>
                <version>${cxf.version}</version>
              </dependency>
              <dependency>
                <groupId>org.apache.cxf</groupId>
                <artifactId>cxf-rt-security</artifactId>
                <version>${cxf.version}</version>
              </dependency>
              <dependency>
                <groupId>org.apache.cxf</groupId>
                <artifactId>cxf-rt-transports-http</artifactId>
                <version>${cxf.version}</version>
              </dependency>
              <dependency>
                <groupId>org.apache.cxf</groupId>
                <artifactId>cxf-core</artifactId>
                <version>${cxf.version}</version>
              </dependency>
            </dependencies>
            <executions>
              <execution>
                <id>deploy-site</id>
                <goals>
                  <goal>execute</goal>
                </goals>
                <phase>pre-site</phase>
                <configuration>
                  <allowSystemExits>true</allowSystemExits>
                  <scripts>
                    <script>${project.basedir}/src/build/DecryptCredentials.groovy</script>
                    <script>${project.basedir}/src/build/CustomizeJavadoc.groovy</script>
                    <script>${project.basedir}/src/build/GithubPages.groovy</script>
                  </scripts>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>release</id>
      <properties>
        <talend.documentation.generation.skip>true</talend.documentation.generation.skip>
        <swagger2markup.skip>true</swagger2markup.skip>
        <component.front.build.skip>true</component.front.build.skip>
        <indexation.skip>true</indexation.skip>
      </properties>
    </profile>
    <profile>
      <id>build-latest-apidoc</id>
      <activation>
        <property>
          <name>env.BRANCH_NAME</name>
          <value>master</value>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
              <execution>
                <id>unpack-junit-javadoc</id>
                <goals>
                  <goal>unpack</goal>
                </goals>
                <phase>process-resources</phase>
                <configuration>
                  <artifactItems>
                    <artifactItem>
                      <groupId>org.talend.sdk.component</groupId>
                      <artifactId>component-api</artifactId>
                      <version>${project.version}</version>
                      <type>jar</type>
                      <classifier>javadoc</classifier>
                      <overWrite>true</overWrite>
                      <outputDirectory>${project.build.directory}/${project.build.finalName}/apidocs/latest/api</outputDirectory>
                    </artifactItem>
                    <artifactItem>
                      <groupId>org.talend.sdk.component</groupId>
                      <artifactId>component-runtime-junit</artifactId>
                      <version>${project.version}</version>
                      <type>jar</type>
                      <classifier>javadoc</classifier>
                      <overWrite>true</overWrite>
                      <outputDirectory>${project.build.directory}/${project.build.finalName}/apidocs/latest/junit</outputDirectory>
                    </artifactItem>
                    <artifactItem>
                      <groupId>org.talend.sdk.component</groupId>
                      <artifactId>component-runtime-http-junit</artifactId>
                      <version>${project.version}</version>
                      <type>jar</type>
                      <classifier>javadoc</classifier>
                      <overWrite>true</overWrite>
                      <outputDirectory>${project.build.directory}/${project.build.finalName}/apidocs/latest/junit-http</outputDirectory>
                    </artifactItem>
                  </artifactItems>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
