Search in sources :

Example 1 with DefaultEventDispatcher

use of org.apache.maven.monitor.event.DefaultEventDispatcher in project intellij-community by JetBrains.

the class MavenEmbedder method createRequest.

private MavenExecutionRequest createRequest(File file, List<String> activeProfiles, List<String> inactiveProfiles, List<String> goals) {
    Properties executionProperties = myEmbedderSettings.getProperties();
    if (executionProperties == null)
        executionProperties = new Properties();
    DefaultEventDispatcher dispatcher = new DefaultEventDispatcher();
    dispatcher.addEventMonitor(new DefaultEventMonitor(myLogger));
    // subclassing because in DefaultMavenExecutionRequest field isRecursive is always false
    MavenExecutionRequest result = new DefaultMavenExecutionRequest(myLocalRepository, mySettings, dispatcher, goals, file.getParent(), createProfileManager(activeProfiles, inactiveProfiles, executionProperties), executionProperties, new Properties(), true) {

        private boolean myIsRecursive;

        @Override
        public boolean isRecursive() {
            return myIsRecursive;
        }

        @Override
        public void setRecursive(final boolean recursive) {
            myIsRecursive = recursive;
        }
    };
    result.setPomFile(file.getPath());
    result.setRecursive(myEmbedderSettings.isRecursive());
    return result;
}
Also used : MavenExecutionRequest(org.apache.maven.execution.MavenExecutionRequest) DefaultMavenExecutionRequest(org.apache.maven.execution.DefaultMavenExecutionRequest) DefaultMavenExecutionRequest(org.apache.maven.execution.DefaultMavenExecutionRequest) DefaultEventDispatcher(org.apache.maven.monitor.event.DefaultEventDispatcher) DefaultEventMonitor(org.apache.maven.monitor.event.DefaultEventMonitor)

Aggregations

DefaultMavenExecutionRequest (org.apache.maven.execution.DefaultMavenExecutionRequest)1 MavenExecutionRequest (org.apache.maven.execution.MavenExecutionRequest)1 DefaultEventDispatcher (org.apache.maven.monitor.event.DefaultEventDispatcher)1 DefaultEventMonitor (org.apache.maven.monitor.event.DefaultEventMonitor)1