<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>ca.jeb</groupId>
  <artifactId>protobuf-serializer</artifactId>
  <name>${project.groupId}:${project.artifactId}</name>
  <version>2014.10.01</version>
  <description>Use annotations to serialize POJO classes to Google Protobuf in Java</description>
  <inceptionYear>2014</inceptionYear>
  <url>https://github.com/ebourgeois/protobuf-serializer</url>
  <developers>
    <developer>
        <id>ebourgeois</id>
        <email>erick@jeb.ca</email>
        <name>Erick Bourgeois</name>
        <url>https://github.com/ebourgeois</url>
    </developer>
  </developers>
  <licenses>
    <license>
        <name>GNU General Public License</name>
        <url>https://gnu.org/licenses/gpl-3.0.txt</url>
    </license>
  </licenses>
  <scm>
      <connection>scm:git:git://github.com/ebourgeois/protobuf-serializer.git</connection>
      <developerConnection>scm:git:git@github.com:ebourgeois/protobuf-serializer.git</developerConnection>
      <url>http://github.com/ebourgeois/protobuf-serializer/master</url>
  </scm>
  <properties>
    <maven.compiler.target>1.7</maven.compiler.target>
    <maven.compiler.source>1.7</maven.compiler.source>
    <proto.executable.path>C:\Users\erick\dev\bin\protoc</proto.executable.path>
  </properties>
  <distributionManagement>
    <snapshotRepository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
    <repository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
  </distributionManagement>
  <dependencies>
    <dependency>
      <groupId>ca.jeb</groupId>
      <artifactId>common-java</artifactId>
      <version>2014.10.01</version>
    </dependency>
    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-core</artifactId>
      <version>1.1.2</version>
    </dependency>
    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
      <version>1.1.2</version>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>log4j-over-slf4j</artifactId>
      <version>1.7.7</version>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.11</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <build>
    <pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.12.4</version>
            </plugin>
            <plugin>
                <groupId>org.eclipse.m2e</groupId>
                <artifactId>lifecycle-mapping</artifactId>
                <version>1.0.0</version>
                <configuration>
                    <lifecycleMappingMetadata>
                        <pluginExecutions>
                            <pluginExecution>
                                <pluginExecutionFilter>
                                    <groupId>org.apache.maven.plugins</groupId>
                                    <artifactId>maven-antrun-plugin</artifactId>
                                    <versionRange>[1.3,)</versionRange>
                                    <goals>
                                        <goal>run</goal>
                                    </goals>
                                </pluginExecutionFilter>
                                <action>
                                    <ignore></ignore>
                                </action>
                            </pluginExecution>
                            <pluginExecution>
                                <pluginExecutionFilter>
                                    <groupId>org.codehaus.mojo</groupId>
                                    <artifactId>build-helper-maven-plugin</artifactId>
                                    <versionRange>[1.0,)</versionRange>
                                    <goals>
                                        <goal>test-compile</goal>
                                        <goal>add-source</goal>
                                        <goal>add-test-source</goal>
                                    </goals>
                                </pluginExecutionFilter>
                                <action>
                                    <execute />
                                </action>
                            </pluginExecution>
                        </pluginExecutions>
                    </lifecycleMappingMetadata>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <id>gen-proto-classes</id>
            <phase>generate-test-sources</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <tasks>
                 <fail message="The proto.executable.path is not set, please set this to the location of your protoc command.">
                     <condition>
                         <not><isset property="proto.executable.path" /></not>
                     </condition>
                 </fail>
                 <mkdir dir="${basedir}/target/generated-test-sources" />
                 <echo>Generating Google Protbuf classes...</echo> 
                 <exec executable="${proto.executable.path}" failonerror="true" logerror="true" >  
                     <arg value="--proto_path=${basedir}/src/test/resources/proto" />
                     <arg value="--java_out=${basedir}/target/generated-test-sources" />
                     <arg value="${basedir}/src/test/resources/proto/ca.jeb.Message.proto" />
                 </exec>
              </tasks>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
	      <groupId>org.codehaus.mojo</groupId>
	      <artifactId>build-helper-maven-plugin</artifactId>
	      <version>1.9.1</version>
	      <executions>
	        <execution>
	          <id>add-test-sources</id>
	          <phase>generate-test-sources</phase>
	          <goals>
	            <goal>add-test-source</goal>
	          </goals>
	          <configuration>
	            <sources>
	              <source>${basedir}/target/generated-test-sources</source>
	            </sources>
	          </configuration>
	        </execution>
	      </executions>
	  </plugin>
      <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <executions>
             <execution>
                <id>compile</id>
                <configuration>
                   <showDeprecation>true</showDeprecation>
                   <showWarnings>true</showWarnings>
                   <compilerArguments>
                      <source>${maven.compiler.source}</source>
                      <target>${maven.compiler.target}</target>
                   </compilerArguments>
                </configuration>
             </execution>
          </executions>
       </plugin>
       <plugin>
         <groupId>org.sonatype.plugins</groupId>
         <artifactId>nexus-staging-maven-plugin</artifactId>
         <version>1.6.3</version>
         <extensions>true</extensions>
         <configuration>
           <serverId>ossrh</serverId>
           <nexusUrl>https://oss.sonatype.org/</nexusUrl>
           <autoReleaseAfterClose>true</autoReleaseAfterClose>
         </configuration>
       </plugin>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-gpg-plugin</artifactId>
         <version>1.5</version>
         <executions>
           <execution>
             <id>sign-artifacts</id>
             <phase>verify</phase>
             <goals>
               <goal>sign</goal>
             </goals>
           </execution>
         </executions>
       </plugin>
       <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-release-plugin</artifactId>
          <version>2.5</version>
          <configuration>
            <autoVersionSubmodules>true</autoVersionSubmodules>
            <useReleaseProfile>false</useReleaseProfile>
            <releaseProfiles>release</releaseProfiles>
            <goals>deploy</goals>
          </configuration>
        </plugin>
       <!-- Javadoc and Sources -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>2.2.1</version>
          <executions>
            <execution>
              <id>attach-sources</id>
              <goals>
                <goal>jar-no-fork</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>2.9.1</version>
          <executions>
            <execution>
              <id>attach-javadocs</id>
              <goals>
                <goal>jar</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
    </plugins>
  </build>
</project>