<?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>35</version>
    </parent>

    <groupId>org.apache.camel.upgrade</groupId>
    <version>4.18.0</version>
    <packaging>pom</packaging>
    <artifactId>camel-parent-upgrade-recipes</artifactId>

    <modules>
        <module>camel-upgrade-recipes</module>
        <module>camel-spring-boot-upgrade-recipes</module>
    </modules>

    <name>Camel Parent 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>4.18.0</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>
        <camel4.4-version>4.4.2</camel4.4-version>
        <camel4.5-version>4.5.0</camel4.5-version>
        <camel4.6-version>4.6.0</camel4.6-version>
        <camel4.8-version>4.8.0</camel4.8-version>
        <camel4.9-version>4.9.0</camel4.9-version>
        <camel4.10-version>4.10.0</camel4.10-version>
        <camel4.12-version>4.12.0</camel4.12-version>
        <camel4.14-version>4.14.0</camel4.14-version>
        <camel4.17-version>4.17.0</camel4.17-version>

        <camel4.10-lts-version>4.10.6</camel4.10-lts-version>
        <camel-latest-version>4.18.0</camel-latest-version>

        <camel-version>${project.version}</camel-version>
        <camel-spring-boot-version>${project.version}</camel-spring-boot-version>

        <!-- other versions used by the tests -->
        <tahu-version>1.0.18</tahu-version>

        <!-- versions for camel-spring-boot -->
        <spring-boot-version>3.5.10</spring-boot-version>
        <springframework-version>6.2.15</springframework-version>

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

        <lombok.version>1.18.42</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.15.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>
            <dependency>
                <groupId>org.apache.camel</groupId>
                <artifactId>camel-parent</artifactId>
                <version>${camel-version}</version>
                <type>pom</type>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <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>
        </plugins>
    </build>
    <profiles>
        <profile>
            <id>openrewrite</id>
            <!-- `mvn -Popenrewrite rewrite:run` -->
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.openrewrite.maven</groupId>
                        <artifactId>rewrite-maven-plugin</artifactId>
                        <version>6.19.0</version>
                        <configuration>
                            <activeRecipes>
                                <recipe>org.apache.camel.upgrade.internal.OpenRewriteRecipeBestPractices</recipe>
                            </activeRecipes>
                            <failOnDryRunResults>true</failOnDryRunResults>
                        </configuration>
                        <dependencies>
                            <dependency>
                                <groupId>org.openrewrite.recipe</groupId>
                                <artifactId>rewrite-rewrite</artifactId>
                                <version>0.13.0</version>
                            </dependency>
                        </dependencies>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <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 building 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>
