<?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.component.linkedin</groupId>
    <artifactId>camel-linkedin-parent</artifactId>
    <version>2.14.1</version>
  </parent>

  <artifactId>camel-linkedin</artifactId>
  <packaging>bundle</packaging>
  <name>Camel :: LinkedIn Component</name>
  <description>Camel Component for LinkedIn</description>

  <properties>
    <schemeName>linkedin</schemeName>
    <componentName>LinkedIn</componentName>
    <componentPackage>org.apache.camel.component.linkedin</componentPackage>
    <outPackage>org.apache.camel.component.linkedin.internal</outPackage>

    <camel.osgi.export.pkg>${componentPackage}</camel.osgi.export.pkg>
    <camel.osgi.private.pkg>${outPackage}</camel.osgi.private.pkg>
  </properties>

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

    <!-- Camel annotations in runtime scope to avoid compile errors in IDEs -->
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>spi-annotations</artifactId>
      <version>${project.version}</version>
      <scope>provided</scope>
    </dependency>

    <!-- Component API javadoc in provided scope to read API signatures -->
    <dependency>
      <groupId>org.apache.camel.component.linkedin</groupId>
      <artifactId>camel-linkedin-api</artifactId>
      <version>${project.version}</version>
      <classifier>javadoc</classifier>
      <scope>provided</scope>
    </dependency>

    <!-- logging -->
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-log4j12</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>log4j</groupId>
      <artifactId>log4j</artifactId>
      <scope>test</scope>
    </dependency>

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

  <build>
    <plugins>
      
      <!-- 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>comments</apiName>
                  <proxyClass>org.apache.camel.component.linkedin.api.CommentsResource</proxyClass>
                  <fromJavadoc />
                </api>
                <api>
                  <apiName>companies</apiName>
                  <proxyClass>org.apache.camel.component.linkedin.api.CompaniesResource</proxyClass>
                  <fromJavadoc />
                  <nullableOptions>
                    <nullableOption>companySizes</nullableOption>
                    <nullableOption>count</nullableOption>
                    <nullableOption>email_domain</nullableOption>
                    <nullableOption>end_timestamp</nullableOption>
                    <nullableOption>event_type</nullableOption>
                    <nullableOption>geos</nullableOption>
                    <nullableOption>industries</nullableOption>
                    <nullableOption>is_company_admin</nullableOption>
                    <nullableOption>jobFunc</nullableOption>
                    <nullableOption>secure_urls</nullableOption>
                    <nullableOption>seniorities</nullableOption>
                    <nullableOption>start</nullableOption>
                    <nullableOption>start_timestamp</nullableOption>
                    <nullableOption>time_granularity</nullableOption>
                  </nullableOptions>
                </api>
                <api>
                  <apiName>groups</apiName>
                  <proxyClass>org.apache.camel.component.linkedin.api.GroupsResource</proxyClass>
                  <fromJavadoc />
                </api>
                <api>
                  <apiName>jobs</apiName>
                  <proxyClass>org.apache.camel.component.linkedin.api.JobsResource</proxyClass>
                  <fromJavadoc />
                </api>
                <api>
                  <apiName>people</apiName>
                  <proxyClass>org.apache.camel.component.linkedin.api.PeopleResource</proxyClass>
                  <fromJavadoc />
                  <nullableOptions>
                    <nullableOption>after</nullableOption>
                    <nullableOption>before</nullableOption>
                    <nullableOption>category</nullableOption>
                    <nullableOption>count</nullableOption>
                    <nullableOption>membership_state</nullableOption>
                    <nullableOption>modified_since</nullableOption>
                    <nullableOption>order</nullableOption>
                    <nullableOption>public_profile_url</nullableOption>
                    <nullableOption>role</nullableOption>
                    <nullableOption>scope</nullableOption>
                    <nullableOption>secure_urls</nullableOption>
                    <nullableOption>show_hidden_members</nullableOption>
                    <nullableOption>start</nullableOption>
                    <nullableOption>type</nullableOption>
                  </nullableOptions>
                </api>
                <api>
                  <apiName>posts</apiName>
                  <proxyClass>org.apache.camel.component.linkedin.api.PostsResource</proxyClass>
                  <fromJavadoc />
                  <nullableOptions>
                    <nullableOption>count</nullableOption>
                    <nullableOption>start</nullableOption>
                  </nullableOptions>
                </api>
                <api>
                  <apiName>search</apiName>
                  <proxyClass>org.apache.camel.component.linkedin.api.SearchResource</proxyClass>
                  <fromJavadoc />
                  <nullableOptions>
                    <nullableOption>company_name</nullableOption>
                    <nullableOption>count</nullableOption>
                    <nullableOption>country_code</nullableOption>
                    <nullableOption>current_company</nullableOption>
                    <nullableOption>current_school</nullableOption>
                    <nullableOption>current_title</nullableOption>
                    <nullableOption>distance</nullableOption>
                    <nullableOption>facet</nullableOption>
                    <nullableOption>facets</nullableOption>
                    <nullableOption>first_name</nullableOption>
                    <nullableOption>hq_only</nullableOption>
                    <nullableOption>job_title</nullableOption>
                    <nullableOption>keywords</nullableOption>
                    <nullableOption>last_name</nullableOption>
                    <nullableOption>postal_code</nullableOption>
                    <nullableOption>school_name</nullableOption>
                    <nullableOption>sort</nullableOption>
                    <nullableOption>start</nullableOption>
                    <nullableOption>title</nullableOption>
                  </nullableOptions>
                </api>
              </apis>
              <aliases>
                <alias>
                  <methodPattern>(add|get|remove|search)(.+)</methodPattern>
                  <methodAlias>$2</methodAlias>
                </alias>
              </aliases>
            </configuration>
          </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>
