2011-02-25 113 views

回答

2

Properties Maven Plugin看看:

的属性Maven插件是在这里 让生活与性能处理 时更容易一些。它提供了 文件的读写属性以及 文件的目标以及设置系统 属性的目标。

它的主要用例是从文件而不是 在pom.xml中宣称它们加载 性质,一些 与 不同环境打交道时派上用场。

用法:

<plugin> 
    <groupId>org.codehaus.mojo</groupId> 
    <artifactId>properties-maven-plugin</artifactId> 
    <version>1.0-alpha-2</version> 
    <executions> 
    <execution> 
     <phase>initialize</phase> 
     <goals> 
      <goal>read-project-properties</goal> 
     </goals> 
     <configuration> 
      <files> 
      <file>etc/config/dev.properties</file> 
      </files> 
     </configuration> 
     </execution> 
    </executions> 
</plugin>