org.codehaus.mojo.properties
Class ReadPropertiesMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.codehaus.mojo.properties.ReadPropertiesMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

public class ReadPropertiesMojo
extends org.apache.maven.plugin.AbstractMojo

The read-project-properties goal reads property files and stores the properties as project properties. It serves as an alternate to specifying properties in pom.xml.

Version:
$Id: ReadPropertiesMojo.java 8861 2009-01-21 15:35:38Z pgier $
Author:
Zarar Siddiqi, Krystian Nowak

Field Summary
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
ReadPropertiesMojo()
           
 
Method Summary
 void execute()
           
 File[] getFiles()
           
 String getIgnore()
           
protected  List<String> getListFromCSV(String csv)
           
 org.apache.maven.project.MavenProject getProject()
           
protected  Properties getProperties(File file)
           
protected  String getPropertyValue(String k, Properties p, Properties environment)
          Retrieves a property value, replacing values like ${token} using the Properties to look them up.
 boolean isQuiet()
           
 void setFiles(File[] files)
           
 void setIgnore(String ignoreProperties)
           
 void setQuiet(boolean quiet)
           
protected  void updateProperties(Properties p1, Properties p2, List<String> ignore)
           
protected  boolean validate(File file)
           
 
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReadPropertiesMojo

public ReadPropertiesMojo()
Method Detail

execute

public void execute()
             throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

updateProperties

protected void updateProperties(Properties p1,
                                Properties p2,
                                List<String> ignore)

getListFromCSV

protected List<String> getListFromCSV(String csv)

getPropertyValue

protected String getPropertyValue(String k,
                                  Properties p,
                                  Properties environment)
Retrieves a property value, replacing values like ${token} using the Properties to look them up. Shamelessly adapted from: http://maven.apache.org/plugins/maven-war-plugin/xref/org/apache/maven/plugin/war/PropertyUtils.html It will leave unresolved properties alone, trying for System properties, and environment variables and implements reparsing (in the case that the value of a property contains a key), and will not loop endlessly on a pair like test = ${test}

Parameters:
k - property key
p - project properties
environment - environment variables
Returns:
resolved property value

validate

protected boolean validate(File file)
                    throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

getProperties

protected Properties getProperties(File file)
                            throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

getFiles

public File[] getFiles()

setFiles

public void setFiles(File[] files)

isQuiet

public boolean isQuiet()

setQuiet

public void setQuiet(boolean quiet)

getIgnore

public String getIgnore()

setIgnore

public void setIgnore(String ignoreProperties)

getProject

public org.apache.maven.project.MavenProject getProject()


Copyright © 2009-2012 The Kuali Foundation. All Rights Reserved.