<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>
    
    <groupId>com.danhaywood.mavenmixin</groupId>
    <artifactId>staticanalysis</artifactId>
    <version>0.0.2</version>

    <packaging>pom</packaging>
    
    <name>${project.groupId}:${project.artifactId}</name>
    <description>
        Maven mixin providing the ability to run various static analysis plugins
    </description>
    
    <url>https://github.com/danhaywood/java-mavenmixin-staticanalysis</url>
    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>
    <scm>
        <connection>scm:git:git@github.com:danhaywood/java-mavenmixin-staticanalysis.git</connection>
        <developerConnection>scm:git:git@github.com:danhaywood/java-mavenmixin-staticanalysis.git</developerConnection>
        <url>git@github.com:danhaywood/java-mavenmixin-staticanalysis.git</url>
    </scm>
    <developers>
        <developer>
            <id>danhaywood</id>
            <name>Dan Haywood</name>
            <email>dan@haywood-associates.co.uk</email>
        </developer>
    </developers>    
    
    <profiles>
        <profile>
            <id>mavenmixin-staticanalysis</id>
            <activation>
                <property>
                    <name>mavenmixin-staticanalysis</name>
                </property>
            </activation>

            <properties>
                <maven-checkstyle-plugin.version>2.11</maven-checkstyle-plugin.version>
                <maven-pmd-plugin.version>3.0.1</maven-pmd-plugin.version>
                <javancss-maven-plugin.version>2.1</javancss-maven-plugin.version>
                <jdepend-maven-plugin.version>2.0-beta-2</jdepend-maven-plugin.version>
                <findbugs-maven-plugin.version>2.5</findbugs-maven-plugin.version>
                
                <maven-checkstyle-plugin.configLocation>checkstyle.xml</maven-checkstyle-plugin.configLocation>
                <maven-pmd-plugin.ruleset>pmd.xml</maven-pmd-plugin.ruleset>
            </properties>
            
			<reporting>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-checkstyle-plugin</artifactId>
						<version>${maven-checkstyle-plugin.version}</version>
						<configuration>
							<configLocation>${maven-checkstyle-plugin.configLocation}</configLocation>
						</configuration>
					</plugin>

					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-pmd-plugin</artifactId>
						<version>${maven-pmd-plugin.version}</version>
						<configuration>
							<sourceEncoding>${project.build.sourceEncoding}</sourceEncoding>
							<minimumTokens>100</minimumTokens>
							<linkXRef>true</linkXRef>
							<targetJdk>${compileTarget}</targetJdk>
							<rulesets>
								<ruleset>${maven-pmd-plugin.ruleset}</ruleset>
							</rulesets>
							<excludeRoots>
								<excludeRoot>
									${project.build.directory}/generated-sources/modello
								</excludeRoot>
								<excludeRoot>
									${project.build.directory}/generated-sources/plugin
								</excludeRoot>
							</excludeRoots>
						</configuration>
					</plugin>

					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>javancss-maven-plugin</artifactId>
						<version>${javancss-maven-plugin.version}</version>
					</plugin>

					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>jdepend-maven-plugin</artifactId>
						<version>${jdepend-maven-plugin.version}</version>
					</plugin>

				</plugins>

			</reporting>

			
			<build>
				<pluginManagement>
					<plugins>

						<!-- Quality checks: checkstyle -->
						<!-- goal:check binds to phase:verify (not currently configured, can be used to break build if any violations) -->
						<!-- goal:checkstyle is a report so is configured in the reporting section -->
						<plugin>
							<groupId>org.apache.maven.plugins</groupId>
							<artifactId>maven-checkstyle-plugin</artifactId>
							<version>${maven-checkstyle-plugin.version}</version>
						</plugin>

						<!-- Quality checks: pmd -->
						<!-- goal:check binds to phase:verify (not currently configured, can be used to break build if any violations) -->
						<!-- goal:check-cpd binds to phase:verify (not currently configured, can be used to break build if any CPD violations) -->
						<!-- goal:pmd is a report so is configured in the reporting section -->
						<!-- goal:cpd is a report so is configured in the reporting section -->
						<plugin>
							<groupId>org.apache.maven.plugins</groupId>
							<artifactId>maven-pmd-plugin</artifactId>
							<version>${maven-pmd-plugin.version}</version>
							<configuration>
								<targetJdk>${compileSource}</targetJdk>
								<sourceEncoding>${project.build.sourceEncoding}</sourceEncoding>
								<minimumTokens>100</minimumTokens>
								<linkXRef>true</linkXRef>
								<rulesets>
									<ruleset>${danhaywood-mavenmixin-staticanalysis.pmd.ruleset}</ruleset>
								</rulesets>
								<excludeRoots>
									<excludeRoot>
										${project.build.directory}/generated-sources/modello
									</excludeRoot>
									<excludeRoot>
										${project.build.directory}/generated-sources/plugin
									</excludeRoot>
								</excludeRoots>
							</configuration>
						</plugin>

						<!-- Quality checks: NCSS (cyclomatic complexity) -->
						<!-- goal:check binds to phase:verify (not currently configured, can be used to break build if any violations) -->
						<!-- goal:report is a report so is configured in the reporting section -->
						<plugin>
							<groupId>org.codehaus.mojo</groupId>
							<artifactId>javancss-maven-plugin</artifactId>
							<version>${javancss-maven-plugin.version}</version>
						</plugin>

						<!-- Quality checks: jdepend -->
						<!-- goal:generate is a report so is configured in the reporting section -->
						<plugin>
							<groupId>org.codehaus.mojo</groupId>
							<artifactId>jdepend-maven-plugin</artifactId>
							<version>${jdepend-maven-plugin.version}</version>
						</plugin>
						
						<plugin>
							<groupId>org.codehaus.mojo</groupId>
							<artifactId>findbugs-maven-plugin</artifactId>
							<version>${findbugs-maven-plugin.version}</version>
							<inherited>true</inherited>
						</plugin>
						
					</plugins>
				</pluginManagement>
				
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-checkstyle-plugin</artifactId>
						<executions>
							<execution>
								<phase>verify</phase>
								<goals>
									<goal>checkstyle</goal>
								</goals>
							</execution>
						</executions>
					</plugin>

					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>findbugs-maven-plugin</artifactId>
						<inherited>true</inherited>
						<configuration>
							<findbugsXmlOutput>true</findbugsXmlOutput>
							<xmlOutput>true</xmlOutput>
							<failOnError>false</failOnError>
						</configuration>
						<executions>
							<execution>
								<phase>verify</phase>
								<goals>
									<goal>check</goal>
								</goals>
							</execution>
						</executions>
					</plugin>

					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-pmd-plugin</artifactId>
						<executions>
							<execution>
								<phase>verify</phase>
								<goals>
									<goal>pmd</goal>
								</goals>
							</execution>
						</executions>
					</plugin>

				</plugins>
			</build>
			
        </profile>

        <profile>
            <id>danhaywood-mavenmixin-sonatyperelease</id>
            <!-- 
            this profile is not part of the mixin, but is required to be defined as a profile
            in order to release this mixin pom.xml to Maven Central repo
            -->
            <build>
                <plugins>
                    <!-- http://central.sonatype.org/pages/apache-maven.html -->
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.6.2</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                    <!-- http://kohsuke.org/pgp-maven-plugin/secretkey.html instead of maven-gpg-plugin -->
                    <plugin>
                        <groupId>org.kohsuke</groupId>
                        <artifactId>pgp-maven-plugin</artifactId>
                        <version>1.1</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
            <distributionManagement>
                <snapshotRepository>
                    <id>ossrh</id>
                    <url>https://oss.sonatype.org/content/repositories/snapshots</url>
                </snapshotRepository>
            </distributionManagement>
        </profile>
    </profiles>

    
</project>






				
				
