`

maven获取svn版本号

阅读更多

很多时候项目中需要用的版本号。以下是maven获取svn(1.7版)版本号步骤:

  <plugin>  

    <groupId>com.google.code.maven-svn-revision-number-plugin</groupId>  

    <artifactId>maven-svn-revision-number-plugin</artifactId>  

    <version>1.7</version>  

    <configuration>  

        <verbose>true</verbose>  

        <entries>  

            <entry>  

                <prefix>prefix</prefix>  

                <depth>empty</depth>  

            </entry>  

        </entries>  

    </configuration>  

    <executions>  

        <execution>  

            <phase>validate</phase>  

            <goals>  

                <goal>revision</goal>  

            </goals>  

        </execution>  

    </executions>  

    <dependencies>  

        <dependency>  

            <groupId>org.tmatesoft.svnkit</groupId>  

            <artifactId>svnkit</artifactId>  

            <version>1.7.8</version>  

        </dependency>  

    </dependencies>  

</plugin>  

 

然后在代码中使用:

${prefix.revision}$获取 

<bean id="webinfo" class="com.cqtouch.web.entity.WebInfo" >

 <property name="svnVersion" value="${prefix.revision}" />

</bean>

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics