<?xml version="1.0" encoding="UTF-8"?>
<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>
    <groupId>bb.exp.maven</groupId>
    <artifactId>profile-activation</artifactId>
    <version>1</version>
    <packaging>jar</packaging>
    <name>${groupId}.${artifactId}</name>

    <profiles>
        <profile>
            <id>profile</id>
            <activation>
                <property>
                    <name>property</name>
                </property>
                <file>
                    <exists>file</exists>
                </file>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <executions>
                            <execution>
                                <phase>clean</phase>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                                <configuration>
                                    <tasks>
                                        <echo>The profile is active.</echo>
                                        <condition property="file_exists" value="yes">
                                            <available file="file"/>
                                        </condition>
                                        <property name="file_exists" value="no"/>
                                        <echo>file "file" exists: ${file_exists}</echo>
                                        <condition property="property_set" value="yes">
                                            <isset property="property"/>
                                        </condition>
                                        <property name="property_set" value="no"/>
                                        <echo>property "property" set: ${property_set}</echo>
                                    </tasks>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
