<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.igormaznitsa</groupId>
  <artifactId>jcp</artifactId>
  <version>6.0.1</version>
  <packaging>maven-plugin</packaging>

  <name>Java Comment Preprocessor</name>
  <description>A Multi-pass java based preprocessor which directives can be injected as Java comments</description>
  <url>https://github.com/raydac/java-comment-preprocessor</url>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <timestamp>${maven.build.timestamp}</timestamp>
    <maven.build.timestamp.format>yyyyMMddHHmm</maven.build.timestamp.format>
    <maven.home>${user.home}/Programs/apache-maven-3.3.9</maven.home>
  </properties>

  <issueManagement>
    <system>GitHub Issues</system>
    <url>https://github.com/raydac/java-comment-preprocessor/issues</url>
  </issueManagement>
  <inceptionYear>2011</inceptionYear>
  <developers>
    <developer>
      <id>raydac</id>
      <name>Igor Maznitsa</name>
      <email>rrg4400@gmail.com</email>
      <url>http://www.igormaznitsa.com</url>
      <timezone>+2</timezone>
      <roles>
        <role>Author</role>
      </roles>
    </developer>
  </developers>

  <prerequisites>
    <maven>3.0</maven>
  </prerequisites>
   
  <scm>
    <url>https://github.com/raydac/java-comment-preprocessor</url>
    <connection>scm:git:git://github.com/raydac/java-comment-preprocessor.git</connection>
    <developerConnection>scm:git:git@github.com:raydac/java-comment-preprocessor.git</developerConnection>
  </scm>
    
  <organization>
    <name>Igor Maznitsa</name>
    <url>http://www.igormaznitsa.com</url>
  </organization>
    
  <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>

  <profiles>
    <profile>
      <id>integration-tests</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-failsafe-plugin</artifactId>
            <version>2.19</version>
            <executions>
              <execution>
                <goals>
                  <goal>integration-test</goal>
                  <goal>verify</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <encoding>UTF-8</encoding>
              <systemProperties>
                <property>
                  <!-- Unfortunately there is not any legal way to get the maven home -->
                  <name>maven.home</name>
                  <value>${maven.home}</value>
                </property>
                <property>
                  <name>plugin.jar</name>
                  <value>${project.build.directory}/${project.build.finalName}.jar</value>
                </property>
                <property>
                  <name>project.pom</name>
                  <value>${basedir}/pom.xml</value>
                </property>
              </systemProperties>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>prepare-distributive</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-assembly-plugin</artifactId>
            <version>2.4</version>
            <executions>
              <execution>
                <id>make-distributive</id>
                <phase>install</phase>
                <goals>
                  <goal>single</goal>
                </goals>
                <configuration>
                  <appendAssemblyId>false</appendAssemblyId>
                  <finalName>${project.artifactId}-${project.version}-${timestamp}-distr</finalName>
                  <descriptors>
                    <descriptor>src/assemble/distribution.xml</descriptor>
                  </descriptors>
                </configuration>
              </execution>
              <execution>
                <id>make-bundle</id>
                <phase>install</phase>
                <goals>
                  <goal>single</goal>
                </goals>
                <configuration>
                  <descriptors>
                    <descriptor>src/assemble/bundle.xml</descriptor>
                  </descriptors>
                </configuration>
              </execution>
            </executions>
          </plugin>
          
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>2.9</version>
            <executions>
              <execution>
                <id>generate-javadoc</id>
                <phase>package</phase>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.4</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

        </plugins>
      </build>
    </profile>
  </profiles>

  <dependencies>
    <dependency>
      <groupId>org.apache.maven.plugin-tools</groupId>
      <artifactId>maven-plugin-annotations</artifactId>
      <version>3.3</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-plugin-api</artifactId>
      <version>3.0.3</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-core</artifactId>
      <version>3.0.3</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.11</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-all</artifactId>
      <version>1.10.8</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.ant</groupId>
      <artifactId>ant</artifactId>
      <version>1.8.2</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.plugin-testing</groupId>
      <artifactId>maven-plugin-testing-harness</artifactId>
      <version>2.0</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.shared</groupId>
      <artifactId>maven-verifier</artifactId>
      <version>1.3</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.shared</groupId>
      <artifactId>maven-shared-jar</artifactId>
      <version>1.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.shared</groupId>
      <artifactId>file-management</artifactId>
      <version>1.2.1</version>
    </dependency>
    <dependency>
      <groupId>org.apache.ant</groupId>
      <artifactId>ant-testutil</artifactId>
      <version>1.8.2</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
      <version>2.4</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
      <version>3.4</version>
      <scope>compile</scope>
    </dependency>
  </dependencies>
  
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-plugin-plugin</artifactId>
        <version>3.3</version>
        <configuration>
          <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
        </configuration>
        <executions>
          <execution>
            <id>mojo-descriptor</id>
            <goals>
              <goal>descriptor</goal>
            </goals>
          </execution>
          <!-- if you want to generate help goal -->
          <execution>
            <id>help-goal</id>
            <goals>
              <goal>helpmojo</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <version>2.4.2</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <relocations>
                <relocation>
                  <pattern>org.apache.commons</pattern>
                  <shadedPattern>hidden.jcp.org.apache.commons</shadedPattern>
                </relocation>
              </relocations>
              <artifactSet>
                <includes>
                  <include>commons-io:*</include>
                  <include>org.apache.commons:*</include>
                </includes>
              </artifactSet>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>2.6</version>
        <configuration>
          <archive>
            <manifest>
              <mainClass>com.igormaznitsa.jcp.JCPreprocessor</mainClass>
            </manifest>
          </archive>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-site-plugin</artifactId>
        <version>3.4</version>
        <configuration>
          <reportPlugins>
            <plugin>
              <groupId>org.codehaus.mojo</groupId>
              <artifactId>cobertura-maven-plugin</artifactId>
              <version>2.6</version>
            </plugin>
          </reportPlugins>
        </configuration>
      </plugin>
            
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.3</version>
        <configuration>
          <compilerArgument>-Xlint:all</compilerArgument>
          <verbose>true</verbose>
          <source>1.6</source>
          <target>1.6</target>
          <showDeprecation>true</showDeprecation>
          <showWarnings>true</showWarnings>
          <excludes>
            <exclude>**/JCPreprocessor/src/test/resources/com/igormaznitsa/jcp/it/maven/dummy_maven_project/**/*.java</exclude>
          </excludes>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>2.4</version>
        <executions>
          <execution>
            <id>generate-sources</id>
            <phase>package</phase>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>animal-sniffer-maven-plugin</artifactId>
        <version>1.14</version>
        <configuration>
          <signature>
            <groupId>org.codehaus.mojo.signature</groupId>
            <artifactId>java16-sun</artifactId>
            <version>1.10</version>
          </signature>
        </configuration>
        <executions>
          <execution>
            <id>ensure-java-1.6-class-library</id>
            <phase>test</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>1.4.0</version>
        <executions>
          <execution>
            <goals>
              <goal>java</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <mainClass>com.igormaznitsa.jcp.JCPreprocessor</mainClass>
          <arguments>
            <argument>--i:/home/igorm/1/cc/Source</argument>
            <argument>--o:/home/igorm/1/cc/Preprocessed</argument>
          </arguments>
        </configuration>
      </plugin>
      
    </plugins>
  </build>
</project>
