2016-05-27 17 views

cevap

5

Bu, bu bilgileri okumak ve bir özellik dosyasında depolamak istediğiniz varsayılmaktadır. Tabanlı https://github.com/ktoso/maven-git-commit-id-plugin#using-the-plugin tarih:

pom.xml:/src/içinde

<?xml version="1.0" encoding="UTF-8"?> 
<project xmlns="http://maven.apache.org/POM/4.0.0" 
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd" 
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 
    <!-- snip other stuff... --> 
    <build> 
     <!-- GIT COMMIT ID PLUGIN CONFIGURATION --> 
     <resources> 
      <resource> 
       <directory>src/main/resources</directory> 
       <filtering>true</filtering> 
       <includes> 
        <include>**/*.properties</include> 
       </includes> 
      </resource> 
     </resources> 

     <plugins> 
      <plugin> 
       <groupId>pl.project13.maven</groupId> 
       <artifactId>git-commit-id-plugin</artifactId> 
       <version>2.2.1</version> 
       <executions> 
        <execution> 
         <goals> 
          <goal>revision</goal> 
         </goals> 
        </execution> 
       </executions> 

       <configuration> 
        <commitIdGenerationMode>flat</commitIdGenerationMode> 
        <gitDescribe> 
         <skip>true</skip> 
        </gitDescribe> 
       </configuration> 

      </plugin> 
      <!-- END OF GIT COMMIT ID PLUGIN CONFIGURATION --> 

      <!-- other plugins --> 
     </plugins> 
    </build> 
</project> 

git.properties ana/kaynaklar: birkaç diğer yanı Git destekler

git.commit.id=${git.commit.id} 
3

Sen maven-buildnumber-plugin kullanabilirsiniz, SCM sistemleri. vb kısa karmaları kullanın

SCM şube anlamaya, damgaları ekleyin:

Ayrıca sadece revizyon alma yanında, benzersiz yapı numarası oluşturarak ilgili ek özellik vardır/ID işlemek

İlgili konular