开发者

Maven equivalent to the Ant's propertyfile option

sorry for lamer question, but I really could not found subject. I have a external to the pom.xml file, say backup.properties, and would like it lo开发者_如何学Pythonad by next mvn run.

Any direction would be greatly appreciated

Oleg


Take a look at the Properties Maven Plugin:

The Properties Maven Plugin is here to make life a little easier when dealing with properties. It provides goals to read and write properties from and to files, and also to set system properties.

It's main use-case is loading properties from files instead of declaring them in pom.xml, something that comes in handy when dealing with different environments.

Usage:

<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>


Take a look the Properties Maven Plugin.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜