This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 110465
Collapse All | Expand All

(-)a/maven/nbproject/project.xml (-2 / +1 lines)
Lines 40-46 Link Here
40
Version 2 license, then the option applies only if the new code is
40
Version 2 license, then the option applies only if the new code is
41
made subject to such option by the copyright holder.
41
made subject to such option by the copyright holder.
42
-->
42
-->
43
44
<project xmlns="http://www.netbeans.org/ns/project/1">
43
<project xmlns="http://www.netbeans.org/ns/project/1">
45
    <type>org.netbeans.modules.apisupport.project</type>
44
    <type>org.netbeans.modules.apisupport.project</type>
46
    <configuration>
45
    <configuration>
Lines 204-210 Link Here
204
                    <compile-dependency/>
203
                    <compile-dependency/>
205
                    <run-dependency>
204
                    <run-dependency>
206
                        <release-version>1</release-version>
205
                        <release-version>1</release-version>
207
                        <specification-version>1.31</specification-version>
206
                        <specification-version>1.32</specification-version>
208
                    </run-dependency>
207
                    </run-dependency>
209
                </dependency>
208
                </dependency>
210
                <dependency>
209
                <dependency>
(-)a/maven/src/org/netbeans/modules/maven/execute/AbstractMavenExecutor.java (-2 / +29 lines)
Lines 57-62 Link Here
57
import org.netbeans.modules.maven.api.execute.RunUtils;
57
import org.netbeans.modules.maven.api.execute.RunUtils;
58
import org.netbeans.modules.maven.execute.ui.RunGoalsPanel;
58
import org.netbeans.modules.maven.execute.ui.RunGoalsPanel;
59
import org.netbeans.modules.maven.spi.lifecycle.MavenBuildPlanSupport;
59
import org.netbeans.modules.maven.spi.lifecycle.MavenBuildPlanSupport;
60
import org.netbeans.spi.project.ui.support.BuildExecutionSupport;
60
import org.openide.DialogDescriptor;
61
import org.openide.DialogDescriptor;
61
import org.openide.DialogDisplayer;
62
import org.openide.DialogDisplayer;
62
import org.openide.execution.ExecutorTask;
63
import org.openide.execution.ExecutorTask;
Lines 84-90 Link Here
84
    private List<OutputListener> listeners = new ArrayList<OutputListener>();
85
    private List<OutputListener> listeners = new ArrayList<OutputListener>();
85
    protected ExecutorTask task;
86
    protected ExecutorTask task;
86
    private static final Set<String> forbidden = new HashSet<String>();
87
    private static final Set<String> forbidden = new HashSet<String>();
87
    
88
    protected MavenItem item;
89
    protected final Object SEMAPHORE = new Object();
88
90
89
    static {
91
    static {
90
        forbidden.add("netbeans.logger.console"); //NOI18N
92
        forbidden.add("netbeans.logger.console"); //NOI18N
Lines 123-129 Link Here
123
125
124
126
125
    public final void setTask(ExecutorTask task) {
127
    public final void setTask(ExecutorTask task) {
126
        this.task = task;
128
        synchronized (SEMAPHORE) {
129
            this.task = task;
130
            this.item = new MavenItem();
131
            SEMAPHORE.notifyAll();
132
        }
127
    }
133
    }
128
134
129
    public final void addInitialMessage(String line, OutputListener listener) {
135
    public final void addInitialMessage(String line, OutputListener listener) {
Lines 334-337 Link Here
334
            }
340
            }
335
        }
341
        }
336
    }
342
    }
343
344
    private class MavenItem implements BuildExecutionSupport.Item {
345
346
        public String getDisplayName() {
347
            return config.getTaskDisplayName();
348
        }
349
350
        public void repeatExecution() {
351
            RunUtils.executeMaven(config);
352
        }
353
354
        public boolean isRunning() {
355
            return !task.isFinished();
356
        }
357
358
        public void stopRunning() {
359
            AbstractMavenExecutor.this.cancel();
360
        }
361
362
    }
363
337
}
364
}
(-)a/maven/src/org/netbeans/modules/maven/execute/MavenCommandLineExecutor.java (+15 lines)
Lines 57-62 Link Here
57
import org.netbeans.modules.maven.api.execute.ExecutionContext;
57
import org.netbeans.modules.maven.api.execute.ExecutionContext;
58
import org.netbeans.modules.maven.api.execute.ExecutionResultChecker;
58
import org.netbeans.modules.maven.api.execute.ExecutionResultChecker;
59
import org.netbeans.modules.maven.api.execute.LateBoundPrerequisitesChecker;
59
import org.netbeans.modules.maven.api.execute.LateBoundPrerequisitesChecker;
60
import org.netbeans.spi.project.ui.support.BuildExecutionSupport;
60
import org.openide.filesystems.FileObject;
61
import org.openide.filesystems.FileObject;
61
import org.openide.filesystems.FileUtil;
62
import org.openide.filesystems.FileUtil;
62
import org.openide.util.Lookup;
63
import org.openide.util.Lookup;
Lines 88-93 Link Here
88
     * not to be called directrly.. use execute();
89
     * not to be called directrly.. use execute();
89
     */
90
     */
90
    public void run() {
91
    public void run() {
92
        synchronized (SEMAPHORE) {
93
            if (task == null) {
94
                try {
95
                    SEMAPHORE.wait();
96
                } catch (InterruptedException ex) {
97
                    LOGGER.log(Level.FINE, "interrupted", ex);
98
                }
99
            }
100
        }
101
91
        final RunConfig clonedConfig = new BeanRunConfig(this.config);
102
        final RunConfig clonedConfig = new BeanRunConfig(this.config);
92
        int executionresult = -10;
103
        int executionresult = -10;
93
        InputOutput ioput = getInputOutput();
104
        InputOutput ioput = getInputOutput();
Lines 107-112 Link Here
107
        handle.start();
118
        handle.start();
108
        processInitialMessage();
119
        processInitialMessage();
109
        try {
120
        try {
121
            BuildExecutionSupport.registerRunningItem(item);
122
110
            out = new CommandLineOutputHandler(ioput, clonedConfig.getProject(), handle, clonedConfig);
123
            out = new CommandLineOutputHandler(ioput, clonedConfig.getProject(), handle, clonedConfig);
111
            
124
            
112
            File workingDir = clonedConfig.getExecutionDirectory();
125
            File workingDir = clonedConfig.getExecutionDirectory();
Lines 172-177 Link Here
172
            }
185
            }
173
            throw death;
186
            throw death;
174
        } finally {
187
        } finally {
188
            BuildExecutionSupport.registerFinishedItem(item);
189
175
            try { //defend against badly written extensions..
190
            try { //defend against badly written extensions..
176
                out.buildFinished();
191
                out.buildFinished();
177
                if (clonedConfig.getProject() != null) {
192
                if (clonedConfig.getProject() != null) {
(-)a/maven/src/org/netbeans/modules/maven/execute/MavenJavaExecutor.java (-2 / +16 lines)
Lines 58-65 Link Here
58
import org.apache.maven.execution.DefaultMavenExecutionRequest;
58
import org.apache.maven.execution.DefaultMavenExecutionRequest;
59
import org.apache.maven.execution.MavenExecutionRequest;
59
import org.apache.maven.execution.MavenExecutionRequest;
60
import org.apache.maven.execution.MavenExecutionResult;
60
import org.apache.maven.execution.MavenExecutionResult;
61
import org.apache.maven.plugin.MojoExecutionException;
62
import org.apache.maven.plugin.MojoFailureException;
63
import org.netbeans.api.options.OptionsDisplayer;
61
import org.netbeans.api.options.OptionsDisplayer;
64
import org.netbeans.api.progress.ProgressHandle;
62
import org.netbeans.api.progress.ProgressHandle;
65
import org.netbeans.api.progress.ProgressHandleFactory;
63
import org.netbeans.api.progress.ProgressHandleFactory;
Lines 75-80 Link Here
75
import org.netbeans.modules.maven.api.execute.ExecutionContext;
73
import org.netbeans.modules.maven.api.execute.ExecutionContext;
76
import org.netbeans.modules.maven.api.execute.ExecutionResultChecker;
74
import org.netbeans.modules.maven.api.execute.ExecutionResultChecker;
77
import org.netbeans.modules.maven.api.execute.LateBoundPrerequisitesChecker;
75
import org.netbeans.modules.maven.api.execute.LateBoundPrerequisitesChecker;
76
import org.netbeans.spi.project.ui.support.BuildExecutionSupport;
78
import org.openide.awt.StatusDisplayer;
77
import org.openide.awt.StatusDisplayer;
79
import org.openide.filesystems.FileObject;
78
import org.openide.filesystems.FileObject;
80
import org.openide.filesystems.FileUtil;
79
import org.openide.filesystems.FileUtil;
Lines 111-116 Link Here
111
        handle.addContributor(backupContrib);
110
        handle.addContributor(backupContrib);
112
    }
111
    }
113
    
112
    
113
    @Override
114
    protected boolean isEmbedded() {
114
    protected boolean isEmbedded() {
115
        return true;
115
        return true;
116
    }
116
    }
Lines 121-126 Link Here
121
     * not to be called directrly.. use execute();
121
     * not to be called directrly.. use execute();
122
     */
122
     */
123
    public void run() {
123
    public void run() {
124
        synchronized (SEMAPHORE) {
125
            if (task == null) {
126
                try {
127
                    SEMAPHORE.wait();
128
                } catch (InterruptedException ex) {
129
                    LOGGER.log(Level.FINE, "interrupted", ex);
130
                }
131
            }
132
        }
133
124
        finishing = false;
134
        finishing = false;
125
        RunConfig clonedConfig = new BeanRunConfig(this.config);
135
        RunConfig clonedConfig = new BeanRunConfig(this.config);
126
        // check the prerequisites
136
        // check the prerequisites
Lines 162-167 Link Here
162
        MavenExecutionRequest req = new DefaultMavenExecutionRequest();
172
        MavenExecutionRequest req = new DefaultMavenExecutionRequest();
163
        int executionResult = -10;
173
        int executionResult = -10;
164
        try {
174
        try {
175
            BuildExecutionSupport.registerRunningItem(item);
176
165
            MavenEmbedder embedder;
177
            MavenEmbedder embedder;
166
            ProgressTransferListener.setAggregateHandle(handle);
178
            ProgressTransferListener.setAggregateHandle(handle);
167
            out = new JavaOutputHandler(ioput, clonedConfig.getProject(), handle, clonedConfig);
179
            out = new JavaOutputHandler(ioput, clonedConfig.getProject(), handle, clonedConfig);
Lines 256-261 Link Here
256
        } finally {
268
        } finally {
257
            finishing = true; //#103460
269
            finishing = true; //#103460
258
            ProgressHandle ph = ProgressHandleFactory.createSystemHandle( "Additional maven build processing");
270
            ProgressHandle ph = ProgressHandleFactory.createSystemHandle( "Additional maven build processing");
271
            BuildExecutionSupport.registerFinishedItem(item);
272
259
            ph.start();
273
            ph.start();
260
            try { //defend against badly written extensions..
274
            try { //defend against badly written extensions..
261
                out.buildFinished();
275
                out.buildFinished();

Return to bug 110465