protected void parsePropertiesFile ( InputStream propertiesInputStream ) throws MojoExecutionException { if ( propertiesInputStream == null ) { throw new MojoExecutionException ( "Properties file InputStream is null." ) ; } Properties props = new Properties ( ) ; try { props . load ( propertiesInputStream ) ; } catch ( IOException e ) { throw new MojoExecutionException ( "Could not load the properties Liquibase file" , e ) ; } for ( Iterator it = props . keySet ( ) . iterator ( ) ; it . hasNext ( ) ; ) { String key = null ; try { key = ( String ) it . next ( ) ; Field field = MavenUtils . getDeclaredField ( this . getClass ( ) , key ) ; if ( propertyFileWillOverride ) { getLog ( ) . debug ( " properties file setting value: " + field . getName ( ) ) ; setFieldValue ( field , props . get ( key ) . toString ( ) ) ; } else { if ( ! isCurrentFieldValueSpecified ( field ) ) { getLog ( ) . debug ( " properties file setting value: " + field . getName ( ) ) ; setFieldValue ( field , props . get ( key ) . toString ( ) ) ; } } } catch ( Exception e ) { getLog ( ) . info ( " '" + key + "' in properties file is not being used by this " + "task." ) ; } } }
Parses a properties file and sets the associated fields in the plugin .