Class ReadPropertiesMojo

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

@Mojo(name="read-project-properties", defaultPhase=NONE, threadSafe=true) public class ReadPropertiesMojo extends AbstractPropertiesMojo
The read-project-properties goal reads property files and URLs and stores the properties as project properties. It serves as an alternate to specifying properties in pom.xml. It is especially useful when making properties defined in a runtime resource available at build time.
Since:
1.0.0
Author:
Zarar Siddiqi, Krystian Nowak
  • Constructor Details

    • ReadPropertiesMojo

      @Inject public ReadPropertiesMojo(List<PropertiesManager> propertiesManagers)
      Default constructor
      Parameters:
      propertiesManagers - list of properties managers
  • Method Details

    • setFiles

      public void setFiles(File[] files)
      Parameters:
      files - The files to set for tests.
    • setUrls

      public void setUrls(String[] urls)
      Default scope for test access.
      Parameters:
      urls - The URLs to set for tests.
    • execute

      public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
      Throws:
      org.apache.maven.plugin.MojoExecutionException
      org.apache.maven.plugin.MojoFailureException
    • setUseDefaultValues

      public void setUseDefaultValues(boolean useDefaultValues)
      Parameters:
      useDefaultValues - set to true if default values need to be processed within property placeholders
    • getProject

      public org.apache.maven.project.MavenProject getProject()
      For test access.
      Returns:
      The test project