<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You 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 http://maven.apache.org/maven-v4_0_0.xsd">

  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>org.apache.camel</groupId>
    <artifactId>camel-as2-parent</artifactId>
    <version>2.25.4</version>
  </parent>

  <artifactId>camel-as2</artifactId>
  <packaging>jar</packaging>
  <name>Camel :: AS2 :: Component</name>
  <description>Camel AS2 component</description>

  <properties>
    <schemeName>as2</schemeName>
    <componentName>AS2</componentName>
    <componentPackage>org.apache.camel.component.as2</componentPackage>
    <outPackage>org.apache.camel.component.as2.internal</outPackage>
    <camel.osgi.export.pkg>org.apache.camel.component.as2</camel.osgi.export.pkg>
    <camel.osgi.export.service>org.apache.camel.spi.ComponentResolver;component=as2</camel.osgi.export.service>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-core</artifactId>
    </dependency>
    
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-as2-api</artifactId>
      <version>${project.version}</version>
    </dependency>

    <!-- Camel annotations in provided scope to avoid compile errors in IDEs -->
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>spi-annotations</artifactId>
      <scope>provided</scope>
    </dependency>

    <!-- Component API javadoc in provided scope to read API signatures -->
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-as2-api</artifactId>
      <version>${project.version}</version>
      <type>javadoc</type>
      <scope>provided</scope>
    </dependency>
    
    <!-- logging -->
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-api</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-core</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-slf4j-impl</artifactId>
      <scope>test</scope>
    </dependency>

    <!-- testing -->
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-test</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-jetty</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <defaultGoal>install</defaultGoal>

    <plugins>
      
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
      </plugin>
      
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
      </plugin>

      <!-- generate Component source and test source -->
      <plugin>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-api-component-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>generate-test-component-classes</id>
            <goals>
              <goal>fromApis</goal>
            </goals>
            <configuration>
              <apis>
                <api>
                    <apiName>client</apiName>
                    <proxyClass>org.apache.camel.component.as2.api.AS2ClientManager</proxyClass>
                    <fromJavadoc>
                      <excludeMethods>createSigningGenerator|createEncryptingGenerator|createCompressorGenerator|createEncryptor|createCompressor</excludeMethods>
                    </fromJavadoc>
                    <nullableOptions>
                        <nullableOption>ediMessageTransferEncoding</nullableOption>
                        <nullableOption>signingAlgorithm</nullableOption>
                        <nullableOption>signingCertificateChain</nullableOption>
                        <nullableOption>signingPrivateKey</nullableOption>
                        <nullableOption>compressionAlgorithm</nullableOption>
                        <nullableOption>dispositionNotificationTo</nullableOption>
                        <nullableOption>signedReceiptMicAlgorithms</nullableOption>
                        <nullableOption>encryptingAlgorithm</nullableOption>
                        <nullableOption>encryptingCertificateChain</nullableOption>
                    </nullableOptions>
                </api>
                <api>
                    <apiName>server</apiName>
                    <proxyClass>org.apache.camel.component.as2.api.AS2ServerManager</proxyClass>
	                <fromJavadoc>
                      <excludeMethods>stopListening|handleMDNResponse</excludeMethods>
	                </fromJavadoc>
                    <excludeConfigNames>handler</excludeConfigNames>
<!--                     <nullableOptions>
                        <nullableOption>decryptingPrivateKey</nullableOption>
                    </nullableOptions>
 -->                </api>
              </apis>
              <!-- Specify global values for all APIs here, these are overridden at API level
              <substitutions />
              <excludeConfigNames />
              <excludeConfigTypes />
              <extraOptions />
              <fromJavadoc />
              <aliases />
              <nullableOptions />
              -->
            </configuration>
          </execution>
        </executions>
      </plugin>

      <!-- generate components meta-data and validate component includes documentation etc -->
      <plugin>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-package-maven-plugin</artifactId>
        <version>${project.version}</version>
        <executions>
          <execution>
            <id>prepare</id>
            <goals>
              <goal>prepare-components</goal>
            </goals>
            <phase>generate-resources</phase>
          </execution>
          <execution>
            <id>validate</id>
            <goals>
              <goal>validate-components</goal>
            </goals>
            <phase>prepare-package</phase>
          </execution>
        </executions>
      </plugin>

      <!-- add generated source and test source to build -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>add-generated-sources</id>
            <goals>
              <goal>add-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>${project.build.directory}/generated-sources/camel-component</source>
              </sources>
            </configuration>
          </execution>
          <execution>
            <id>add-generated-test-sources</id>
            <goals>
              <goal>add-test-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>${project.build.directory}/generated-test-sources/camel-component</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>

    </plugins>

    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.camel</groupId>
          <artifactId>camel-api-component-maven-plugin</artifactId>
          <version>${project.version}</version>
          <configuration>
            <scheme>${schemeName}</scheme>
            <componentName>${componentName}</componentName>
            <componentPackage>${componentPackage}</componentPackage>
            <outPackage>${outPackage}</outPackage>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>

  </build>

  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-api-component-maven-plugin</artifactId>
        <version>${project.version}</version>
        <configuration>
          <scheme>${schemeName}</scheme>
          <componentName>${componentName}</componentName>
          <componentPackage>${componentPackage}</componentPackage>
          <outPackage>${outPackage}</outPackage>
        </configuration>
      </plugin>
    </plugins>
  </reporting>

</project>
