<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>
    <parent>
         <groupId>cn.jmicro</groupId>
		 <artifactId>jmicro.parent</artifactId>
		 <version>0.0.3-RELEASE</version>
    </parent>
    <artifactId>jmicro.agent</artifactId>
    <packaging>jar</packaging>
    <name>${project.artifactId}</name>
    <description>agent Module</description>
    <dependencies>
         <dependency>
            <groupId>cn.jmicro</groupId>
            <artifactId>jmicro.api</artifactId>
        </dependency>
    </dependencies>
    
    <profiles>
    	<profile>
		    <id>release2maven</id>
		    <build>
		      <plugins>
		        <!--Compiler-->
		        <plugin>
		          <groupId>org.apache.maven.plugins</groupId>
		          <artifactId>maven-compiler-plugin</artifactId>
		        </plugin>
		        <!-- Source -->
		        <plugin>
		          <groupId>org.apache.maven.plugins</groupId>
		          <artifactId>maven-source-plugin</artifactId>
		          <executions>
		            <execution>
		              <phase>package</phase>
		              <goals>
		                <goal>jar-no-fork</goal>
		              </goals>
		            </execution>
		          </executions>
		        </plugin>
		        <!-- Javadoc -->
		        <plugin>
		          <groupId>org.apache.maven.plugins</groupId>
		          <artifactId>maven-javadoc-plugin</artifactId>
		          <executions>
		            <execution>
		              <phase>package</phase>
		              <goals>
		                <goal>jar</goal>
		              </goals>
		            </execution>
		          </executions>
		        </plugin>
		        <!-- GPG mvn clean deploy -P release -Dgpg.passphrase=YourPassphase-->
		        <plugin>
		          <groupId>org.apache.maven.plugins</groupId>
		          <artifactId>maven-gpg-plugin</artifactId>
		          <executions>
		            <execution>
		              <id>sign-artifacts</id>
		              <phase>verify</phase>
		              <goals>
		                <goal>sign</goal>
		              </goals>
		            </execution>
		          </executions>
		        </plugin>
		      </plugins>
		    </build>
		    <distributionManagement>
		      <repository>
		        <id>releases</id>
		        <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
		      </repository>
		      <snapshotRepository>
		        <id>snapshots</id>
		        <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
		      </snapshotRepository>
		    </distributionManagement>
		  </profile> 
    </profiles>
   
   <build>
        <plugins>
              <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <archive>
                        <index>true</index>
                        <manifestFile>
                            src/main/resources/META-INF/MANIFEST.MF
                        </manifestFile>
                        <manifest>
                            <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                        </manifest>
                        <addMavenDescriptor>true</addMavenDescriptor>
                        <manifestEntries>
                            <Specification-Version>${project.version}</Specification-Version>
                            <Implementation-Version>${project.version}</Implementation-Version>
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin> 
    </plugins>
    </build>

</project>