<?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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.apache</groupId>
        <artifactId>apache</artifactId>
        <version>33</version>
    </parent>

    <groupId>org.apache.camel</groupId>
    <version>0.1</version>
    <artifactId>camel-upgrade-recipes</artifactId>

    <name>Camel Upgrades Recipes</name>
    <description>Migration recipes (using openrewrite) to make Maven migrations easier</description>

    <developers>
        <developer>
            <name>The Apache Camel Team</name>
            <email>dev@camel.apache.org</email>
            <url>https://camel.apache.org</url>
            <organization>Apache Software Foundation</organization>
            <organizationUrl>http://apache.org/</organizationUrl>
        </developer>
    </developers>

    <mailingLists>
        <mailingList>
            <name>Development List</name>
            <subscribe>dev-subscribe@camel.apache.org</subscribe>
            <unsubscribe>dev-unsubscribe@camel.apache.org</unsubscribe>
            <post>dev@camel.apache.org</post>
        </mailingList>
        <mailingList>
            <name>User List</name>
            <subscribe>users-subscribe@camel.apache.org</subscribe>
            <unsubscribe>users-unsubscribe@camel.apache.org</unsubscribe>
            <post>users@camel.apache.org</post>
        </mailingList>
        <mailingList>
            <name>Commits List</name>
            <subscribe>commits-subscribe@camel.apache.org</subscribe>
            <unsubscribe>commits-unsubscribe@camel.apache.org</unsubscribe>
            <post>commits@camel.apache.org</post>
        </mailingList>
    </mailingLists>
    
   <scm>
        <connection>scm:git:http://gitbox.apache.org/repos/asf/camel-upgrade-recipes.git</connection>
        <developerConnection>scm:git:https://gitbox.apache.org/repos/asf/camel-upgrade-recipes.git</developerConnection>
        <url>https://github.com/apache/camel-upgrade-recipes</url>
        <tag>camel-upgrade-recipes-0.1</tag>
    </scm>
    <issueManagement>
        <system>jira</system>
        <url>https://issues.apache.org/jira/browse/CAMEL</url>
    </issueManagement>
    <distributionManagement>
        <site>
            <id>apache.website</id>
            <url>${site-repo-url}</url>
        </site>
    </distributionManagement>


    <properties>
        <!-- Place for jars of the different version, used to compile tests -->
        <rewrite-tmp-classpath>${project.build.testOutputDirectory}/META-INF/rewrite/classpath</rewrite-tmp-classpath>

        <!-- Old versions of Camel required for the tests -->
        <camel3.18-version>3.18.6</camel3.18-version>
        <camel4.0-version>4.0.3</camel4.0-version>

        <rewrite-recipe-bom.version>2.10.0</rewrite-recipe-bom.version>

        <lombok.version>1.18.34</lombok.version>
        <slf4j.version>1.7.36</slf4j.version>

        <!-- Http version used by the tests -->
        <http-client.version>4.5.14</http-client.version>
        <http-core.version>4.4.16</http-core.version>

        <jdk.version>17</jdk.version>
        <maven.compiler.source>${jdk.version}</maven.compiler.source>
        <maven.compiler.target>${jdk.version}</maven.compiler.target>
        <maven.compiler.release>${jdk.version}</maven.compiler.release>
        <minimalJavaBuildVersion>${jdk.version}</minimalJavaBuildVersion>

        <maven-compiler-plugin.version>3.13.0</maven-compiler-plugin.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.openrewrite.recipe</groupId>
                <artifactId>rewrite-recipe-bom</artifactId>
                <version>${rewrite-recipe-bom.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <!-- Operewrite dependencies should not be packaged into built jar -->
        <dependency>
            <groupId>org.openrewrite</groupId>
            <artifactId>rewrite-java</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.openrewrite</groupId>
            <artifactId>rewrite-core</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.openrewrite</groupId>
            <artifactId>rewrite-java-8</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.openrewrite</groupId>
            <artifactId>rewrite-java-11</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.openrewrite</groupId>
            <artifactId>rewrite-java-17</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.openrewrite.recipe</groupId>
            <artifactId>rewrite-migrate-java</artifactId>
        </dependency>
        <dependency>
            <groupId>org.openrewrite</groupId>
            <artifactId>rewrite-maven</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.openrewrite</groupId>
            <artifactId>rewrite-yaml</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.openrewrite</groupId>
            <artifactId>rewrite-properties</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.openrewrite</groupId>
            <artifactId>rewrite-xml</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.openrewrite</groupId>
            <artifactId>rewrite-test</artifactId>
            <scope>test</scope>
        </dependency>


        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${slf4j.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>${lombok.version}</version>
        </dependency>

    </dependencies>


    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven-compiler-plugin.version}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>test-jar</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <excludes>
                        <exclude>**/META-INF/rewrite/classpath/**</exclude>
                    </excludes>
                </configuration>
            </plugin>
            <plugin>
                <!-- to copy the dependencies for the test -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>3.1.1</version>
                <executions>
                    <execution>
                        <phase>process-test-resources</phase>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <!-- camel 3.18 dependencies-->
                                <artifactItem>
                                    <groupId>org.apache.camel</groupId>
                                    <artifactId>camel-activemq</artifactId>
                                    <version>${camel3.18-version}</version>
                                    <outputDirectory>${rewrite-tmp-classpath}</outputDirectory>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.apache.camel</groupId>
                                    <artifactId>camel-api</artifactId>
                                    <version>${camel3.18-version}</version>
                                    <outputDirectory>${rewrite-tmp-classpath}</outputDirectory>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.apache.camel</groupId>
                                    <artifactId>camel-bean</artifactId>
                                    <version>${camel3.18-version}</version>
                                    <outputDirectory>${rewrite-tmp-classpath}</outputDirectory>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.apache.camel</groupId>
                                    <artifactId>camel-catalog</artifactId>
                                    <version>${camel3.18-version}</version>
                                    <outputDirectory>${rewrite-tmp-classpath}</outputDirectory>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.apache.camel</groupId>
                                    <artifactId>camel-core-model</artifactId>
                                    <version>${camel3.18-version}</version>
                                    <outputDirectory>${rewrite-tmp-classpath}</outputDirectory>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.apache.camel</groupId>
                                    <artifactId>camel-main</artifactId>
                                    <version>${camel3.18-version}</version>
                                    <outputDirectory>${rewrite-tmp-classpath}</outputDirectory>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.apache.camel</groupId>
                                    <artifactId>camel-management-api</artifactId>
                                    <version>${camel3.18-version}</version>
                                    <outputDirectory>${rewrite-tmp-classpath}</outputDirectory>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.apache.camel</groupId>
                                    <artifactId>camel-support</artifactId>
                                    <version>${camel3.18-version}</version>
                                    <outputDirectory>${rewrite-tmp-classpath}</outputDirectory>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.apache.camel</groupId>
                                    <artifactId>camel-util</artifactId>
                                    <version>${camel3.18-version}</version>
                                    <outputDirectory>${rewrite-tmp-classpath}</outputDirectory>
                                </artifactItem>
                                <!--3.18 non-camel dependencies-->
                                <artifactItem>
                                    <groupId>org.apache.httpcomponents</groupId>
                                    <artifactId>httpclient</artifactId>
                                    <version>${http-client.version}</version>
                                    <outputDirectory>${rewrite-tmp-classpath}</outputDirectory>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.apache.httpcomponents</groupId>
                                    <artifactId>httpcore</artifactId>
                                    <version>${http-core.version}</version>
                                    <outputDirectory>${rewrite-tmp-classpath}</outputDirectory>
                                </artifactItem>
                                <!-- camel 4.0 dependencies-->
                                <artifactItem>
                                    <groupId>org.apache.camel</groupId>
                                    <artifactId>camel-api</artifactId>
                                    <version>${camel4.0-version}</version>
                                    <outputDirectory>${rewrite-tmp-classpath}</outputDirectory>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.apache.camel</groupId>
                                    <artifactId>camel-base</artifactId>
                                    <version>${camel4.0-version}</version>
                                    <outputDirectory>${rewrite-tmp-classpath}</outputDirectory>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.apache.camel</groupId>
                                    <artifactId>camel-base-engine</artifactId>
                                    <version>${camel4.0-version}</version>
                                    <outputDirectory>${rewrite-tmp-classpath}</outputDirectory>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.apache.camel</groupId>
                                    <artifactId>camel-endpointdsl</artifactId>
                                    <version>${camel4.0-version}</version>
                                    <outputDirectory>${rewrite-tmp-classpath}</outputDirectory>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.apache.camel</groupId>
                                    <artifactId>camel-core-model</artifactId>
                                    <version>${camel4.0-version}</version>
                                    <outputDirectory>${rewrite-tmp-classpath}</outputDirectory>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.apache.camel</groupId>
                                    <artifactId>camel-json-validator</artifactId>
                                    <version>${camel4.0-version}</version>
                                    <outputDirectory>${rewrite-tmp-classpath}</outputDirectory>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.apache.camel</groupId>
                                    <artifactId>camel-kafka</artifactId>
                                    <version>${camel4.0-version}</version>
                                    <outputDirectory>${rewrite-tmp-classpath}</outputDirectory>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.apache.camel</groupId>
                                    <artifactId>camel-saga</artifactId>
                                    <version>${camel4.0-version}</version>
                                    <outputDirectory>${rewrite-tmp-classpath}</outputDirectory>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.apache.camel</groupId>
                                    <artifactId>camel-support</artifactId>
                                    <version>${camel4.0-version}</version>
                                    <outputDirectory>${rewrite-tmp-classpath}</outputDirectory>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.apache.camel</groupId>
                                    <artifactId>camel-tracing</artifactId>
                                    <version>${camel4.0-version}</version>
                                    <outputDirectory>${rewrite-tmp-classpath}</outputDirectory>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.apache.camel</groupId>
                                    <artifactId>camel-util</artifactId>
                                    <version>${camel4.0-version}</version>
                                    <outputDirectory>${rewrite-tmp-classpath}</outputDirectory>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <profiles>
        <profile>
            <id>release</id>
            <activation>
                <property>
                    <name>release</name>
                </property>
            </activation>
            <properties>
                <skipTests>true</skipTests>
            </properties>
            <build>
                <plugins>
                    <!-- We want to deploy the artifact to a staging location for perusal -->
                    <plugin>
                        <inherited>true</inherited>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-deploy-plugin</artifactId>
                        <configuration>
                            <updateReleaseInfo>true</updateReleaseInfo>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <source>8</source>
                            <additionalOptions>${javadoc.opts}</additionalOptions>
                            <!-- disable Javadoc linting for buildung the release with Java 11 -->
                            <doclint>none</doclint>
                        </configuration>
                    </plugin>
                    <!-- We want to sign the artifact, the POM, and all attached artifacts -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <configuration>
                            <passphrase>${gpg.passphrase}</passphrase>
                            <useAgent>${gpg.useagent}</useAgent>
                        </configuration>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <configuration>
                            <failIfNoSpecifiedTests>false</failIfNoSpecifiedTests>
                            <failIfNoTests>false</failIfNoTests>
                            <skipITs>true</skipITs>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <failIfNoSpecifiedTests>false</failIfNoSpecifiedTests>
                            <failIfNoTests>false</failIfNoTests>
                            <skipTests>true</skipTests>
                        </configuration>
                        <executions>
                            <execution>
                                <id>default-test</id>
                                <phase>none</phase><!-- No need to even load the plugin during releases -->
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>com.mycila</groupId>
                        <artifactId>license-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>license-format</id>
                                <goals>
                                    <goal>format</goal>
                                </goals>
                                <phase>none</phase><!-- No need to even load the plugin during releases -->
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>net.revelc.code.formatter</groupId>
                        <artifactId>formatter-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>code-format</id>
                                <goals>
                                    <goal>format</goal>
                                </goals>
                                <phase>none</phase><!-- No need to even load the plugin during releases -->
                            </execution>
                        </executions>
                    </plugin>

                </plugins>
            </build>
        </profile>
    </profiles>
</project>
