Message.init(new AntMessageImpl(getProject()));
if (!Message.isInitialised()) { Message.init(new AntMessageImpl(getProject())); getProject().addBuildListener(new BuildListener() { public void buildFinished(BuildEvent event) { Message.uninit(); }  public void buildStarted(BuildEvent event) { } public void targetStarted(BuildEvent event) { } public void targetFinished(BuildEvent event) { } public void taskStarted(BuildEvent event) { } public void taskFinished(BuildEvent event) { } public void messageLogged(BuildEvent event) { } }); }
    protected void ensureMessageInitialised() {        Message.init(new AntMessageImpl(getProject()));    }