public ChangesXML()

in src/main/java/org/apache/maven/plugins/changes/ChangesXML.java [83:134]


    public ChangesXML( File xmlPath, Log log )
        throws ChangesXMLRuntimeException
    {

        if ( xmlPath == null || !xmlPath.exists() )
        {
            log.error( "changes xml file is null or not exists " );
            return;
        }

        try
        {

            ChangesXpp3Reader reader = new ChangesXpp3Reader();

            try ( FileInputStream fileInputStream = new FileInputStream( xmlPath ) )
            {
                changesDocument = reader.read( fileInputStream, false );
            }

            if ( changesDocument == null )
            {
                log.error( "Cannot build Changes Report from file: " + xmlPath.getPath() );
                return;
            }

            Properties properties = changesDocument.getProperties();

            if ( properties != null )
            {
                if ( properties.getAuthor() != null )
                {
                    this.author = properties.getAuthor().getName();
                    this.authorEmail = properties.getAuthor().getName();
                }
                this.title = properties.getTitle();
            }

            Body body = changesDocument.getBody();

            if ( body != null )
            {
                this.releaseList = body.getReleases();
            }

        }
        catch ( Throwable e )
        {
            log.error( "An error occurred when parsing the changes.xml file: ", e );
            throw new ChangesXMLRuntimeException( "An error occurred when parsing the changes.xml file", e );
        }
    }