<?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.
-->
<cache xmlns="http://maven.apache.org/BUILD-CACHE-CONFIG/1.3.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://maven.apache.org/BUILD-CACHE-CONFIG/1.3.0 https://maven.apache.org/xsd/build-cache-config-1.3.0.xsd">

    <!--
        Template Maven build cache configuration
     -->

    <configuration>
        <enabled>true</enabled>
        <!-- The default algorithm is XX (fastest, non-cryptographic). SHA-256 is used here for stronger
             integrity guarantees suitable for a production template. See performance.html for all options. -->
        <hashAlgorithm>SHA-256</hashAlgorithm>
        <validateXml>true</validateXml>
        <remote enabled="true">
            <url>http://host:port</url>
        </remote>
        <local>
            <maxBuildsCached>3</maxBuildsCached>
        </local>
        <projectVersioning adjustMetaInf="true"/>
    </configuration>

    <input>
        <global>
            <!-- If not defined, default glob is "*" -->
            <glob>
                {*.java,*.groovy,*.yaml,*.svcd,*.proto,*assembly.xml,assembly*.xml,*logback.xml,*.vm,*.ini,*.jks,*.properties,*.sh,*.bat}
            </glob>
            <includes>
                <!-- By default, project sources and resources directories are included (src/main/java and src/main/resources) -->
                <!-- In this example, the goal is to include a wider range of src directories (like src/main/assembly or src/main/groovy) -->
                <include>src/</include>
            </includes>
            <excludes>
                <!-- We don't want a static "hash" pom resolution (it would conflict the will to adjust the version in the manifest), -->
                <!-- we exclude this specific file (as it is already by default since it is not in an include folder -->
                <!-- The need to rebuild a project based on the pom is already computed with some intelligence by the extension. -->
                <exclude>pom.xml</exclude>
                <!-- Also excluding everything located in this project specific folder -->
                <exclude>src/main/javagen/**</exclude>
            </excludes>
        </global>
        <plugins>
            <plugin artifactId="codegen" excludeDependencies="false">
                <effectivePom>
                    <excludeProperties>
                        <excludeProperty>111</excludeProperty>
                    </excludeProperties>
                </effectivePom>
                <dirScan mode="auto">
                    <excludes>
                        <exclude tagName="outputDirectory"/>
                        <exclude tagName="directory"/>
                    </excludes>
                    <tagScanConfigs>
                        <tagScanConfig tagName="someProperty" glob="*.java" recursive="false"/>
                    </tagScanConfigs>
                </dirScan>
                <executions>
                    <execution>
                        <execIds>
                            <execId>1</execId>
                            <execId>2</execId>
                        </execIds>
                        <dirScan mode="auto">
                            <includes>
                                <include tagName="protolocation" recursive="false" glob="*.proto"/>
                            </includes>
                        </dirScan>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </input>
    <executionControl>
        <runAlways>
            <plugins>
                <plugin artifactId="maven-failsafe-plugin"/>
            </plugins>
            <executions>
                <execution artifactId="maven-deploy-plugin">
                    <execIds>
                        <execId>my-execution-id</execId>
                    </execIds>
                </execution>
            </executions>
            <goalsLists>
                <goalsList artifactId="maven-install-plugin">
                    <goals>
                        <goal>install</goal>
                    </goals>
                </goalsList>
                <goalsList artifactId="bb-sdk-codegen">
                    <goals>
                        <goal>deploy-local</goal>
                    </goals>
                </goalsList>
            </goalsLists>
        </runAlways>
        <reconcile logAllProperties="true">
            <plugins>
                <plugin artifactId="maven-compiler-plugin" goal="compile">
                    <reconciles>
                        <reconcile propertyName="source"/>
                        <reconcile propertyName="target"/>
                        <reconcile propertyName="debug"/>
                        <reconcile propertyName="debuglevel"/>
                    </reconciles>
                    <!-- whitelist of logged properties-->
                    <logs>
                        <log propertyName="includes"/>
                        <log propertyName="excludes"/>
                        <log propertyName="argLine"/>
                    </logs>
                </plugin>
                <plugin artifactId="duplicate-finder-maven-plugin" goal="check">
                    <reconciles>
                        <reconcile propertyName="skip" skipValue="true"/>
                        <reconcile propertyName="quiet" skipValue="true"/>
                    </reconciles>
                </plugin>
                <plugin artifactId="maven-enforcer-plugin" goal="enforce">
                    <reconciles>
                        <reconcile propertyName="skip" skipValue="true"/>
                    </reconciles>
                    <!-- blacklisted from logging properties-->
                    <nologs>
                        <nolog propertyName="redundantProperty"/>
                        <nolog propertyName="redundantProperty2"/>
                    </nologs>
                </plugin>
                <plugin artifactId="maven-deploy-plugin" goal="deploy">
                    <reconciles>
                        <!-- Deploy cached artifact when project version changes -->
                        <reconcile propertyName="project.version" expression="${project.version}"/>
                    </reconciles>
                </plugin>
            </plugins>
        </reconcile>
    </executionControl>
</cache>
