<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>com.github.paulmoloney</groupId>
    <artifactId>top-level-parent-pom</artifactId>
    <version>1.0.4</version>
  </parent>  
    
  <artifactId>maven-enforcer-toolchain-rules</artifactId>
  <version>1.0.3</version>
  <packaging>jar</packaging>

  <name>maven-enforcer-toolchain-rules</name>
  <description>Enforce Java Compiler version based upon toolchain.xml configuration</description>  

  <properties>
    <java_lang_level>1.5</java_lang_level>
    <project_animal_java_sniffer_source_level>java15</project_animal_java_sniffer_source_level>
    <jdkName>${jdk5Name}</jdkName>
    <minJdk>${java_lang_level}.0-22</minJdk>
    <maxJdk />
    <requireJavaVersion>[${minJdk},)</requireJavaVersion>
    <minMaven>3.0.4</minMaven>
    <maxMaven />
    <requireMavenVersion>[${minMaven},)</requireMavenVersion>
                    
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.version>3.0</maven.version>
    <maven.plugin.plugin.version>3.1</maven.plugin.plugin.version>
    <plexusCompilerVersion>1.9.1</plexusCompilerVersion>
    <enforcerVersion>1.1</enforcerVersion>
    <LiveCycleMapping_plugin_version>1.0.0</LiveCycleMapping_plugin_version>    
  </properties>

  <dependencies>
      <dependency>
        <groupId>org.apache.maven.enforcer</groupId>
        <artifactId>enforcer-api</artifactId>
        <version>${enforcerVersion}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven.enforcer</groupId>
        <artifactId>enforcer-rules</artifactId>
        <version>${enforcerVersion}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven.enforcer</groupId>
        <artifactId>enforcer-rules</artifactId>
        <version>${enforcerVersion}</version>
        <type>test-jar</type>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-artifact</artifactId>
        <version>${maven.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-plugin-api</artifactId>
        <version>${maven.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-project</artifactId>
        <version>2.2.1</version>
        <exclusions>
            <exclusion>
                <groupId>backport-util-concurrent</groupId>
                <artifactId>backport-util-concurrent</artifactId>
            </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-core</artifactId>
        <version>${maven.version}</version>
	     <exclusions>
	        <exclusion>
	          <groupId>org.apache.maven.reporting</groupId>
	          <artifactId>maven-reporting-api</artifactId>
	        </exclusion>
	        <exclusion>
	          <groupId>org.apache.maven.wagon</groupId>
	          <artifactId>wagon-file</artifactId>
	        </exclusion>
	        <exclusion>
	          <groupId>org.apache.maven.wagon</groupId>
	          <artifactId>wagon-http-lightweight</artifactId>
	        </exclusion>
	        <exclusion>
	          <groupId>org.apache.maven.wagon</groupId>
	          <artifactId>wagon-ssh</artifactId>
	        </exclusion>
	        <exclusion>
	          <groupId>org.apache.maven.wagon</groupId>
	          <artifactId>wagon-ssh-external</artifactId>
	        </exclusion>
	        <exclusion>
	          <groupId>commons-cli</groupId>
	          <artifactId>commons-cli</artifactId>
	        </exclusion>
	        <exclusion>
	          <groupId>classworlds</groupId>
	          <artifactId>classworlds</artifactId>
	        </exclusion>
	        <exclusion>
	          <groupId>org.codehaus.plexus</groupId>
	          <artifactId>plexus-container-default</artifactId>
	        </exclusion>
	        <exclusion>
	          <groupId>org.codehaus.plexus</groupId>
	          <artifactId>plexus-interactivity-api</artifactId>
	        </exclusion>
	      </exclusions>
      </dependency>
      <dependency>
        <groupId>org.apache.maven.shared</groupId>
        <artifactId>maven-common-artifact-filters</artifactId>
        <version>1.2</version>
      </dependency>
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit-dep</artifactId>
        <version>4.10</version>
        <scope>test</scope>
        <exclusions>
            <exclusion>
                <groupId>org.hamcrest</groupId>
                <artifactId>hamcrest-core</artifactId>
            </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>org.hamcrest</groupId>
        <artifactId>hamcrest-library</artifactId>
        <version>1.3</version>
        <scope>test</scope>
        <exclusions>
            <exclusion>
                <groupId>org.easymock</groupId>
                <artifactId>easymock</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.jmock</groupId>
                <artifactId>jmock</artifactId>
            </exclusion>            
        </exclusions>
      </dependency>
      <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-core</artifactId>
        <version>1.9.0</version>
        <scope>test</scope>
        <exclusions>
            <exclusion>
                <groupId>org.hamcrest</groupId>
                <artifactId>hamcrest</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.objenesis</groupId>
                <artifactId>objenesis</artifactId>
            </exclusion>            
        </exclusions>
      </dependency>
      <dependency>
        <groupId>org.objenesis</groupId>
        <artifactId>objenesis</artifactId>
        <version>1.2</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>com.googlecode.catch-exception</groupId>
        <artifactId>catch-exception</artifactId>
        <version>1.0.4</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.powermock</groupId>
        <artifactId>powermock-module-test-mockito-junit4</artifactId>
        <version>1.4.12</version>
        <scope>test</scope>
        <exclusions>
            <exclusion>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-all</artifactId>
            </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>commons-lang</groupId>
        <artifactId>commons-lang</artifactId>
        <version>2.3</version>
      </dependency>
	  <dependency>
	    <groupId>org.apache.maven</groupId>
	    <artifactId>maven-toolchain</artifactId>
	    <version>2.2.1</version>
	  </dependency>
	  <dependency>
	    <groupId>org.apache.maven.plugin-tools</groupId>
	     <artifactId>maven-plugin-annotations</artifactId>
	      <version>3.1</version>
	    </dependency>
	    <dependency>
	      <groupId>org.codehaus.plexus</groupId>
	      <artifactId>plexus-utils</artifactId>
	      <version>3.0</version>
	    </dependency>
	    <dependency>
	      <groupId>org.codehaus.plexus</groupId>
	      <artifactId>plexus-compiler-api</artifactId>
	      <version>${plexusCompilerVersion}</version>
	      <exclusions>
	        <exclusion>
	          <groupId>org.codehaus.plexus</groupId>
	          <artifactId>plexus-component-api</artifactId>
	        </exclusion>
	      </exclusions>
	    </dependency>
	    <dependency>
	      <groupId>org.codehaus.plexus</groupId>
	      <artifactId>plexus-compiler-manager</artifactId>
	      <version>${plexusCompilerVersion}</version>
	      <exclusions>
	        <exclusion>
	          <groupId>org.codehaus.plexus</groupId>
	          <artifactId>plexus-component-api</artifactId>
	        </exclusion>
	      </exclusions>
	    </dependency>
	    <dependency>
	      <groupId>org.codehaus.plexus</groupId>
	      <artifactId>plexus-compiler-javac</artifactId>
	      <version>${plexusCompilerVersion}</version>
	      <scope>runtime</scope>
	      <exclusions>
	        <exclusion>
	          <groupId>org.codehaus.plexus</groupId>
	          <artifactId>plexus-component-api</artifactId>
	        </exclusion>
	      </exclusions>
	    </dependency>
	    <dependency>
	      <groupId>org.codehaus.plexus</groupId>
	      <artifactId>plexus-container-default</artifactId>
	      <version>1.0-alpha-9-stable-1</version>
	      <exclusions>
	          <exclusion>
	              <groupId>junit</groupId>
	              <artifactId>junit</artifactId>
	          </exclusion>
	      </exclusions>
	    </dependency>
	    <dependency>
	      <groupId>org.apache.maven.shared</groupId>
	      <artifactId>maven-plugin-testing-harness</artifactId>
	      <version>1.1</version>
	      <scope>test</scope>
	      <exclusions>
	          <exclusion>
	              <groupId>junit</groupId>
	              <artifactId>junit</artifactId>
	          </exclusion>
	      </exclusions>
	    </dependency>        
  </dependencies>
  
  <build>
      <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-toolchains-plugin</artifactId>
            <executions>
              <execution>
                <id>toolchain</id>
                <phase>validate</phase>
                <goals>
                  <goal>toolchain</goal>
                </goals>
                <configuration>
                  <toolchains>
                    <jdk>
                      <version>[${java_lang_level},)</version>
                    </jdk>
                  </toolchains>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-enforcer-plugin</artifactId>
              <version>${enforcerVersion}</version>
                  <executions>
                      <execution>
                         <id>enforce-versions</id>
                         <phase>validate</phase>
                         <goals>
                           <goal>display-info</goal>
                           <goal>enforce</goal>
                         </goals>
                         <configuration>
                           <rules>
                             <requireMavenVersion>
                                <version>[${maven.version},)</version>
                             </requireMavenVersion>
                             <requireJavaVersion>
                                <version>[${java_lang_level},)</version>
                             </requireJavaVersion>
                           </rules>
                         </configuration>
                      </execution>
                  </executions>
          </plugin>
      </plugins>
  </build>

  <inceptionYear>2012</inceptionYear>

  <url>https://paulmoloney.github.com/maven-enforcer-toolchain-rules</url>
  
  <issueManagement>
      <system>github</system>
      <url><![CDATA[http://github.com/paulmoloney/maven-enforcer-toolchain-rules/issues]]></url>
  </issueManagement>
      
  <scm>
      <!--connection>scm:git:git://github.com/paulmoloney/maven-enforcer-toolchain-rules.git</connection>
      <developerConnection>scm:git:git@github.com:paulmoloney/maven-enforcer-toolchain-rules.git</developerConnection>
      <url>https://github.com/paulmoloney/maven-enforcer-toolchain-rules/tree/master/</url-->
      <connection>scm:git:ssh://github.com/${owner}/${project.artifactId}.git</connection>
      <developerConnection>scm:git:ssh://git@github.com/${owner}/${project.artifactId}.git</developerConnection>
      <url>https://github.com/${owner}/${project.artifactId}/tree/master/</url>
      <tag>maven-enforcer-toolchain-rules-1.0.3</tag>
  </scm>
    
  <distributionManagement>
      <site>
          <id>github-site</id>
          <!--url>gitsite:git://github.com/paulmoloney/maven-enforcer-toolchain-rules.git</url-->
          <url>${site_deploy_url}/${project.artifactId}.git</url>
      </site>
    </distributionManagement>
    
  <profiles>
        <profile>
            <id>m2e</id>
            <activation>
                <property>
                    <name>m2e.version</name> <!-- Activate only when within eclipse -->
                </property>
            </activation>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>org.eclipse.m2e</groupId>
                            <artifactId>lifecycle-mapping</artifactId>
                            <version>${LiveCycleMapping_plugin_version}</version>
                            <configuration>
                                <lifecycleMappingMetadata>
                                    <pluginExecutions>
                                        <pluginExecution>
                                            <pluginExecutionFilter>
                                                <groupId>org.apache.maven.plugins</groupId>
                                                <artifactId>maven-enforcer-plugin</artifactId>
                                                <versionRange>[1.0,)</versionRange>
                                                <goals>
                                                    <goal>display-info</goal>
                                                    <goal>info</goal>
                                                    <goal>enforce</goal>
                                                </goals>
                                        </pluginExecutionFilter>
                                        <action>
                                            <ignore />
                                        </action>
                                    </pluginExecution>
                                    <pluginExecution>
                                        <pluginExecutionFilter>
                                            <groupId>org.apache.maven.plugins</groupId>
                                            <artifactId>maven-dependency-plugin</artifactId>
                                            <versionRange>[1.0,)</versionRange>
                                            <goals>
                                                <goal>copy-dependencies</goal>
                                                <goal>unpack</goal>
                                                <goal>unpack-dependencies</goal>
                                            </goals>
                                        </pluginExecutionFilter>
                                        <action>
                                            <ignore />
                                        </action>
                                    </pluginExecution>
                                    <pluginExecution>
                                        <pluginExecutionFilter>
                                            <groupId>org.apache.maven.plugins</groupId>
                                            <artifactId>maven-toolchains-plugin</artifactId>
                                            <versionRange>[1.0,)</versionRange>
                                            <goals>
                                                <goal>toolchain</goal>
                                            </goals>
                                        </pluginExecutionFilter>
                                        <action>
                                            <ignore />
                                        </action>
                                    </pluginExecution>
                                    <pluginExecution>
                                        <pluginExecutionFilter>
                                            <groupId>org.apache.felix</groupId>
                                            <artifactId>maven-bundle-plugin</artifactId>
                                            <versionRange>[1.0,)</versionRange>
                                            <goals>
                                                <goal>manifest</goal>
                                            </goals>
                                        </pluginExecutionFilter>
                                        <action>
                                            <execute />
                                        </action>
                                    </pluginExecution>
                                    <pluginExecution>
                                        <pluginExecutionFilter>
                                            <groupId>org.codehaus.mojo</groupId>
                                            <artifactId>buildnumber-maven-plugin</artifactId>
                                            <versionRange>[1.0,)</versionRange>
                                            <goals>
                                                <goal>create</goal>
                                                <goal>create-timestamp</goal>
                                            </goals>
                                          </pluginExecutionFilter>
                                          <action>
                                              <ignore />
                                          </action>
                                    </pluginExecution>
                                </pluginExecutions>
                              </lifecycleMappingMetadata>
                            </configuration>
                        </plugin>
                    </plugins>
                </pluginManagement>

                <plugins>
                    <plugin>
                        <!-- Set to false to work around Maven Eclipse plugin (m2e) bug -->
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-toolchains-plugin</artifactId>
                        <inherited>false</inherited>
                    </plugin>
                </plugins>
            </build>
        </profile>
  </profiles>
</project>
