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 183455
Collapse All | Expand All

(-)a/maven/src/org/netbeans/modules/maven/api/customizer/support/CheckBoxUpdater.java (-2 / +2 lines)
Lines 71-77 Link Here
71
            inherited = false;
71
            inherited = false;
72
            component.setFont(component.getFont().deriveFont(Font.BOLD));
72
            component.setFont(component.getFont().deriveFont(Font.BOLD));
73
73
74
            component.setToolTipText(""); //NOI18N
74
            component.setToolTipText(null);
75
        } else {
75
        } else {
76
            component.setToolTipText(NbBundle.getMessage(CheckBoxUpdater.class, "MSG_Value_Inherited")); //NOI18N
76
            component.setToolTipText(NbBundle.getMessage(CheckBoxUpdater.class, "MSG_Value_Inherited")); //NOI18N
77
            inherited = true;
77
            inherited = true;
Lines 100-106 Link Here
100
    private void setCheckBoxValue(Boolean value, boolean defValue, JCheckBox component) {
100
    private void setCheckBoxValue(Boolean value, boolean defValue, JCheckBox component) {
101
        if (value != null) {
101
        if (value != null) {
102
            component.setSelected(value.booleanValue());
102
            component.setSelected(value.booleanValue());
103
            component.setToolTipText(""); //NOI18N
103
            component.setToolTipText(null);
104
            inherited = false;
104
            inherited = false;
105
            component.setFont(component.getFont().deriveFont(Font.BOLD));
105
            component.setFont(component.getFont().deriveFont(Font.BOLD));
106
        } else {
106
        } else {
(-)a/maven/src/org/netbeans/modules/maven/api/execute/Bundle.properties (-3 / +3 lines)
Lines 34-39 Link Here
34
# Contributor(s):
34
# Contributor(s):
35
#
35
#
36
# Portions Copyrighted 2009 Sun Microsystems, Inc.
36
# Portions Copyrighted 2009 Sun Microsystems, Inc.
37
HINT_EmbeddedBuild=<html><b>No Apache Maven installation was found on your computer.</b> <p> As a fallback, an embedded instance will be used for building. \
37
HINT_EmbeddedBuild=<html><b>You're using an embedded Maven runtime for building.</b>\
38
However, the embedded version is not a stable release and errors and incompatibilities in the build execution are to be expected. <p><b>Please specify a Maven location in the Options window. </b>
38
<p>However, the embedded version is not a stable release and errors and incompatibilities in the build execution are to be expected.<p>\
39
39
<b>Please specify an external Maven runtime in the Options window.</b>
(-)a/maven/src/org/netbeans/modules/maven/api/execute/RunUtils.java (-1 / +1 lines)
Lines 84-90 Link Here
84
            }
84
            }
85
        }
85
        }
86
        
86
        
87
        if (!useEmbedded && MavenSettings.canFindExternalMaven()) {
87
        if (!useEmbedded && MavenSettings.getDefault().isUsingExternalRuntime()) {
88
            exec = new MavenCommandLineExecutor(config);
88
            exec = new MavenCommandLineExecutor(config);
89
        } else {
89
        } else {
90
            if (!warningShown && DontShowAgainSettings.getDefault().showWarningAboutEmbeddedBuild()) {
90
            if (!warningShown && DontShowAgainSettings.getDefault().showWarningAboutEmbeddedBuild()) {
(-)a/maven/src/org/netbeans/modules/maven/customizer/ActionMappings.form (-9 / +9 lines)
Lines 1-4 Link Here
1
<?xml version="1.0" encoding="UTF-8" ?>
1
<?xml version="1.1" encoding="UTF-8" ?>
2
2
3
<Form version="1.5" maxVersion="1.6" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
3
<Form version="1.5" maxVersion="1.6" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
4
  <AuxValues>
4
  <AuxValues>
Lines 20-27 Link Here
20
              <Group type="103" groupAlignment="0" attributes="0">
20
              <Group type="103" groupAlignment="0" attributes="0">
21
                  <Group type="102" alignment="0" attributes="0">
21
                  <Group type="102" alignment="0" attributes="0">
22
                      <Component id="cbCommandLine" min="-2" max="-2" attributes="0"/>
22
                      <Component id="cbCommandLine" min="-2" max="-2" attributes="0"/>
23
                      <EmptySpace pref="53" max="32767" attributes="0"/>
23
                      <EmptySpace pref="172" max="32767" attributes="0"/>
24
                      <Component id="btnSetup" min="-2" pref="229" max="-2" attributes="0"/>
24
                      <Component id="btnSetup" min="-2" max="-2" attributes="0"/>
25
                  </Group>
25
                  </Group>
26
                  <Component id="jScrollPane2" alignment="0" pref="560" max="32767" attributes="0"/>
26
                  <Component id="jScrollPane2" alignment="0" pref="560" max="32767" attributes="0"/>
27
                  <Group type="102" alignment="0" attributes="0">
27
                  <Group type="102" alignment="0" attributes="0">
Lines 36-45 Link Here
36
                      </Group>
36
                      </Group>
37
                      <EmptySpace max="-2" attributes="0"/>
37
                      <EmptySpace max="-2" attributes="0"/>
38
                      <Group type="103" groupAlignment="0" attributes="0">
38
                      <Group type="103" groupAlignment="0" attributes="0">
39
                          <Component id="txtProfiles" pref="440" max="32767" attributes="2"/>
39
                          <Component id="txtProfiles" pref="442" max="32767" attributes="2"/>
40
                          <Component id="txtGoals" alignment="0" pref="440" max="32767" attributes="2"/>
40
                          <Component id="txtGoals" alignment="0" pref="442" max="32767" attributes="2"/>
41
                          <Group type="102" alignment="1" attributes="0">
41
                          <Group type="102" alignment="1" attributes="0">
42
                              <Component id="jScrollPane1" pref="297" max="32767" attributes="1"/>
42
                              <Component id="jScrollPane1" pref="325" max="32767" attributes="1"/>
43
                              <EmptySpace max="-2" attributes="0"/>
43
                              <EmptySpace max="-2" attributes="0"/>
44
                              <Group type="103" groupAlignment="0" attributes="0">
44
                              <Group type="103" groupAlignment="0" attributes="0">
45
                                  <Component id="btnRemove" linkSize="1" min="-2" max="-2" attributes="0"/>
45
                                  <Component id="btnRemove" linkSize="1" min="-2" max="-2" attributes="0"/>
Lines 51-63 Link Here
51
                              <EmptySpace type="separate" max="-2" attributes="0"/>
51
                              <EmptySpace type="separate" max="-2" attributes="0"/>
52
                              <Component id="cbBuildWithDeps" min="-2" max="-2" attributes="0"/>
52
                              <Component id="cbBuildWithDeps" min="-2" max="-2" attributes="0"/>
53
                          </Group>
53
                          </Group>
54
                          <Component id="jScrollPane3" alignment="0" pref="440" max="32767" attributes="0"/>
54
                          <Component id="jScrollPane3" alignment="0" pref="442" max="32767" attributes="0"/>
55
                          <Group type="102" alignment="1" attributes="0">
55
                          <Group type="102" alignment="1" attributes="0">
56
                              <Component id="comConfiguration" pref="297" max="32767" attributes="0"/>
56
                              <Component id="comConfiguration" pref="299" max="32767" attributes="0"/>
57
                              <EmptySpace min="-2" pref="143" max="-2" attributes="0"/>
57
                              <EmptySpace min="-2" pref="143" max="-2" attributes="0"/>
58
                          </Group>
58
                          </Group>
59
                          <Group type="102" alignment="1" attributes="0">
59
                          <Group type="102" alignment="1" attributes="0">
60
                              <Component id="txtDirectory" pref="211" max="32767" attributes="0"/>
60
                              <Component id="txtDirectory" pref="229" max="32767" attributes="0"/>
61
                              <EmptySpace max="-2" attributes="0"/>
61
                              <EmptySpace max="-2" attributes="0"/>
62
                              <Component id="btnDirectory" min="-2" max="-2" attributes="0"/>
62
                              <Component id="btnDirectory" min="-2" max="-2" attributes="0"/>
63
                          </Group>
63
                          </Group>
(-)a/maven/src/org/netbeans/modules/maven/customizer/ActionMappings.java (-15 / +19 lines)
Lines 232-257 Link Here
232
                org.netbeans.modules.maven.model.profile.Profile prof = handle.getNetbeansPrivateProfile(false);
232
                org.netbeans.modules.maven.model.profile.Profile prof = handle.getNetbeansPrivateProfile(false);
233
                if (prof != null) {
233
                if (prof != null) {
234
                    org.netbeans.modules.maven.model.profile.Properties profprops = prof.getProperties();
234
                    org.netbeans.modules.maven.model.profile.Properties profprops = prof.getProperties();
235
                    if (profprops != null && profprops.getProperty(Constants.HINT_USE_EXTERNAL) != null) {
235
                    if (profprops != null && profprops.getProperty(Constants.HINT_USE_EXTERNAL) != null && !Boolean.valueOf(prof.getProperties().getProperty(Constants.HINT_USE_EXTERNAL))) {
236
                        return Boolean.valueOf(prof.getProperties().getProperty(Constants.HINT_USE_EXTERNAL));
236
                        return !Boolean.valueOf(prof.getProperties().getProperty(Constants.HINT_USE_EXTERNAL));
237
                    }
237
                    }
238
                }
238
                }
239
                org.netbeans.modules.maven.model.pom.Properties mdlprops = handle.getPOMModel().getProject().getProperties();
239
                org.netbeans.modules.maven.model.pom.Properties mdlprops = handle.getPOMModel().getProject().getProperties();
240
                String val;
240
                String val;
241
                if (mdlprops != null) {
241
                if (mdlprops != null) {
242
                    val = mdlprops.getProperty(Constants.HINT_USE_EXTERNAL);
242
                    val = mdlprops.getProperty(Constants.HINT_USE_EXTERNAL);
243
                    if (val != null) {
243
                    if (val != null && !Boolean.valueOf(val)) {
244
                        return Boolean.valueOf(val);
244
                        return !Boolean.valueOf(val);
245
                    }
245
                    }
246
                }
246
                }
247
                val = handle.getRawAuxiliaryProperty(Constants.HINT_USE_EXTERNAL, true);
247
                val = handle.getRawAuxiliaryProperty(Constants.HINT_USE_EXTERNAL, true);
248
                if (val != null) {
248
                if (val != null && !Boolean.valueOf(val)) {
249
                    return Boolean.valueOf(val);
249
                    return !Boolean.valueOf(val);
250
                }
250
                }
251
                return null;
251
                return null;
252
            }
252
            }
253
253
254
            public void setValue(Boolean value) {
254
            public void setValue(Boolean value) {
255
				// The meaning of this option is opposite to the configuration
256
				// Constants.HINT_USE_EXTERNAL
257
				value = (value == null) ? null : !value.booleanValue();
255
                boolean hasConfig = handle.getRawAuxiliaryProperty(Constants.HINT_USE_EXTERNAL, true) != null;
258
                boolean hasConfig = handle.getRawAuxiliaryProperty(Constants.HINT_USE_EXTERNAL, true) != null;
256
                //TODO also try to take the value in pom vs inherited pom value into account.
259
                //TODO also try to take the value in pom vs inherited pom value into account.
257
260
Lines 287-293 Link Here
287
            }
290
            }
288
291
289
            public boolean getDefaultValue() {
292
            public boolean getDefaultValue() {
290
                return true;
293
				// false means DON'T Force to use an embedded Maven runtime.
294
                return false;
291
            }
295
            }
292
        };
296
        };
293
        clearFields();
297
        clearFields();
Lines 475-482 Link Here
475
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
479
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
476
                    .addGroup(layout.createSequentialGroup()
480
                    .addGroup(layout.createSequentialGroup()
477
                        .addComponent(cbCommandLine)
481
                        .addComponent(cbCommandLine)
478
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 53, Short.MAX_VALUE)
482
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 172, Short.MAX_VALUE)
479
                        .addComponent(btnSetup, javax.swing.GroupLayout.PREFERRED_SIZE, 229, javax.swing.GroupLayout.PREFERRED_SIZE))
483
                        .addComponent(btnSetup, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
480
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 560, Short.MAX_VALUE)
484
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 560, Short.MAX_VALUE)
481
                    .addGroup(layout.createSequentialGroup()
485
                    .addGroup(layout.createSequentialGroup()
482
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
486
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
Lines 489-498 Link Here
489
                            .addComponent(lblDirectory))
493
                            .addComponent(lblDirectory))
490
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
494
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
491
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
495
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
492
                            .addComponent(txtProfiles, javax.swing.GroupLayout.DEFAULT_SIZE, 440, Short.MAX_VALUE)
496
                            .addComponent(txtProfiles, javax.swing.GroupLayout.DEFAULT_SIZE, 442, Short.MAX_VALUE)
493
                            .addComponent(txtGoals, javax.swing.GroupLayout.DEFAULT_SIZE, 440, Short.MAX_VALUE)
497
                            .addComponent(txtGoals, javax.swing.GroupLayout.DEFAULT_SIZE, 442, Short.MAX_VALUE)
494
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
498
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
495
                                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 297, Short.MAX_VALUE)
499
                                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 325, Short.MAX_VALUE)
496
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
500
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
497
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
501
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
498
                                    .addComponent(btnRemove)
502
                                    .addComponent(btnRemove)
Lines 501-512 Link Here
501
                                .addComponent(cbRecursively)
505
                                .addComponent(cbRecursively)
502
                                .addGap(18, 18, 18)
506
                                .addGap(18, 18, 18)
503
                                .addComponent(cbBuildWithDeps))
507
                                .addComponent(cbBuildWithDeps))
504
                            .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 440, Short.MAX_VALUE)
508
                            .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 442, Short.MAX_VALUE)
505
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
509
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
506
                                .addComponent(comConfiguration, 0, 297, Short.MAX_VALUE)
510
                                .addComponent(comConfiguration, 0, 299, Short.MAX_VALUE)
507
                                .addGap(143, 143, 143))
511
                                .addGap(143, 143, 143))
508
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
512
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
509
                                .addComponent(txtDirectory, javax.swing.GroupLayout.DEFAULT_SIZE, 211, Short.MAX_VALUE)
513
                                .addComponent(txtDirectory, javax.swing.GroupLayout.DEFAULT_SIZE, 229, Short.MAX_VALUE)
510
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
514
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
511
                                .addComponent(btnDirectory)))))
515
                                .addComponent(btnDirectory)))))
512
                .addContainerGap())
516
                .addContainerGap())
(-)a/maven/src/org/netbeans/modules/maven/customizer/Bundle.properties (-4 / +4 lines)
Lines 108-116 Link Here
108
TIT_Add_action=Action Name\:
108
TIT_Add_action=Action Name\:
109
LBL_AddAction=Enter action name
109
LBL_AddAction=Enter action name
110
LBL_Actions=Ac&tions:
110
LBL_Actions=Ac&tions:
111
LBL_UseExternal=&Use external Maven for build execution
111
LBL_UseExternal=Force to &use embedded Maven runtime
112
TLT_UseExternal=If selected, will build with external version of Maven. Otherwise builds with embedded Maven.
112
TLT_UseExternal=If selected, will build with external version of Maven. Otherwise builds with embedded Maven.
113
LBL_SetupExternal=<html><a href="">Setup external Maven &home</a></html>
113
LBL_SetupExternal=<html><a href="">Setup Maven &Runtimes</a></html>
114
ActionMappings.lblConfiguration.text=Confi&guration:
114
ActionMappings.lblConfiguration.text=Confi&guration:
115
TIT_Project_Properties=Project Properties - {0}
115
TIT_Project_Properties=Project Properties - {0}
116
ActionMappings.btnAddProps.text=A&dd >
116
ActionMappings.btnAddProps.text=A&dd >
Lines 132-140 Link Here
132
CompilePanel.cbDeprecate.text=Report Uses of &Deprecated APIs
132
CompilePanel.cbDeprecate.text=Report Uses of &Deprecated APIs
133
CompilePanel.lblJavaPlatform.text=Java &Platform:
133
CompilePanel.lblJavaPlatform.text=Java &Platform:
134
CompilePanel.btnMngPlatform.text=&Manage Java Platforms...
134
CompilePanel.btnMngPlatform.text=&Manage Java Platforms...
135
CompilePanel.lblWarnPlatform.text=<html>Warning: Setting Java Platform is not possible with the embedded Maven which is currently in use. To set the Java Platform you must use an external Maven installation.
135
CompilePanel.lblWarnPlatform.text=<html>Warning: Setting Java Platform is not possible with the embedded Maven which is currently in use. To set the Java Platform you must use an external Maven runtime.
136
AddPropertyDialog.lblPropertyExpressions.text=Property Expressions :
136
AddPropertyDialog.lblPropertyExpressions.text=Property Expressions :
137
CompilePanel.btnSetupHome.text=Set up &external Maven home
137
CompilePanel.btnSetupHome.text=Setup Mav&en Runtimes
138
AN_SourceLevel=Source level combo box
138
AN_SourceLevel=Source level combo box
139
SourcesPanel.lblSrc.text=&Source Folder:
139
SourcesPanel.lblSrc.text=&Source Folder:
140
SourcesPanel.lblTestSrc.text=&Test Source Folder:
140
SourcesPanel.lblTestSrc.text=&Test Source Folder:
(-)a/maven/src/org/netbeans/modules/maven/customizer/CompilePanel.form (-5 / +5 lines)
Lines 1-4 Link Here
1
<?xml version="1.0" encoding="UTF-8" ?>
1
<?xml version="1.1" encoding="UTF-8" ?>
2
2
3
<Form version="1.5" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
3
<Form version="1.5" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
4
  <Properties>
4
  <Properties>
Lines 34-47 Link Here
34
                      </Group>
34
                      </Group>
35
                      <EmptySpace min="-2" max="-2" attributes="0"/>
35
                      <EmptySpace min="-2" max="-2" attributes="0"/>
36
                      <Group type="103" groupAlignment="0" attributes="0">
36
                      <Group type="103" groupAlignment="0" attributes="0">
37
                          <Component id="comJavaPlatform" pref="302" max="32767" attributes="2"/>
37
                          <Component id="comJavaPlatform" pref="273" max="32767" attributes="2"/>
38
                          <Component id="comCompileOnSave" alignment="0" pref="302" max="32767" attributes="2"/>
38
                          <Component id="comCompileOnSave" alignment="0" pref="273" max="32767" attributes="2"/>
39
                      </Group>
39
                      </Group>
40
                      <EmptySpace min="-2" pref="16" max="-2" attributes="0"/>
40
                      <EmptySpace min="-2" pref="16" max="-2" attributes="0"/>
41
                      <Component id="btnMngPlatform" min="-2" max="-2" attributes="0"/>
41
                      <Component id="btnMngPlatform" min="-2" max="-2" attributes="0"/>
42
                  </Group>
42
                  </Group>
43
                  <Group type="102" alignment="1" attributes="0">
43
                  <Group type="102" alignment="1" attributes="0">
44
                      <Component id="lblWarnPlatform" pref="389" max="32767" attributes="0"/>
44
                      <Component id="lblWarnPlatform" pref="409" max="32767" attributes="0"/>
45
                      <EmptySpace max="-2" attributes="0"/>
45
                      <EmptySpace max="-2" attributes="0"/>
46
                      <Component id="btnSetupHome" min="-2" max="-2" attributes="0"/>
46
                      <Component id="btnSetupHome" min="-2" max="-2" attributes="0"/>
47
                  </Group>
47
                  </Group>
Lines 71-77 Link Here
71
              <Component id="cbDebug" min="-2" max="-2" attributes="0"/>
71
              <Component id="cbDebug" min="-2" max="-2" attributes="0"/>
72
              <EmptySpace max="-2" attributes="0"/>
72
              <EmptySpace max="-2" attributes="0"/>
73
              <Component id="cbDeprecate" min="-2" max="-2" attributes="0"/>
73
              <Component id="cbDeprecate" min="-2" max="-2" attributes="0"/>
74
              <EmptySpace pref="109" max="32767" attributes="0"/>
74
              <EmptySpace pref="114" max="32767" attributes="0"/>
75
              <Group type="103" groupAlignment="0" attributes="0">
75
              <Group type="103" groupAlignment="0" attributes="0">
76
                  <Component id="btnSetupHome" min="-2" max="-2" attributes="0"/>
76
                  <Component id="btnSetupHome" min="-2" max="-2" attributes="0"/>
77
                  <Component id="lblWarnPlatform" min="-2" max="-2" attributes="0"/>
77
                  <Component id="lblWarnPlatform" min="-2" max="-2" attributes="0"/>
(-)a/maven/src/org/netbeans/modules/maven/customizer/CompilePanel.java (-6 / +6 lines)
Lines 380-386 Link Here
380
        String val = props.get(Constants.HINT_USE_EXTERNAL, true);
380
        String val = props.get(Constants.HINT_USE_EXTERNAL, true);
381
        boolean useEmbedded = "false".equalsIgnoreCase(val);
381
        boolean useEmbedded = "false".equalsIgnoreCase(val);
382
382
383
        return !useEmbedded && MavenSettings.canFindExternalMaven();
383
        return !useEmbedded && MavenSettings.getDefault().isUsingExternalRuntime();
384
    }
384
    }
385
385
386
    private void checkExternalMaven () {
386
    private void checkExternalMaven () {
Lines 464-475 Link Here
464
                            .add(lblJavaPlatform))
464
                            .add(lblJavaPlatform))
465
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
465
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
466
                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
466
                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
467
                            .add(comJavaPlatform, 0, 302, Short.MAX_VALUE)
467
                            .add(comJavaPlatform, 0, 273, Short.MAX_VALUE)
468
                            .add(comCompileOnSave, 0, 302, Short.MAX_VALUE))
468
                            .add(comCompileOnSave, 0, 273, Short.MAX_VALUE))
469
                        .add(16, 16, 16)
469
                        .add(16, 16, 16)
470
                        .add(btnMngPlatform))
470
                        .add(btnMngPlatform))
471
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
471
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
472
                        .add(lblWarnPlatform, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 389, Short.MAX_VALUE)
472
                        .add(lblWarnPlatform, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 409, Short.MAX_VALUE)
473
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
473
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
474
                        .add(btnSetupHome)))
474
                        .add(btnSetupHome)))
475
                .addContainerGap())
475
                .addContainerGap())
Lines 493-502 Link Here
493
                .add(cbDebug)
493
                .add(cbDebug)
494
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
494
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
495
                .add(cbDeprecate)
495
                .add(cbDeprecate)
496
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 109, Short.MAX_VALUE)
496
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 114, Short.MAX_VALUE)
497
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
497
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
498
                    .add(btnSetupHome)
498
                    .add(btnSetupHome)
499
                    .add(lblWarnPlatform))
499
                    .add(lblWarnPlatform, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
500
                .addContainerGap())
500
                .addContainerGap())
501
        );
501
        );
502
502
(-)a/maven/src/org/netbeans/modules/maven/options/Bundle.properties (-12 / +12 lines)
Lines 40-60 Link Here
40
40
41
TIP_Maven_Category=Set default Maven execution options.
41
TIP_Maven_Category=Set default Maven execution options.
42
SettingsPanel.btnIndex.text=Index &Now
42
SettingsPanel.btnIndex.text=Index &Now
43
SettingsPanel.lblLocalRepository.text=&Local Repository \:
43
SettingsPanel.lblLocalRepository.text=&Local Repository:
44
SettingsPanel.btnLocalRepository.text=&Browse...
44
SettingsPanel.btnLocalRepository.text=&Browse...
45
SettingsPanel.lblIndex.text=&Index Update Frequency\:
45
SettingsPanel.lblIndex.text=&Index Update Frequency\:
46
SettingsPanel.cbSnapshots.text=Include &Snapshots In Local Index
46
SettingsPanel.cbSnapshots.text=Include &Snapshots In Local Index
47
47
48
TIT_Select=Select Local Repository Location
48
TIT_Select=Select Local Repository Location
49
SettingsPanel.lblCommandLine.text=External &Maven Home :
49
SettingsPanel.lblCommandLine.text=Active &Maven Runtime:
50
TIT_Select2=Select Maven2 Installation Location
50
TIT_Select2=Select Maven2 Installation Location
51
52
SettingsPanel.txtCommandLine.text=
53
SettingsPanel.btnCommandLine.text=&Browse...
54
SettingsPanel.btnGoals.text=Edit &Global Custom Goal Definitions...
51
SettingsPanel.btnGoals.text=Edit &Global Custom Goal Definitions...
55
TIT_Global=Global Maven Goal definitions
52
TIT_Global=Global Maven Goal definitions
56
ACSD_Global=Global Maven Goal definitions
53
ACSD_Global=Global Maven Goal definitions
57
SettingsPanel.lblEmbeddedVersion.text=
58
LBL_MavenVersion1=(Embedded Maven version: {0} built on {1})
54
LBL_MavenVersion1=(Embedded Maven version: {0} built on {1})
59
LBL_MavenVersion2=(Embedded Maven version: {0})
55
LBL_MavenVersion2=(Embedded Maven version: {0})
60
LBL_MavenVersion3=Unable to determine version of embedded Maven
56
LBL_MavenVersion3=Unable to determine version of embedded Maven
Lines 68-81 Link Here
68
FREQ_Always=On every startup
64
FREQ_Always=On every startup
69
FREQ_Never=Never
65
FREQ_Never=Never
70
ERR_Wrong_Settings_file=Cannot parse the ~/.m2/settings.xml file, any options related to that file will be disabled.
66
ERR_Wrong_Settings_file=Cannot parse the ~/.m2/settings.xml file, any options related to that file will be disabled.
71
SettingsPanel.lblOptions.text=Global Execution &Options :
67
SettingsPanel.lblOptions.text=Global Execution &Options:
72
SettingsPanel.btnOptions.text=&Add
68
SettingsPanel.btnOptions.text=&Add
73
GlobalOptionsPanel.lblOptions.text=&Global Execution Options :
69
GlobalOptionsPanel.lblOptions.text=&Global Execution Options:
74
SettingsPanel.lblBinaries.text=&Download Binaries :
70
SettingsPanel.lblBinaries.text=&Download Binaries:
75
SettingsPanel.jLabel3.text=<html><b>Please note</b> that setting any of these to values other than <b>"Never"</b> can make opening projects significantly slower.
71
SettingsPanel.jLabel3.text=<html><b>Please note</b> that setting any of these to values other than <b>"Never"</b> can make opening projects significantly slower.
76
On_Project_Open=On Project Open
72
On_Project_Open=On Project Open
77
SettingsPanel.lblSource.text=Check &Sources :
73
SettingsPanel.lblSource.text=Check &Sources:
78
SettingsPanel.lblJavadoc.text=Check &Javadoc :
74
SettingsPanel.lblJavadoc.text=Check &Javadoc:
79
txt_default_repository=<Use default local repository as defined by Maven>
75
txt_default_repository=<Use default local repository as defined by Maven>
80
WORK_OFFLINE=Work offline.
76
WORK_OFFLINE=Work offline.
81
PRODUCE_EXECUTION_DEBUG_OUTPUT=Produce execution debug output.
77
PRODUCE_EXECUTION_DEBUG_OUTPUT=Produce execution debug output.
Lines 91-98 Link Here
91
FORCES_A_CHECK=Forces a check for updated releases and snapshots on remote repositories.
87
FORCES_A_CHECK=Forces a check for updated releases and snapshots on remote repositories.
92
DON'T_USE_PLUGIN-REGISTRY=Don't use ~/.m2/plugin-registry.xml for plugin versions
88
DON'T_USE_PLUGIN-REGISTRY=Don't use ~/.m2/plugin-registry.xml for plugin versions
93
TIT_Add_Globals=Add Global Option(s)
89
TIT_Add_Globals=Add Global Option(s)
94
SettingsPanel.jLabel1.text=On Project Open :
90
SettingsPanel.jLabel1.text=On Project Open:
95
TIT_NEVER=Never
91
TIT_NEVER=Never
96
TIT_EVERY=Every Project Open
92
TIT_EVERY=Every Project Open
97
TIT_FIRST=First Open Only
93
TIT_FIRST=First Open Only
98
SettingsPanel.cbSkipTests.text=Skip &Tests for any build executions not directly related to testing
94
SettingsPanel.cbSkipTests.text=Skip &Tests for any build executions not directly related to testing
95
MAVEN_RUNTIME_Embedded=Embedded
96
MAVEN_RUNTIME_External={0}
97
MAVEN_RUNTIME_Browse=Browse...
98
MAVEN_RUNTIME_ClearUserDefines=Clear User-Defined Maven Runtimes
(-)a/maven/src/org/netbeans/modules/maven/options/MyJTextField.java (-2 / +2 lines)
Lines 47-53 Link Here
47
 *
47
 *
48
 * @author mkleint
48
 * @author mkleint
49
 */
49
 */
50
public class MyJTextField extends JTextField {
50
public class JHintedTextField extends JTextField {
51
51
52
    Color origForeground;
52
    Color origForeground;
53
    String origText = "";
53
    String origText = "";
Lines 72-78 Link Here
72
        }
72
        }
73
    };
73
    };
74
74
75
    public MyJTextField() {
75
    public JHintedTextField() {
76
        addFocusListener(listener);
76
        addFocusListener(listener);
77
    }
77
    }
78
78
(-)a/maven/src/org/netbeans/modules/maven/options/MavenRuntime.java (+78 lines)
Line 0 Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
5
 *
6
 * The contents of this file are subject to the terms of either the GNU
7
 * General Public License Version 2 only ("GPL") or the Common
8
 * Development and Distribution License("CDDL") (collectively, the
9
 * "License"). You may not use this file except in compliance with the
10
 * License. You can obtain a copy of the License at
11
 * http://www.netbeans.org/cddl-gplv2.html
12
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
13
 * specific language governing permissions and limitations under the
14
 * License.  When distributing the software, include this License Header
15
 * Notice in each file and include the License file at
16
 * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
17
 * particular file as subject to the "Classpath" exception as provided
18
 * by Sun in the GPL Version 2 section of the License file that
19
 * accompanied this code. If applicable, add the following below the
20
 * License Header, with the fields enclosed by brackets [] replaced by
21
 * your own identifying information:
22
 * "Portions Copyrighted [year] [name of copyright owner]"
23
 *
24
 * If you wish your version of this file to be governed by only the CDDL
25
 * or only the GPL Version 2, indicate your decision by adding
26
 * "[Contributor] elects to include this software in this distribution
27
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
28
 * single choice of license, a recipient has the option to distribute
29
 * your version of this file under either the CDDL, the GPL Version 2 or
30
 * to extend the choice of license to its licensees as provided above.
31
 * However, if you add GPL Version 2 code and therefore, elected the GPL
32
 * Version 2 license, then the option applies only if the new code is
33
 * made subject to such option by the copyright holder.
34
 *
35
 * Contributor(s):
36
 *
37
 * Portions Copyrighted 2010 Sun Microsystems, Inc.
38
 */
39
40
package org.netbeans.modules.maven.options;
41
42
import java.io.Serializable;
43
44
/**
45
 *
46
 * @author johnsonlau@netbeans.org
47
 */
48
public class MavenRuntime implements Serializable {
49
50
	private String path;
51
	private String version;
52
53
	public MavenRuntime(String path, String version) {
54
		this.path = path;
55
		this.version = version;
56
	}
57
58
	public String getPath() {
59
		return path;
60
	}
61
62
	public void setPath(String path) {
63
		this.path = path;
64
	}
65
66
	public String getVersion() {
67
		return version;
68
	}
69
70
	public void setVersion(String version) {
71
		this.version = version;
72
	}
73
74
	public boolean isExternal() {
75
		return !"".equals(path);
76
	}
77
78
}
(-)a/maven/src/org/netbeans/modules/maven/options/MavenSettings.java (-440 / +528 lines)
Lines 1-440 Link Here
1
/*
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
3
 *
4
 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
4
 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
5
 *
5
 *
6
 * The contents of this file are subject to the terms of either the GNU
6
 * The contents of this file are subject to the terms of either the GNU
7
 * General Public License Version 2 only ("GPL") or the Common
7
 * General Public License Version 2 only ("GPL") or the Common
8
 * Development and Distribution License("CDDL") (collectively, the
8
 * Development and Distribution License("CDDL") (collectively, the
9
 * "License"). You may not use this file except in compliance with the
9
 * "License"). You may not use this file except in compliance with the
10
 * License. You can obtain a copy of the License at
10
 * License. You can obtain a copy of the License at
11
 * http://www.netbeans.org/cddl-gplv2.html
11
 * http://www.netbeans.org/cddl-gplv2.html
12
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
12
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
13
 * specific language governing permissions and limitations under the
13
 * specific language governing permissions and limitations under the
14
 * License.  When distributing the software, include this License Header
14
 * License.  When distributing the software, include this License Header
15
 * Notice in each file and include the License file at
15
 * Notice in each file and include the License file at
16
 * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
16
 * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
17
 * particular file as subject to the "Classpath" exception as provided
17
 * particular file as subject to the "Classpath" exception as provided
18
 * by Sun in the GPL Version 2 section of the License file that
18
 * by Sun in the GPL Version 2 section of the License file that
19
 * accompanied this code. If applicable, add the following below the
19
 * accompanied this code. If applicable, add the following below the
20
 * License Header, with the fields enclosed by brackets [] replaced by
20
 * License Header, with the fields enclosed by brackets [] replaced by
21
 * your own identifying information:
21
 * your own identifying information:
22
 * "Portions Copyrighted [year] [name of copyright owner]"
22
 * "Portions Copyrighted [year] [name of copyright owner]"
23
 *
23
 *
24
 * If you wish your version of this file to be governed by only the CDDL
24
 * If you wish your version of this file to be governed by only the CDDL
25
 * or only the GPL Version 2, indicate your decision by adding
25
 * or only the GPL Version 2, indicate your decision by adding
26
 * "[Contributor] elects to include this software in this distribution
26
 * "[Contributor] elects to include this software in this distribution
27
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
27
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
28
 * single choice of license, a recipient has the option to distribute
28
 * single choice of license, a recipient has the option to distribute
29
 * your version of this file under either the CDDL, the GPL Version 2 or
29
 * your version of this file under either the CDDL, the GPL Version 2 or
30
 * to extend the choice of license to its licensees as provided above.
30
 * to extend the choice of license to its licensees as provided above.
31
 * However, if you add GPL Version 2 code and therefore, elected the GPL
31
 * However, if you add GPL Version 2 code and therefore, elected the GPL
32
 * Version 2 license, then the option applies only if the new code is
32
 * Version 2 license, then the option applies only if the new code is
33
 * made subject to such option by the copyright holder.
33
 * made subject to such option by the copyright holder.
34
 *
34
 *
35
 * Contributor(s):
35
 * Contributor(s):
36
 *
36
 *
37
 * Portions Copyrighted 2008 Sun Microsystems, Inc.
37
 * Portions Copyrighted 2008 Sun Microsystems, Inc.
38
 */
38
 */
39
39
40
package org.netbeans.modules.maven.options;
40
package org.netbeans.modules.maven.options;
41
41
42
import hidden.org.codehaus.plexus.util.StringUtils;
42
import hidden.org.codehaus.plexus.util.StringUtils;
43
import hidden.org.codehaus.plexus.util.cli.Arg;
43
import hidden.org.codehaus.plexus.util.cli.Arg;
44
import hidden.org.codehaus.plexus.util.cli.CommandLineException;
44
import hidden.org.codehaus.plexus.util.cli.CommandLineException;
45
import hidden.org.codehaus.plexus.util.cli.CommandLineUtils;
45
import hidden.org.codehaus.plexus.util.cli.CommandLineUtils;
46
import hidden.org.codehaus.plexus.util.cli.Commandline;
46
import hidden.org.codehaus.plexus.util.cli.Commandline;
47
import hidden.org.codehaus.plexus.util.cli.StreamConsumer;
47
import hidden.org.codehaus.plexus.util.cli.StreamConsumer;
48
import java.io.File;
48
import java.io.File;
49
import java.util.logging.Logger;
49
import java.util.ArrayList;
50
import java.util.prefs.BackingStoreException;
50
import java.util.Collections;
51
import java.util.prefs.Preferences;
51
import java.util.List;
52
import java.util.regex.Matcher;
52
import java.util.logging.Logger;
53
import java.util.regex.Pattern;
53
import java.util.prefs.BackingStoreException;
54
import org.apache.maven.execution.MavenExecutionRequest;
54
import java.util.prefs.Preferences;
55
import org.netbeans.modules.maven.embedder.EmbedderFactory;
55
import java.util.regex.Matcher;
56
import org.openide.filesystems.FileUtil;
56
import java.util.regex.Pattern;
57
import org.openide.util.Exceptions;
57
import org.apache.maven.execution.MavenExecutionRequest;
58
import org.openide.util.NbPreferences;
58
import org.netbeans.modules.maven.embedder.EmbedderFactory;
59
import org.openide.util.Utilities;
59
import org.openide.filesystems.FileUtil;
60
60
import org.openide.util.Exceptions;
61
/**
61
import org.openide.util.NbBundle;
62
 * a netbeans settings for global options that cannot be put into the settings file.
62
import org.openide.util.NbPreferences;
63
 * @author mkleint
63
import org.openide.util.Utilities;
64
 */
64
65
public class MavenSettings  {
65
/**
66
    public static final String PROP_DEFAULT_OPTIONS = "defaultOptions"; // NOI18N
66
 * a netbeans settings for global options that cannot be put into the settings file.
67
    public static final String PROP_SYNCH_PROXY = "synchronizeProxySettings"; //NOI18N
67
 * @author mkleint
68
    public static final String PROP_USE_COMMANDLINE = "useCommandLineMaven"; //NOI18N
68
 */
69
    public static final String PROP_COMMANDLINE_PATH = "commandLineMavenPath"; //NOI18N
69
public class MavenSettings  {
70
    public static final String PROP_SHOW_RUN_DIALOG = "showRunDialog"; //NOI18N
70
    public static final String PROP_DEFAULT_OPTIONS = "defaultOptions"; // NOI18N
71
    public static final String PROP_SOURCE_DOWNLOAD = "sourceDownload"; //NOI18N
71
    public static final String PROP_SYNCH_PROXY = "synchronizeProxySettings"; //NOI18N
72
    public static final String PROP_JAVADOC_DOWNLOAD = "javadocDownload"; //NOI18N
72
    public static final String PROP_USE_COMMANDLINE = "useCommandLineMaven"; //NOI18N
73
    public static final String PROP_BINARY_DOWNLOAD = "binaryDownload"; //NOI18N
73
    public static final String PROP_COMMANDLINE_PATH = "commandLineMavenPath"; //NOI18N
74
    public static final String PROP_LAST_ARCHETYPE_GROUPID = "lastArchetypeGroupId"; //NOI18N
74
    public static final String PROP_SHOW_RUN_DIALOG = "showRunDialog"; //NOI18N
75
    public static final String PROP_CUSTOM_LOCAL_REPOSITORY = "localRepository"; //NOI18N
75
    public static final String PROP_SOURCE_DOWNLOAD = "sourceDownload"; //NOI18N
76
    public static final String PROP_SKIP_TESTS = "skipTests"; //NOI18N
76
    public static final String PROP_JAVADOC_DOWNLOAD = "javadocDownload"; //NOI18N
77
77
    public static final String PROP_BINARY_DOWNLOAD = "binaryDownload"; //NOI18N
78
    //these are from former versions (6.5) and are here only for conversion
78
    public static final String PROP_LAST_ARCHETYPE_GROUPID = "lastArchetypeGroupId"; //NOI18N
79
    private static final String PROP_DEBUG = "showDebug"; // NOI18N
79
    public static final String PROP_CUSTOM_LOCAL_REPOSITORY = "localRepository"; //NOI18N
80
    private static final String PROP_ERRORS = "showErrors"; //NOI18N
80
    public static final String PROP_SKIP_TESTS = "skipTests"; //NOI18N
81
    private static final String PROP_CHECKSUM_POLICY = "checksumPolicy"; //NOI18N
81
    public static final String PROP_MAVEN_RUNTIMES = "mavenRuntimes"; //NOI18N
82
    private static final String PROP_PLUGIN_POLICY = "pluginUpdatePolicy"; //NOI18N
82
83
    private static final String PROP_FAILURE_BEHAVIOUR = "failureBehaviour"; //NOI18N
83
    //these are from former versions (6.5) and are here only for conversion
84
    private static final String PROP_USE_REGISTRY = "usePluginRegistry"; //NOI18N
84
    private static final String PROP_DEBUG = "showDebug"; // NOI18N
85
85
    private static final String PROP_ERRORS = "showErrors"; //NOI18N
86
    
86
    private static final String PROP_CHECKSUM_POLICY = "checksumPolicy"; //NOI18N
87
    private static final MavenSettings INSTANCE = new MavenSettings();
87
    private static final String PROP_PLUGIN_POLICY = "pluginUpdatePolicy"; //NOI18N
88
    
88
    private static final String PROP_FAILURE_BEHAVIOUR = "failureBehaviour"; //NOI18N
89
    public static MavenSettings getDefault() {
89
    private static final String PROP_USE_REGISTRY = "usePluginRegistry"; //NOI18N
90
        return INSTANCE;
90
91
    }
91
    
92
92
    private static final MavenSettings INSTANCE = new MavenSettings();
93
    public boolean isInteractive() {
93
    
94
        return !hasOption("--batch", "-B"); //NOI18N
94
    public static MavenSettings getDefault() {
95
    }
95
        return INSTANCE;
96
96
    }
97
    public Boolean isOffline() {
97
98
        if (hasOption("--offline", "-o")) { //NOI18N
98
    public boolean isInteractive() {
99
            return Boolean.TRUE;
99
        return !hasOption("--batch", "-B"); //NOI18N
100
        }
100
    }
101
        return null;
101
102
    }
102
    public Boolean isOffline() {
103
103
        if (hasOption("--offline", "-o")) { //NOI18N
104
    public boolean isShowDebug() {
104
            return Boolean.TRUE;
105
        return hasOption("--debug", "-X"); //NOI18N
105
        }
106
    }
106
        return null;
107
107
    }
108
    public boolean isShowErrors() {
108
109
        return hasOption("--errors", "-e"); //NOI18N
109
    public boolean isShowDebug() {
110
    }
110
        return hasOption("--debug", "-X"); //NOI18N
111
111
    }
112
    public boolean isUpdateSnapshots() {
112
113
        return hasOption("--update-snapshots", "-U"); //NOI18N
113
    public boolean isShowErrors() {
114
    }
114
        return hasOption("--errors", "-e"); //NOI18N
115
115
    }
116
116
117
    public boolean hasOption(String longName, String shortName) {
117
    public boolean isUpdateSnapshots() {
118
        String defOpts = getDefaultOptions();
118
        return hasOption("--update-snapshots", "-U"); //NOI18N
119
        if (defOpts != null) {
119
    }
120
            try {
120
121
                String[] strs = CommandLineUtils.translateCommandline(defOpts);
121
122
                for (String s : strs) {
122
    public boolean hasOption(String longName, String shortName) {
123
                    s = s.trim();
123
        String defOpts = getDefaultOptions();
124
                    if (s.startsWith(shortName) || s.startsWith(longName)) {
124
        if (defOpts != null) {
125
                        return true;
125
            try {
126
                    }
126
                String[] strs = CommandLineUtils.translateCommandline(defOpts);
127
                }
127
                for (String s : strs) {
128
            } catch (Exception ex) {
128
                    s = s.trim();
129
                Logger.getLogger(MavenSettings.class.getName()).fine("Error parsing global options:" + defOpts);
129
                    if (s.startsWith(shortName) || s.startsWith(longName)) {
130
                //will check for contains of -X be enough?
130
                        return true;
131
                return defOpts.contains(longName) || defOpts.contains(shortName);
131
                    }
132
            }
132
                }
133
        }
133
            } catch (Exception ex) {
134
        return false;
134
                Logger.getLogger(MavenSettings.class.getName()).fine("Error parsing global options:" + defOpts);
135
    }
135
                //will check for contains of -X be enough?
136
136
                return defOpts.contains(longName) || defOpts.contains(shortName);
137
    
137
            }
138
    protected final Preferences getPreferences() {
138
        }
139
        return NbPreferences.forModule(MavenSettings.class);
139
        return false;
140
    }
140
    }
141
    
141
142
    protected final String putProperty(String key, String value) {
142
    
143
        String retval = getProperty(key);
143
    protected final Preferences getPreferences() {
144
        if (value != null) {
144
        return NbPreferences.forModule(MavenSettings.class);
145
            getPreferences().put(key, value);
145
    }
146
        } else {
146
    
147
            getPreferences().remove(key);
147
    protected final String putProperty(String key, String value) {
148
        }
148
        String retval = getProperty(key);
149
        return retval;
149
        if (value != null) {
150
    }
150
            getPreferences().put(key, value);
151
151
        } else {
152
    protected final String getProperty(String key) {
152
            getPreferences().remove(key);
153
        return getPreferences().get(key, null);
153
        }
154
    }    
154
        return retval;
155
    
155
    }
156
    private MavenSettings() {
156
157
        //import from older versions
157
    protected final String getProperty(String key) {
158
        String defOpts = getPreferences().get(PROP_DEFAULT_OPTIONS, null);
158
        return getPreferences().get(key, null);
159
        if (defOpts == null) {
159
    }    
160
            defOpts = "";
160
    
161
            //only when not already set by user or by previous import
161
    private MavenSettings() {
162
            String debug = getPreferences().get(PROP_DEBUG, null);
162
        //import from older versions
163
            if (debug != null) {
163
        String defOpts = getPreferences().get(PROP_DEFAULT_OPTIONS, null);
164
                boolean val = Boolean.parseBoolean(debug);
164
        if (defOpts == null) {
165
                if (val) {
165
            defOpts = "";
166
                    defOpts = defOpts + " --debug";//NOI18N
166
            //only when not already set by user or by previous import
167
                }
167
            String debug = getPreferences().get(PROP_DEBUG, null);
168
                getPreferences().remove(PROP_DEBUG);
168
            if (debug != null) {
169
            }
169
                boolean val = Boolean.parseBoolean(debug);
170
            String error = getPreferences().get(PROP_ERRORS, null);
170
                if (val) {
171
            if (error != null) {
171
                    defOpts = defOpts + " --debug";//NOI18N
172
                boolean val = Boolean.parseBoolean(error);
172
                }
173
                if (val) {
173
                getPreferences().remove(PROP_DEBUG);
174
                    defOpts = defOpts + " --errors"; //NOI18N
174
            }
175
                }
175
            String error = getPreferences().get(PROP_ERRORS, null);
176
                getPreferences().remove(PROP_ERRORS);
176
            if (error != null) {
177
            }
177
                boolean val = Boolean.parseBoolean(error);
178
            String checksum = getPreferences().get(PROP_CHECKSUM_POLICY, null);
178
                if (val) {
179
            if (checksum != null) {
179
                    defOpts = defOpts + " --errors"; //NOI18N
180
                if (MavenExecutionRequest.CHECKSUM_POLICY_FAIL.equals(checksum)) {
180
                }
181
                    defOpts = defOpts + " --strict-checksums";//NOI18N
181
                getPreferences().remove(PROP_ERRORS);
182
                } else if (MavenExecutionRequest.CHECKSUM_POLICY_WARN.equals(checksum)) {
182
            }
183
                    defOpts = defOpts + " --lax-checksums";//NOI18N
183
            String checksum = getPreferences().get(PROP_CHECKSUM_POLICY, null);
184
                }
184
            if (checksum != null) {
185
                getPreferences().remove(PROP_CHECKSUM_POLICY);
185
                if (MavenExecutionRequest.CHECKSUM_POLICY_FAIL.equals(checksum)) {
186
            }
186
                    defOpts = defOpts + " --strict-checksums";//NOI18N
187
            String fail = getPreferences().get(PROP_FAILURE_BEHAVIOUR, null);
187
                } else if (MavenExecutionRequest.CHECKSUM_POLICY_WARN.equals(checksum)) {
188
            if (fail != null) {
188
                    defOpts = defOpts + " --lax-checksums";//NOI18N
189
                if (MavenExecutionRequest.REACTOR_FAIL_NEVER.equals(fail)) {
189
                }
190
                    defOpts = defOpts + " --fail-never";//NOI18N
190
                getPreferences().remove(PROP_CHECKSUM_POLICY);
191
                } else if (MavenExecutionRequest.REACTOR_FAIL_FAST.equals(fail)) {
191
            }
192
                    defOpts = defOpts + " --fail-fast";//NOI18N
192
            String fail = getPreferences().get(PROP_FAILURE_BEHAVIOUR, null);
193
                } else if (MavenExecutionRequest.REACTOR_FAIL_AT_END.equals(fail)) {
193
            if (fail != null) {
194
                    defOpts = defOpts + " --fail-at-end";//NOI18N
194
                if (MavenExecutionRequest.REACTOR_FAIL_NEVER.equals(fail)) {
195
                }
195
                    defOpts = defOpts + " --fail-never";//NOI18N
196
                getPreferences().remove(PROP_FAILURE_BEHAVIOUR);
196
                } else if (MavenExecutionRequest.REACTOR_FAIL_FAST.equals(fail)) {
197
            }
197
                    defOpts = defOpts + " --fail-fast";//NOI18N
198
            String pluginUpdate = getPreferences().get(PROP_PLUGIN_POLICY, null);
198
                } else if (MavenExecutionRequest.REACTOR_FAIL_AT_END.equals(fail)) {
199
            if (pluginUpdate != null) {
199
                    defOpts = defOpts + " --fail-at-end";//NOI18N
200
                if (Boolean.parseBoolean(pluginUpdate)) {
200
                }
201
                    defOpts = defOpts + " --check-plugin-updates";//NOI18N
201
                getPreferences().remove(PROP_FAILURE_BEHAVIOUR);
202
                } else {
202
            }
203
                    defOpts = defOpts + " --no-plugin-updates";//NOI18N
203
            String pluginUpdate = getPreferences().get(PROP_PLUGIN_POLICY, null);
204
                }
204
            if (pluginUpdate != null) {
205
                getPreferences().remove(PROP_PLUGIN_POLICY);
205
                if (Boolean.parseBoolean(pluginUpdate)) {
206
            }
206
                    defOpts = defOpts + " --check-plugin-updates";//NOI18N
207
            String registry = getPreferences().get(PROP_USE_REGISTRY, null);
207
                } else {
208
            if (registry != null) {
208
                    defOpts = defOpts + " --no-plugin-updates";//NOI18N
209
                if (!Boolean.parseBoolean(registry)) {
209
                }
210
                    defOpts = defOpts + " --no-plugin-registry";//NOI18N
210
                getPreferences().remove(PROP_PLUGIN_POLICY);
211
                }
211
            }
212
                getPreferences().remove(PROP_USE_REGISTRY);
212
            String registry = getPreferences().get(PROP_USE_REGISTRY, null);
213
            }
213
            if (registry != null) {
214
            setDefaultOptions(defOpts);
214
                if (!Boolean.parseBoolean(registry)) {
215
            try {
215
                    defOpts = defOpts + " --no-plugin-registry";//NOI18N
216
                getPreferences().flush();
216
                }
217
            } catch (BackingStoreException ex) {
217
                getPreferences().remove(PROP_USE_REGISTRY);
218
//                Exceptions.printStackTrace(ex);
218
            }
219
            }
219
            setDefaultOptions(defOpts);
220
        }
220
            try {
221
    }
221
                getPreferences().flush();
222
222
            } catch (BackingStoreException ex) {
223
    public String getDefaultOptions() {
223
//                Exceptions.printStackTrace(ex);
224
        return getPreferences().get(PROP_DEFAULT_OPTIONS, ""); //NOI18N
224
            }
225
    }
225
        }
226
226
    }
227
    public void setDefaultOptions(String options) {
227
228
        putProperty(PROP_DEFAULT_OPTIONS, options);
228
    public String getDefaultOptions() {
229
    }
229
        return getPreferences().get(PROP_DEFAULT_OPTIONS, ""); //NOI18N
230
    
230
    }
231
231
232
    public String getLastArchetypeGroupId() {
232
    public void setDefaultOptions(String options) {
233
        return getPreferences().get(PROP_LAST_ARCHETYPE_GROUPID, "com.mycompany"); //NOI18N
233
        putProperty(PROP_DEFAULT_OPTIONS, options);
234
    }
234
    }
235
235
    
236
    public void setLastArchetypeGroupId(String groupId) {
236
237
        putProperty(PROP_LAST_ARCHETYPE_GROUPID, groupId);
237
    public String getLastArchetypeGroupId() {
238
    }
238
        return getPreferences().get(PROP_LAST_ARCHETYPE_GROUPID, "com.mycompany"); //NOI18N
239
239
    }
240
    
240
241
    public void setSynchronizeProxy(boolean sync) {
241
    public void setLastArchetypeGroupId(String groupId) {
242
        getPreferences().putBoolean(PROP_SYNCH_PROXY, sync);
242
        putProperty(PROP_LAST_ARCHETYPE_GROUPID, groupId);
243
    }
243
    }
244
    
244
245
    public boolean isSynchronizeProxy() {
245
    
246
        return getPreferences().getBoolean(PROP_SYNCH_PROXY, true);
246
    public void setSynchronizeProxy(boolean sync) {
247
    }
247
        getPreferences().putBoolean(PROP_SYNCH_PROXY, sync);
248
248
    }
249
    public void setCustomLocalRepository(String text) {
249
    
250
        if (text != null && text.trim().length() == 0) {
250
    public boolean isSynchronizeProxy() {
251
            text = null;
251
        return getPreferences().getBoolean(PROP_SYNCH_PROXY, true);
252
        }
252
    }
253
        String oldText = getCustomLocalRepository();
253
254
        putProperty(PROP_CUSTOM_LOCAL_REPOSITORY, text);
254
    public void setCustomLocalRepository(String text) {
255
        //reset the project embedder to use the new local repo value.
255
        if (text != null && text.trim().length() == 0) {
256
        if (!StringUtils.equals(oldText, text)) {
256
            text = null;
257
            EmbedderFactory.resetProjectEmbedder();
257
        }
258
        }
258
        String oldText = getCustomLocalRepository();
259
    }
259
        putProperty(PROP_CUSTOM_LOCAL_REPOSITORY, text);
260
    
260
        //reset the project embedder to use the new local repo value.
261
    public String getCustomLocalRepository() {
261
        if (!StringUtils.equals(oldText, text)) {
262
        return getPreferences().get(PROP_CUSTOM_LOCAL_REPOSITORY, null);
262
            EmbedderFactory.resetProjectEmbedder();
263
    }
263
        }
264
    
264
    }
265
    public File getCommandLinePath() {
265
    
266
        String str =  getPreferences().get(PROP_COMMANDLINE_PATH, null);
266
    public String getCustomLocalRepository() {
267
        if (str != null) {
267
        return getPreferences().get(PROP_CUSTOM_LOCAL_REPOSITORY, null);
268
            return FileUtil.normalizeFile(new File(str));
268
    }
269
        }
269
    
270
        return null;
270
    public File getCommandLinePath() {
271
    }
271
        String str = getPreferences().get(PROP_COMMANDLINE_PATH, null);
272
272
        if (str != null) {
273
    public void setCommandLinePath(File path) {
273
            return FileUtil.normalizeFile(new File(str));
274
        if (path == null) {
274
        }
275
            getPreferences().remove(PROP_COMMANDLINE_PATH);
275
        return null;
276
        } else {
276
    }
277
            putProperty(PROP_COMMANDLINE_PATH, FileUtil.normalizeFile(path).getAbsolutePath());
277
278
        }
278
    public void setCommandLinePath(File path) {
279
    }
279
        if (path == null) {
280
    
280
            getPreferences().remove(PROP_COMMANDLINE_PATH);
281
    public boolean isShowRunDialog(){
281
        } else {
282
     return getPreferences().getBoolean(PROP_SHOW_RUN_DIALOG, false);
282
            putProperty(PROP_COMMANDLINE_PATH, FileUtil.normalizeFile(path).getAbsolutePath());
283
    }
283
        }
284
    public void setShowRunDialog(boolean  b){
284
    }
285
      getPreferences().putBoolean(PROP_SHOW_RUN_DIALOG, b);
285
    
286
    }
286
    public boolean isShowRunDialog(){
287
287
     return getPreferences().getBoolean(PROP_SHOW_RUN_DIALOG, false);
288
    public boolean isSkipTests() {
288
    }
289
        return getPreferences().getBoolean(PROP_SKIP_TESTS, false);
289
    public void setShowRunDialog(boolean  b){
290
    }
290
      getPreferences().putBoolean(PROP_SHOW_RUN_DIALOG, b);
291
291
    }
292
    public void setSkipTests(boolean skipped) {
292
293
        getPreferences().putBoolean(PROP_SKIP_TESTS, skipped);
293
    public boolean isSkipTests() {
294
    }
294
        return getPreferences().getBoolean(PROP_SKIP_TESTS, false);
295
295
    }
296
    public static enum DownloadStrategy {
296
297
        NEVER,
297
    public void setSkipTests(boolean skipped) {
298
        FIRST_OPEN,
298
        getPreferences().putBoolean(PROP_SKIP_TESTS, skipped);
299
        EVERY_OPEN
299
    }
300
    }
300
301
301
    public static enum DownloadStrategy {
302
    public DownloadStrategy getSourceDownloadStrategy() {
302
        NEVER,
303
        String val = getPreferences().get(PROP_SOURCE_DOWNLOAD, DownloadStrategy.NEVER.name());
303
        FIRST_OPEN,
304
        try {
304
        EVERY_OPEN
305
            return DownloadStrategy.valueOf(val);
305
    }
306
        } catch (IllegalArgumentException ex) {
306
307
            return DownloadStrategy.NEVER;
307
    public DownloadStrategy getSourceDownloadStrategy() {
308
        }
308
        String val = getPreferences().get(PROP_SOURCE_DOWNLOAD, DownloadStrategy.NEVER.name());
309
    }
309
        try {
310
310
            return DownloadStrategy.valueOf(val);
311
    public void setSourceDownloadStrategy(DownloadStrategy ds) {
311
        } catch (IllegalArgumentException ex) {
312
        if (ds != null) {
312
            return DownloadStrategy.NEVER;
313
            getPreferences().put(PROP_SOURCE_DOWNLOAD, ds.name());
313
        }
314
        } else {
314
    }
315
            getPreferences().remove(PROP_SOURCE_DOWNLOAD);
315
316
        }
316
    public void setSourceDownloadStrategy(DownloadStrategy ds) {
317
    }
317
        if (ds != null) {
318
318
            getPreferences().put(PROP_SOURCE_DOWNLOAD, ds.name());
319
    public DownloadStrategy getJavadocDownloadStrategy() {
319
        } else {
320
        String val = getPreferences().get(PROP_JAVADOC_DOWNLOAD, DownloadStrategy.NEVER.name());
320
            getPreferences().remove(PROP_SOURCE_DOWNLOAD);
321
        try {
321
        }
322
            return DownloadStrategy.valueOf(val);
322
    }
323
        } catch (IllegalArgumentException ex) {
323
324
            return DownloadStrategy.NEVER;
324
    public DownloadStrategy getJavadocDownloadStrategy() {
325
        }
325
        String val = getPreferences().get(PROP_JAVADOC_DOWNLOAD, DownloadStrategy.NEVER.name());
326
    }
326
        try {
327
327
            return DownloadStrategy.valueOf(val);
328
    public void setJavadocDownloadStrategy(DownloadStrategy ds) {
328
        } catch (IllegalArgumentException ex) {
329
        if (ds != null) {
329
            return DownloadStrategy.NEVER;
330
            getPreferences().put(PROP_JAVADOC_DOWNLOAD, ds.name());
330
        }
331
        } else {
331
    }
332
            getPreferences().remove(PROP_JAVADOC_DOWNLOAD);
332
333
        }
333
    public void setJavadocDownloadStrategy(DownloadStrategy ds) {
334
    }
334
        if (ds != null) {
335
335
            getPreferences().put(PROP_JAVADOC_DOWNLOAD, ds.name());
336
    public DownloadStrategy getBinaryDownloadStrategy() {
336
        } else {
337
        String val = getPreferences().get(PROP_BINARY_DOWNLOAD, DownloadStrategy.NEVER.name());
337
            getPreferences().remove(PROP_JAVADOC_DOWNLOAD);
338
        try {
338
        }
339
            return DownloadStrategy.valueOf(val);
339
    }
340
        } catch (IllegalArgumentException ex) {
340
341
            return DownloadStrategy.NEVER;
341
    public DownloadStrategy getBinaryDownloadStrategy() {
342
        }
342
        String val = getPreferences().get(PROP_BINARY_DOWNLOAD, DownloadStrategy.NEVER.name());
343
    }
343
        try {
344
    
344
            return DownloadStrategy.valueOf(val);
345
    public void setBinaryDownloadStrategy(DownloadStrategy ds) {
345
        } catch (IllegalArgumentException ex) {
346
        if (ds != null) {
346
            return DownloadStrategy.NEVER;
347
            getPreferences().put(PROP_BINARY_DOWNLOAD, ds.name());
347
        }
348
        } else {
348
    }
349
            getPreferences().remove(PROP_BINARY_DOWNLOAD);
349
    
350
        }
350
    public void setBinaryDownloadStrategy(DownloadStrategy ds) {
351
    }
351
        if (ds != null) {
352
352
            getPreferences().put(PROP_BINARY_DOWNLOAD, ds.name());
353
    private static Boolean cachedMaven = null;
353
        } else {
354
    
354
            getPreferences().remove(PROP_BINARY_DOWNLOAD);
355
    public static boolean canFindExternalMaven() {
355
        }
356
        File home = MavenSettings.getDefault().getCommandLinePath();
356
    }
357
        String ex = Utilities.isWindows() ? "mvn.bat" : "mvn"; //NOI18N
357
358
        if (home != null && home.exists()) {
358
    static String getDefaultMavenInstanceVersion() {
359
            File bin = new File(home, "bin" + File.separator + ex);//NOI18N
359
        String ex = Utilities.isWindows() ? "mvn.bat" : "mvn"; //NOI18N
360
            if (bin.exists()) {
360
        return getMavenVersion(ex);
361
                return true;
361
    }
362
            }
362
363
        }
363
    private static String getMavenVersion(String ex) {
364
        if (cachedMaven != null) {
364
        Commandline cmdline = new Commandline();
365
            return cachedMaven.booleanValue();
365
        cmdline.setExecutable(ex);
366
        }
366
        Arg arg = cmdline.createArg();
367
        Commandline cmdline = new Commandline();
367
        arg.setValue("--version"); //NOI18N
368
        cmdline.setExecutable(ex);
368
        cmdline.addArg(arg);
369
        Arg arg = cmdline.createArg();
369
        RegExpConsumer cons = new RegExpConsumer();
370
        arg.setValue("--version"); //NOI18N
370
        try {
371
        cmdline.addArg(arg);
371
            int ret = CommandLineUtils.executeCommandLine(cmdline, cons, cons);
372
        RegExpConsumer cons = new RegExpConsumer();
372
            return cons.version != null ? cons.version.trim() : null;
373
        try {
373
        } catch (CommandLineException ex1) {
374
            int ret = CommandLineUtils.executeCommandLine(cmdline, cons, cons);
374
            Exceptions.printStackTrace(ex1);
375
            cachedMaven = cons.hasMavenAround;
375
            return null;
376
            return cons.hasMavenAround;
376
        }
377
        } catch (CommandLineException ex1) {
377
        
378
            Exceptions.printStackTrace(ex1);
378
    }
379
            cachedMaven = false;
379
380
            return false;
380
    public static String getCommandLineMavenVersion() {
381
        }
381
        File path = getDefault().getCommandLinePath();
382
    }
382
        if (path == null) {
383
    
383
            return getDefaultMavenInstanceVersion();
384
    static String getDefaultMavenInstanceVersion() {
384
        }
385
        String ex = Utilities.isWindows() ? "mvn.bat" : "mvn"; //NOI18N
385
        String pathString = path.getAbsolutePath() + File.separator + "bin" + File.separator + (Utilities.isWindows() ? "mvn.bat" : "mvn"); //NOI18N
386
        return getMavenVersion(ex);
386
        String ver = getMavenVersion(pathString);
387
    }
387
        if (ver != null) {
388
388
            return ver;
389
    private static String getMavenVersion(String ex) {
389
        }
390
        Commandline cmdline = new Commandline();
390
        //TODO examine the version's lib folder and the prop file in there.. see SettingsPanel.java
391
        cmdline.setExecutable(ex);
391
        return null;
392
        Arg arg = cmdline.createArg();
392
    }
393
        arg.setValue("--version"); //NOI18N
393
394
        cmdline.addArg(arg);
394
    private static class RegExpConsumer implements StreamConsumer {
395
        RegExpConsumer cons = new RegExpConsumer();
395
396
        try {
396
        private static final Pattern PATTERN = Pattern.compile("^Maven version:(.*)");
397
            int ret = CommandLineUtils.executeCommandLine(cmdline, cons, cons);
397
        private static final Pattern PATTERN_210 = Pattern.compile("^Apache Maven ([0-9\\.]*) .*");
398
            return cons.version != null ? cons.version.trim() : null;
398
        boolean hasMavenAround = false;
399
        } catch (CommandLineException ex1) {
399
        String version = null;
400
            Exceptions.printStackTrace(ex1);
400
401
            return null;
401
        public void consumeLine(String line) {
402
        }
402
            Matcher match = PATTERN.matcher(line);
403
        
403
            if (!match.matches()) {
404
    }
404
                match = PATTERN_210.matcher(line);
405
405
            }
406
    public static String getCommandLineMavenVersion() {
406
            if (match.matches()) {
407
        File path = getDefault().getCommandLinePath();
407
                hasMavenAround = true;
408
        if (path == null) {
408
                version = match.group(1);
409
            return getDefaultMavenInstanceVersion();
409
            }
410
        }
410
        }
411
        String pathString = path.getAbsolutePath() + File.separator + "bin" + File.separator + (Utilities.isWindows() ? "mvn.bat" : "mvn"); //NOI18N
411
    };
412
        String ver = getMavenVersion(pathString);
412
413
        if (ver != null) {
413
    private List<MavenRuntime> initMavenRuntimes(String[] paths, boolean stopOnFirstValid) {
414
            return ver;
414
        List<MavenRuntime> runtimes = new ArrayList<MavenRuntime>();
415
        }
415
		for (String path : paths) {
416
        //TODO examine the version's lib folder and the prop file in there.. see SettingsPanel.java
416
			File file = new File(path);
417
        return null;
417
			path = FileUtil.normalizeFile(file).getAbsolutePath();
418
    }
418
			String version = MavenUtil.getExternalVersion(path);
419
    
419
			if (version != null) {
420
    private static class RegExpConsumer implements StreamConsumer {
420
				runtimes.add(new MavenRuntime(path, version));
421
421
				if (stopOnFirstValid) {
422
        private static final Pattern PATTERN = Pattern.compile("^Maven version:(.*)");
422
                    break;
423
        private static final Pattern PATTERN_210 = Pattern.compile("^Apache Maven ([0-9\\.]*) .*");
423
				}
424
        boolean hasMavenAround = false;
424
			}
425
        String version = null;
425
		}
426
426
        
427
        public void consumeLine(String line) {
427
        return runtimes;
428
            Matcher match = PATTERN.matcher(line);
428
	}
429
            if (!match.matches()) {
429
430
                match = PATTERN_210.matcher(line);
430
	/**
431
            }
431
	 * Searches Maven runtimes according to the environment settings.
432
            if (match.matches()) {
432
	 *
433
                hasMavenAround = true;
433
	 * <p>It searches in this order:
434
                version = match.group(1);
434
	 * <ul>
435
            }
435
	 * <li>MAVEN_HOME</li>
436
        }
436
	 * <li>M2_HOME</li>
437
    };
437
	 * <li>PATH</li></ul>
438
438
	 * </p>
439
    
439
	 * <p>Only the first appereance will be appended.</p>
440
}
440
	 *
441
	 * @returns the default external Maven runtime on the path.
442
	 */
443
    public MavenRuntime getDefaultExternalMavenRuntime() {
444
		String paths = System.getenv("PATH"); // NOI18N
445
		String mavenHome = System.getenv("MAVEN_HOME"); // NOI18N
446
		String m2Home = System.getenv("M2_HOME"); // NOI18N
447
448
		List<String> mavenEnvDirs = new ArrayList<String>();
449
		if (mavenHome != null) {
450
			mavenEnvDirs.add(mavenHome);
451
		}
452
		if (m2Home != null) {
453
			mavenEnvDirs.add(m2Home);
454
		}
455
		if (paths != null) {
456
			for (String path : paths.split(File.pathSeparator)) {
457
				if (!path.endsWith("bin")) { // NOI18N
458
					continue;
459
				}
460
461
				mavenEnvDirs.add(path.substring(0,
462
						path.length() - "bin".length() - File.pathSeparator.length()));
463
			}
464
		}
465
466
		List<MavenRuntime> runtimes = initMavenRuntimes(mavenEnvDirs.toArray(new String[0]), true);
467
        return !runtimes.isEmpty() ? runtimes.get(0) : null;
468
    }
469
    
470
    public MavenRuntime getEmbeddedMavenRuntime() {
471
        return new MavenRuntime("",
472
                NbBundle.getMessage(SettingsPanel.class, "LBL_MavenVersion2", "3.0-SNAPSHOT"));
473
    }
474
475
    public List<MavenRuntime> getPredefinedMavenRuntimes() {
476
		List<MavenRuntime> runtimes = new ArrayList<MavenRuntime>();
477
		
478
		// Embedded
479
		runtimes.add(getEmbeddedMavenRuntime());
480
		
481
        // Try to find default external Maven runtime on path
482
        MavenRuntime defaultRuntime = getDefaultExternalMavenRuntime();
483
        if (defaultRuntime != null) {
484
            runtimes.add(defaultRuntime);
485
		}
486
        
487
        return Collections.unmodifiableList(runtimes);
488
    }
489
    
490
	public List<MavenRuntime> getUserDefinedMavenRuntimes() {
491
		List<MavenRuntime> runtimes = new ArrayList<MavenRuntime>();
492
		
493
        MavenRuntime defaultRuntime = getDefaultExternalMavenRuntime();
494
		String runtimesPref = getPreferences().get(PROP_MAVEN_RUNTIMES, null);
495
		if (runtimesPref != null) {
496
			for (String runtimePath : runtimesPref.split(File.pathSeparator)) {
497
				if (!"".equals(runtimePath) &&
498
                        defaultRuntime != null && !defaultRuntime.getPath().equals(runtimePath)) {
499
					String version = MavenUtil.getExternalVersion(runtimePath);
500
                    runtimes.add(new MavenRuntime(runtimePath, version));
501
				}
502
			}
503
		}
504
        
505
        return Collections.unmodifiableList(runtimes);
506
	}
507
508
	public void setMavenRuntimes(List<MavenRuntime> runtimes) {
509
		if (runtimes == null) {
510
			getPreferences().remove(PROP_MAVEN_RUNTIMES);
511
		} else {
512
			String runtimesPref = "";
513
			for (MavenRuntime runtime : runtimes) {
514
				runtimesPref += runtime.getPath() + File.pathSeparator;
515
			}
516
			putProperty(PROP_MAVEN_RUNTIMES, runtimesPref);
517
		}
518
	}
519
520
	/**
521
	 * Checks whether an external runtime is being used.
522
	 * @return true if using an external runtime. Otherwise false.
523
	 */
524
	public boolean isUsingExternalRuntime() {
525
		return getCommandLinePath() != null;
526
	}
527
    
528
}
(-)a/maven/src/org/netbeans/modules/maven/options/MavenUtil.java (+112 lines)
Line 0 Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
5
 *
6
 * The contents of this file are subject to the terms of either the GNU
7
 * General Public License Version 2 only ("GPL") or the Common
8
 * Development and Distribution License("CDDL") (collectively, the
9
 * "License"). You may not use this file except in compliance with the
10
 * License. You can obtain a copy of the License at
11
 * http://www.netbeans.org/cddl-gplv2.html
12
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
13
 * specific language governing permissions and limitations under the
14
 * License.  When distributing the software, include this License Header
15
 * Notice in each file and include the License file at
16
 * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
17
 * particular file as subject to the "Classpath" exception as provided
18
 * by Sun in the GPL Version 2 section of the License file that
19
 * accompanied this code. If applicable, add the following below the
20
 * License Header, with the fields enclosed by brackets [] replaced by
21
 * your own identifying information:
22
 * "Portions Copyrighted [year] [name of copyright owner]"
23
 *
24
 * If you wish your version of this file to be governed by only the CDDL
25
 * or only the GPL Version 2, indicate your decision by adding
26
 * "[Contributor] elects to include this software in this distribution
27
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
28
 * single choice of license, a recipient has the option to distribute
29
 * your version of this file under either the CDDL, the GPL Version 2 or
30
 * to extend the choice of license to its licensees as provided above.
31
 * However, if you add GPL Version 2 code and therefore, elected the GPL
32
 * Version 2 license, then the option applies only if the new code is
33
 * made subject to such option by the copyright holder.
34
 *
35
 * Contributor(s):
36
 *
37
 * Portions Copyrighted 2010 Sun Microsystems, Inc.
38
 */
39
40
package org.netbeans.modules.maven.options;
41
42
import java.io.File;
43
import java.io.FilenameFilter;
44
import java.io.IOException;
45
import java.io.InputStream;
46
import java.util.Properties;
47
import java.util.jar.JarFile;
48
import java.util.zip.ZipEntry;
49
import org.openide.util.NbBundle;
50
51
/**
52
 * Maven relevant utility methods.
53
 *
54
 * @author johnsonlau@netbeans.org
55
 */
56
public class MavenUtil {
57
58
	/**
59
	 * Gets an external Maven installation's version.
60
	 * 
61
	 * @param path external maven installation path.
62
	 * @return version description of the installation. null when failed.
63
	 */
64
    public static String getExternalVersion(String path) {
65
        File root = new File(path);
66
        File lib = new File(root, "lib"); //NOI18N
67
        if (lib.exists()) {
68
            File[] jars = lib.listFiles(new FilenameFilter() {
69
70
                public boolean accept(File dir, String name) {
71
                    return name.endsWith(".jar"); //NOI18N
72
                }
73
            });
74
            for (File jar : jars) {
75
                JarFile jf = null;
76
                try {
77
                    jf = new JarFile(jar);
78
                    ZipEntry entry = jf.getEntry("META-INF/maven/org.apache.maven/maven-core/pom.properties");//NOI18N
79
                    if (entry != null) {
80
                        InputStream resourceAsStream = jf.getInputStream(entry);
81
                        Properties properties = new Properties();
82
                        properties.load(resourceAsStream);
83
                        if (properties.getProperty("builtOn") != null) { //NOI18N
84
                            return NbBundle.getMessage(SettingsPanel.class, "LBL_ExMavenVersion1",
85
                                    properties.getProperty("version", "unknown"), properties.getProperty("builtOn"));//NOI18N
86
                        } else {
87
                            return NbBundle.getMessage(SettingsPanel.class, "LBL_ExMavenVersion2", properties.getProperty("version", "unknown"));//NOI18N
88
                        }
89
                    }
90
                } catch (IOException ex) {
91
                    //ignore..
92
                } finally {
93
                    if (jf != null) {
94
                        try {
95
                            jf.close();
96
                        } catch (IOException x) {
97
                        }
98
                    }
99
                }
100
            }
101
        }
102
103
        return null;
104
    }
105
106
	public static boolean isDefaultMavenRuntime(MavenRuntime runtime,
107
			File commandLinePath) {
108
		return (!runtime.isExternal() && commandLinePath == null) ||
109
				(commandLinePath != null && commandLinePath.getAbsolutePath().equals(runtime.getPath()));
110
	}
111
112
}
(-)a/maven/src/org/netbeans/modules/maven/options/SettingsPanel.form (-75 / +61 lines)
Lines 1-4 Link Here
1
<?xml version="1.0" encoding="UTF-8" ?>
1
<?xml version="1.1" encoding="UTF-8" ?>
2
2
3
<Form version="1.4" maxVersion="1.4" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
3
<Form version="1.4" maxVersion="1.4" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
4
  <NonVisualComponents>
4
  <NonVisualComponents>
Lines 27-104 Link Here
27
          <Group type="102" attributes="0">
27
          <Group type="102" attributes="0">
28
              <EmptySpace max="-2" attributes="0"/>
28
              <EmptySpace max="-2" attributes="0"/>
29
              <Group type="103" groupAlignment="0" attributes="0">
29
              <Group type="103" groupAlignment="0" attributes="0">
30
                  <Group type="102" attributes="0">
31
                      <Component id="lblCommandLine" min="-2" max="-2" attributes="0"/>
32
                      <EmptySpace min="-2" pref="31" max="-2" attributes="0"/>
33
                      <Group type="103" groupAlignment="0" attributes="0">
34
                          <Component id="comMavenHome" pref="394" max="32767" attributes="0"/>
35
                          <Component id="lblExternalVersion" alignment="0" pref="394" max="32767" attributes="0"/>
36
                      </Group>
37
                      <EmptySpace min="-2" pref="137" max="-2" attributes="0"/>
38
                  </Group>
30
                  <Group type="102" alignment="0" attributes="0">
39
                  <Group type="102" alignment="0" attributes="0">
31
                      <Group type="103" groupAlignment="0" attributes="0">
40
                      <Group type="103" groupAlignment="0" attributes="0">
32
                          <Component id="lblCommandLine" alignment="0" min="-2" max="-2" attributes="0"/>
41
                          <Group type="102" alignment="0" attributes="0">
33
                          <Component id="lblOptions" alignment="0" min="-2" max="-2" attributes="0"/>
42
                              <EmptySpace min="12" pref="12" max="12" attributes="0"/>
34
                          <Component id="lblLocalRepository" alignment="0" min="-2" max="-2" attributes="0"/>
43
                              <Group type="103" groupAlignment="0" attributes="0">
35
                      </Group>
44
                                  <Component id="lblJavadoc" alignment="0" min="-2" max="-2" attributes="0"/>
36
                      <EmptySpace max="-2" attributes="0"/>
45
                                  <Component id="lblBinaries" alignment="0" min="-2" max="-2" attributes="0"/>
37
                      <Group type="103" groupAlignment="0" attributes="0">
46
                                  <Component id="lblSource" alignment="0" min="-2" max="-2" attributes="0"/>
38
                          <Component id="lblEmbeddedVersion" alignment="0" pref="470" max="32767" attributes="0"/>
47
                                  <Component id="jLabel3" alignment="0" pref="570" max="32767" attributes="0"/>
48
                              </Group>
49
                              <EmptySpace min="-2" pref="106" max="-2" attributes="0"/>
50
                          </Group>
51
                          <Component id="btnGoals" alignment="0" min="-2" max="-2" attributes="0"/>
39
                          <Group type="102" alignment="1" attributes="0">
52
                          <Group type="102" alignment="1" attributes="0">
40
                              <Component id="txtCommandLine" pref="387" max="32767" attributes="0"/>
53
                              <Component id="lblIndex" min="-2" max="-2" attributes="0"/>
54
                              <EmptySpace type="separate" max="-2" attributes="0"/>
55
                              <Group type="103" groupAlignment="1" attributes="0">
56
                                  <Component id="cbSnapshots" alignment="0" min="-2" max="-2" attributes="0"/>
57
                                  <Component id="comIndex" pref="398" max="32767" attributes="0"/>
58
                              </Group>
41
                              <EmptySpace max="-2" attributes="0"/>
59
                              <EmptySpace max="-2" attributes="0"/>
42
                              <Component id="btnCommandLine" linkSize="1" min="-2" max="-2" attributes="0"/>
60
                              <Component id="btnIndex" linkSize="1" min="-2" max="-2" attributes="0"/>
43
                          </Group>
61
                          </Group>
44
                          <Component id="lblExternalVersion" alignment="0" pref="470" max="32767" attributes="0"/>
62
                          <Group type="102" alignment="0" attributes="0">
45
                          <Group type="102" alignment="1" attributes="0">
46
                              <Group type="103" groupAlignment="0" attributes="0">
63
                              <Group type="103" groupAlignment="0" attributes="0">
47
                                  <Component id="comSource" alignment="0" pref="387" max="32767" attributes="1"/>
64
                                  <Component id="lblOptions" alignment="0" min="-2" max="-2" attributes="0"/>
48
                                  <Component id="comJavadoc" alignment="0" pref="387" max="32767" attributes="1"/>
65
                                  <Component id="lblLocalRepository" alignment="0" min="-2" max="-2" attributes="0"/>
49
                                  <Component id="comBinaries" alignment="0" pref="387" max="32767" attributes="1"/>
66
                                  <Component id="jLabel1" alignment="0" min="-2" max="-2" attributes="0"/>
50
                                  <Component id="txtLocalRepository" alignment="0" pref="387" max="32767" attributes="1"/>
51
                                  <Component id="txtOptions" pref="387" max="32767" attributes="0"/>
52
                              </Group>
67
                              </Group>
53
                              <EmptySpace max="-2" attributes="0"/>
68
                              <EmptySpace max="-2" attributes="0"/>
54
                              <Group type="103" groupAlignment="0" attributes="0">
69
                              <Group type="103" groupAlignment="0" attributes="0">
55
                                  <Component id="btnLocalRepository" linkSize="1" min="-2" max="-2" attributes="0"/>
70
                                  <Component id="cbSkipTests" alignment="0" min="-2" max="-2" attributes="0"/>
56
                                  <Component id="btnOptions" linkSize="1" alignment="0" min="-2" max="-2" attributes="0"/>
71
                                  <Group type="102" alignment="1" attributes="0">
72
                                      <Group type="103" groupAlignment="1" attributes="0">
73
                                          <Component id="comSource" alignment="0" pref="394" max="32767" attributes="1"/>
74
                                          <Component id="comJavadoc" alignment="0" pref="394" max="32767" attributes="1"/>
75
                                          <Component id="comBinaries" alignment="0" pref="394" max="32767" attributes="1"/>
76
                                          <Component id="txtLocalRepository" alignment="0" pref="394" max="32767" attributes="1"/>
77
                                          <Component id="txtOptions" alignment="0" pref="394" max="32767" attributes="0"/>
78
                                      </Group>
79
                                      <EmptySpace max="-2" attributes="0"/>
80
                                      <Group type="103" groupAlignment="0" attributes="0">
81
                                          <Component id="btnLocalRepository" linkSize="1" min="-2" max="-2" attributes="0"/>
82
                                          <Component id="btnOptions" linkSize="1" alignment="0" min="-2" max="-2" attributes="0"/>
83
                                      </Group>
84
                                  </Group>
57
                              </Group>
85
                              </Group>
58
                          </Group>
86
                          </Group>
59
                          <Component id="cbSkipTests" alignment="0" min="-2" max="-2" attributes="0"/>
60
                      </Group>
61
                  </Group>
62
                  <Component id="jLabel1" alignment="0" min="-2" max="-2" attributes="0"/>
63
                  <Group type="102" alignment="0" attributes="0">
64
                      <EmptySpace min="12" pref="12" max="12" attributes="0"/>
65
                      <Group type="103" groupAlignment="0" attributes="0">
66
                          <Component id="lblJavadoc" alignment="0" min="-2" max="-2" attributes="0"/>
67
                          <Component id="lblBinaries" alignment="0" min="-2" max="-2" attributes="0"/>
68
                          <Component id="lblSource" alignment="0" min="-2" max="-2" attributes="0"/>
69
                          <Component id="jLabel3" alignment="0" pref="531" max="32767" attributes="0"/>
70
                      </Group>
71
                      <EmptySpace min="-2" pref="106" max="-2" attributes="0"/>
72
                  </Group>
73
                  <Component id="btnGoals" alignment="0" min="-2" max="-2" attributes="0"/>
74
                  <Group type="102" alignment="1" attributes="0">
75
                      <Component id="lblIndex" min="-2" max="-2" attributes="0"/>
76
                      <EmptySpace max="-2" attributes="0"/>
77
                      <Group type="103" groupAlignment="0" attributes="0">
78
                          <Component id="cbSnapshots" min="-2" max="-2" attributes="0"/>
79
                          <Component id="comIndex" pref="391" max="32767" attributes="0"/>
80
                      </Group>
87
                      </Group>
81
                      <EmptySpace max="-2" attributes="0"/>
88
                      <EmptySpace max="-2" attributes="0"/>
82
                      <Component id="btnIndex" linkSize="1" min="-2" max="-2" attributes="0"/>
83
                  </Group>
89
                  </Group>
84
              </Group>
90
              </Group>
85
              <EmptySpace max="-2" attributes="0"/>
86
          </Group>
91
          </Group>
87
      </Group>
92
      </Group>
88
    </DimensionLayout>
93
    </DimensionLayout>
89
    <DimensionLayout dim="1">
94
    <DimensionLayout dim="1">
90
      <Group type="103" groupAlignment="0" attributes="0">
95
      <Group type="103" groupAlignment="0" attributes="0">
91
          <Group type="102" alignment="0" attributes="0">
96
          <Group type="102" attributes="0">
92
              <Component id="lblEmbeddedVersion" min="-2" max="-2" attributes="0"/>
93
              <EmptySpace max="-2" attributes="0"/>
97
              <EmptySpace max="-2" attributes="0"/>
94
              <Group type="103" groupAlignment="3" attributes="0">
98
              <Group type="103" groupAlignment="3" attributes="0">
99
                  <Component id="comMavenHome" alignment="3" min="-2" max="-2" attributes="0"/>
95
                  <Component id="lblCommandLine" alignment="3" min="-2" max="-2" attributes="0"/>
100
                  <Component id="lblCommandLine" alignment="3" min="-2" max="-2" attributes="0"/>
96
                  <Component id="txtCommandLine" alignment="3" min="-2" max="-2" attributes="0"/>
97
                  <Component id="btnCommandLine" alignment="3" min="-2" max="-2" attributes="0"/>
98
              </Group>
101
              </Group>
99
              <EmptySpace max="-2" attributes="0"/>
102
              <EmptySpace min="-2" pref="8" max="-2" attributes="0"/>
100
              <Component id="lblExternalVersion" min="-2" pref="14" max="-2" attributes="0"/>
103
              <Component id="lblExternalVersion" min="-2" pref="14" max="-2" attributes="0"/>
101
              <EmptySpace min="-2" pref="18" max="-2" attributes="0"/>
104
              <EmptySpace type="unrelated" max="-2" attributes="0"/>
102
              <Group type="103" groupAlignment="3" attributes="0">
105
              <Group type="103" groupAlignment="3" attributes="0">
103
                  <Component id="lblOptions" alignment="3" min="-2" max="-2" attributes="0"/>
106
                  <Component id="lblOptions" alignment="3" min="-2" max="-2" attributes="0"/>
104
                  <Component id="txtOptions" alignment="3" min="-2" max="-2" attributes="0"/>
107
                  <Component id="txtOptions" alignment="3" min="-2" max="-2" attributes="0"/>
Lines 112-118 Link Here
112
                  <Component id="btnLocalRepository" alignment="3" min="-2" max="-2" attributes="0"/>
115
                  <Component id="btnLocalRepository" alignment="3" min="-2" max="-2" attributes="0"/>
113
                  <Component id="lblLocalRepository" alignment="3" min="-2" max="-2" attributes="0"/>
116
                  <Component id="lblLocalRepository" alignment="3" min="-2" max="-2" attributes="0"/>
114
              </Group>
117
              </Group>
115
              <EmptySpace min="-2" pref="16" max="-2" attributes="0"/>
118
              <EmptySpace min="-2" pref="18" max="-2" attributes="0"/>
116
              <Component id="jLabel1" min="-2" max="-2" attributes="0"/>
119
              <Component id="jLabel1" min="-2" max="-2" attributes="0"/>
117
              <EmptySpace max="-2" attributes="0"/>
120
              <EmptySpace max="-2" attributes="0"/>
118
              <Group type="103" groupAlignment="3" attributes="0">
121
              <Group type="103" groupAlignment="3" attributes="0">
Lines 141-147 Link Here
141
              </Group>
144
              </Group>
142
              <EmptySpace max="-2" attributes="0"/>
145
              <EmptySpace max="-2" attributes="0"/>
143
              <Component id="cbSnapshots" min="-2" max="-2" attributes="0"/>
146
              <Component id="cbSnapshots" min="-2" max="-2" attributes="0"/>
144
              <EmptySpace max="32767" attributes="0"/>
147
              <EmptySpace pref="37" max="32767" attributes="0"/>
145
          </Group>
148
          </Group>
146
      </Group>
149
      </Group>
147
    </DimensionLayout>
150
    </DimensionLayout>
Lines 154-176 Link Here
154
        </Property>
157
        </Property>
155
      </Properties>
158
      </Properties>
156
    </Component>
159
    </Component>
157
    <Component class="javax.swing.JTextField" name="txtCommandLine">
158
      <Properties>
159
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
160
          <ResourceString bundle="org/netbeans/modules/maven/options/Bundle.properties" key="SettingsPanel.txtCommandLine.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
161
        </Property>
162
      </Properties>
163
    </Component>
164
    <Component class="javax.swing.JButton" name="btnCommandLine">
165
      <Properties>
166
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
167
          <ResourceString bundle="org/netbeans/modules/maven/options/Bundle.properties" key="SettingsPanel.btnCommandLine.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
168
        </Property>
169
      </Properties>
170
      <Events>
171
        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnCommandLineActionPerformed"/>
172
      </Events>
173
    </Component>
174
    <Component class="javax.swing.JLabel" name="lblExternalVersion">
160
    <Component class="javax.swing.JLabel" name="lblExternalVersion">
175
      <Properties>
161
      <Properties>
176
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
162
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
Lines 213-219 Link Here
213
    </Component>
199
    </Component>
214
    <Component class="javax.swing.JTextField" name="txtLocalRepository">
200
    <Component class="javax.swing.JTextField" name="txtLocalRepository">
215
      <AuxValues>
201
      <AuxValues>
216
        <AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="new MyJTextField();"/>
202
        <AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="new org.netbeans.modules.maven.options.JHintedTextField();"/>
217
      </AuxValues>
203
      </AuxValues>
218
    </Component>
204
    </Component>
219
    <Component class="javax.swing.JButton" name="btnLocalRepository">
205
    <Component class="javax.swing.JButton" name="btnLocalRepository">
Lines 226-238 Link Here
226
        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnLocalRepositoryActionPerformed"/>
212
        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnLocalRepositoryActionPerformed"/>
227
      </Events>
213
      </Events>
228
    </Component>
214
    </Component>
229
    <Component class="javax.swing.JLabel" name="lblEmbeddedVersion">
230
      <Properties>
231
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
232
          <ResourceString bundle="org/netbeans/modules/maven/options/Bundle.properties" key="SettingsPanel.lblEmbeddedVersion.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
233
        </Property>
234
      </Properties>
235
    </Component>
236
    <Component class="javax.swing.JLabel" name="lblBinaries">
215
    <Component class="javax.swing.JLabel" name="lblBinaries">
237
      <Properties>
216
      <Properties>
238
        <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
217
        <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
Lines 325-329 Link Here
325
        </Property>
304
        </Property>
326
      </Properties>
305
      </Properties>
327
    </Component>
306
    </Component>
307
    <Component class="javax.swing.JComboBox" name="comMavenHome">
308
      <Properties>
309
        <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
310
          <StringArray count="0"/>
311
        </Property>
312
      </Properties>
313
    </Component>
328
  </SubComponents>
314
  </SubComponents>
329
</Form>
315
</Form>
(-)a/maven/src/org/netbeans/modules/maven/options/SettingsPanel.java (-187 / +279 lines)
Lines 43-67 Link Here
43
import java.awt.event.ActionEvent;
43
import java.awt.event.ActionEvent;
44
import java.awt.event.ActionListener;
44
import java.awt.event.ActionListener;
45
import java.io.File;
45
import java.io.File;
46
import java.io.FilenameFilter;
47
import java.io.IOException;
48
import java.io.InputStream;
49
import java.io.StringReader;
46
import java.io.StringReader;
47
import java.util.ArrayList;
50
import java.util.Arrays;
48
import java.util.Arrays;
49
import java.util.Collections;
51
import java.util.List;
50
import java.util.List;
52
import java.util.Properties;
53
import java.util.jar.JarFile;
54
import java.util.zip.ZipEntry;
55
import javax.swing.BorderFactory;
51
import javax.swing.BorderFactory;
56
import javax.swing.ComboBoxModel;
52
import javax.swing.ComboBoxModel;
57
import javax.swing.DefaultComboBoxModel;
53
import javax.swing.DefaultComboBoxModel;
58
import javax.swing.DefaultListCellRenderer;
54
import javax.swing.DefaultListCellRenderer;
59
import javax.swing.JFileChooser;
55
import javax.swing.JFileChooser;
56
import javax.swing.JLabel;
60
import javax.swing.JList;
57
import javax.swing.JList;
58
import javax.swing.JSeparator;
61
import javax.swing.ListCellRenderer;
59
import javax.swing.ListCellRenderer;
62
import javax.swing.SwingUtilities;
60
import javax.swing.SwingUtilities;
63
import javax.swing.event.DocumentEvent;
61
import javax.swing.border.EmptyBorder;
64
import javax.swing.event.DocumentListener;
65
import org.netbeans.modules.maven.TextValueCompleter;
62
import org.netbeans.modules.maven.TextValueCompleter;
66
import org.netbeans.modules.maven.indexer.api.RepositoryIndexer;
63
import org.netbeans.modules.maven.indexer.api.RepositoryIndexer;
67
import org.netbeans.modules.maven.indexer.api.RepositoryInfo;
64
import org.netbeans.modules.maven.indexer.api.RepositoryInfo;
Lines 89-100 Link Here
89
 */
86
 */
90
public class SettingsPanel extends javax.swing.JPanel {
87
public class SettingsPanel extends javax.swing.JPanel {
91
    private static final String CP_SELECTED = "wasSelected"; //NOI18N
88
    private static final String CP_SELECTED = "wasSelected"; //NOI18N
89
    private static final String SEPARATOR = "SEPARATOR";
90
    private static final int RUNTIME_COUNT_LIMIT = 5;
92
    private boolean changed;
91
    private boolean changed;
93
    private boolean valid;
92
    private boolean valid;
94
    private ActionListener listener;
93
    private ActionListener listener;
95
    private DocumentListener docList;
94
    private ActionListener   listItemChangedListener;
96
    private MavenOptionController controller;
95
    private MavenOptionController controller;
97
    private TextValueCompleter completer;
96
    private TextValueCompleter completer;
97
    private List<MavenRuntime> userDefinedMavenRuntimes = new ArrayList<MavenRuntime>();
98
    private List<MavenRuntime> predefinedRuntimes = new ArrayList<MavenRuntime>();
99
    private DefaultComboBoxModel mavenHomeDataModel = new DefaultComboBoxModel();
100
    private MavenRuntime       activeMavenRuntime = null;
101
    private int                lastSelected = -1;
102
103
    private class ComboBoxRenderer extends JLabel implements ListCellRenderer {
104
105
        private JSeparator separator;
106
107
        public ComboBoxRenderer() {
108
            setOpaque(true);
109
            setBorder(new EmptyBorder(1, 1, 1, 1));
110
            separator = new JSeparator(JSeparator.HORIZONTAL);
111
        }
112
113
        @Override
114
        public Component getListCellRendererComponent(JList list, Object value,
115
                int index, boolean isSelected, boolean cellHasFocus) {
116
            if (SEPARATOR.equals(value)) {
117
                return separator;
118
            }
119
            if (isSelected) {
120
                setBackground(list.getSelectionBackground());
121
                setForeground(list.getSelectionForeground());
122
            } else {
123
                setBackground(list.getBackground());
124
                setForeground(list.getForeground());
125
            }
126
            
127
            setFont(list.getFont());
128
            setText(value.toString());
129
            return this;
130
        }
131
    };
98
132
99
    /** Creates new form SettingsPanel */
133
    /** Creates new form SettingsPanel */
100
    SettingsPanel(MavenOptionController controller) {
134
    SettingsPanel(MavenOptionController controller) {
Lines 104-109 Link Here
104
        comBinaries.setModel(new DefaultComboBoxModel(downloads));
138
        comBinaries.setModel(new DefaultComboBoxModel(downloads));
105
        comJavadoc.setModel(new DefaultComboBoxModel(downloads));
139
        comJavadoc.setModel(new DefaultComboBoxModel(downloads));
106
        comSource.setModel(new DefaultComboBoxModel(downloads));
140
        comSource.setModel(new DefaultComboBoxModel(downloads));
141
        comMavenHome.setModel(mavenHomeDataModel);
107
142
108
        ListCellRenderer rend = new DefaultListCellRenderer() {
143
        ListCellRenderer rend = new DefaultListCellRenderer() {
109
            @Override
144
            @Override
Lines 122-147 Link Here
122
        comBinaries.setRenderer(rend);
157
        comBinaries.setRenderer(rend);
123
        comSource.setRenderer(rend);
158
        comSource.setRenderer(rend);
124
        comJavadoc.setRenderer(rend);
159
        comJavadoc.setRenderer(rend);
160
        comMavenHome.setRenderer(new ComboBoxRenderer());
125
161
126
        this.controller = controller;
162
        this.controller = controller;
127
        docList = new DocumentListener() {
163
        listItemChangedListener = new ActionListener() {
128
            public void insertUpdate(DocumentEvent e) {
164
            
129
                documentChanged(e);
165
            @Override
166
            public void actionPerformed(ActionEvent e) {
167
                if (SEPARATOR.equals(comMavenHome.getSelectedItem())) {
168
                    comMavenHome.setSelectedIndex(lastSelected);
169
                    return;
170
                }
171
                
172
                int selected = comMavenHome.getSelectedIndex();
173
                if (selected == mavenHomeDataModel.getSize() - 1) {
174
                    // clear all user defined runtimes
175
                    if (userDefinedMavenRuntimes.isEmpty()) {
176
                        comMavenHome.setSelectedIndex(lastSelected);
177
                        return;
178
                    }
179
                    
180
                    int count = userDefinedMavenRuntimes.size() + 1;
181
                    userDefinedMavenRuntimes.clear();
182
                    for (int i = 0; i < count; ++i) {
183
                        mavenHomeDataModel.removeElementAt(predefinedRuntimes.size());
184
                    }
185
                    
186
                    lastSelected = 0;
187
                    comMavenHome.setSelectedIndex(lastSelected);
188
                    return;
189
                }
190
                
191
                if (selected == mavenHomeDataModel.getSize() - 2) {
192
                    // browse
193
                    comMavenHome.setSelectedIndex(lastSelected);
194
                    SwingUtilities.invokeLater(new Runnable() {
195
196
                        @Override
197
                        public void run() {
198
                            browseAddNewRuntime();
199
                        }
200
                        
201
                    });
202
                    return;
203
                }
204
                
205
                listDataChanged();
206
                lastSelected = selected;
130
            }
207
            }
131
            public void removeUpdate(DocumentEvent e) {
208
            
132
                documentChanged(e);
133
            }
134
            public void changedUpdate(DocumentEvent e) {
135
                documentChanged(e);
136
            }
137
        };
209
        };
138
        initValues();
210
        initValues();
139
        ((MyJTextField)txtLocalRepository).setHintText(org.openide.util.NbBundle.getMessage(SettingsPanel.class, "txt_default_repository"));
211
        ((JHintedTextField)txtLocalRepository).setHintText(org.openide.util.NbBundle.getMessage(SettingsPanel.class, "txt_default_repository"));
140
        listener = new ActionListenerImpl();
212
        listener = new ActionListenerImpl();
141
        cbSnapshots.addActionListener(listener);
213
        cbSnapshots.addActionListener(listener);
142
        comIndex.addActionListener(listener);
214
        comIndex.addActionListener(listener);
143
        completer = new TextValueCompleter(getGlobalOptions(), txtOptions, " "); //NOI18N
215
        completer = new TextValueCompleter(getGlobalOptions(), txtOptions, " "); //NOI18N
144
        initEmbeddedVersion();
145
    }
216
    }
146
217
147
    static String[] AVAILABLE_OPTIONS = new String[] {
218
    static String[] AVAILABLE_OPTIONS = new String[] {
Lines 183-289 Link Here
183
        return Arrays.asList(AVAILABLE_OPTIONS);
254
        return Arrays.asList(AVAILABLE_OPTIONS);
184
    }
255
    }
185
256
186
    private void initEmbeddedVersion()
187
    {
188
        //there was a renumbering scheme for maven. current trunk is not 2.1 but 3.0
189
        //http://blogs.sonatype.com/brian/2008/09/05/1220649145080.html
190
        //XXX: just hardwire here to not confuse people with old style versions.
191
          lblEmbeddedVersion.setText(NbBundle.getMessage(SettingsPanel.class, "LBL_MavenVersion2", "3.0-SNAPSHOT")); //NOI18N
192
        
193
//        InputStream resourceAsStream;
194
//        try {
195
//            Properties properties = new Properties();
196
//            resourceAsStream = EmbedderFactory.class.getClassLoader().getResourceAsStream( "META-INF/maven/org.apache.maven/maven-core/pom.properties" ); //NOI18N
197
//            properties.load( resourceAsStream );
198
//
199
//            if ( properties.getProperty( "builtOn" ) != null ) { //NOI18N
200
//                lblEmbeddedVersion.setText(NbBundle.getMessage(SettingsPanel.class, "LBL_MavenVersion1", 
201
//                        properties.getProperty( "version", "unknown" ), properties.getProperty( "builtOn" )));
202
//            } else {
203
//                lblEmbeddedVersion.setText(NbBundle.getMessage(SettingsPanel.class, "LBL_MavenVersion2", properties.getProperty( "version", "unknown" )));
204
//            }
205
//        }
206
//        catch  ( IOException e ) {
207
//            lblEmbeddedVersion.setText(NbBundle.getMessage(SettingsPanel.class, "LBL_MavenVersion3"));
208
//        }
209
    }
210
211
    private void initExternalVersion()
212
    {
213
        String path = txtCommandLine.getText().trim();
214
        if (path.length() == 0) {
215
            String ver = MavenSettings.getDefaultMavenInstanceVersion();
216
            if (ver != null) {
217
                lblExternalVersion.setText(NbBundle.getMessage(SettingsPanel.class, "LBL_ExMavenVersion3", ver));//NOI18N
218
            } else {
219
                lblExternalVersion.setText(ver != null ? ver : ""); //NOI18N
220
            }
221
            return;
222
        }
223
        File root = new File(path);
224
        File lib = new File(root, "lib"); //NOI18N
225
        if (lib.exists()) {
226
            File[] jars = lib.listFiles(new FilenameFilter() {
227
                public boolean accept(File dir, String name) {
228
                    return name.endsWith(".jar"); //NOI18N
229
                }
230
            });
231
            for (File jar : jars) {
232
                JarFile jf = null;
233
                try
234
                {
235
                    jf = new JarFile(jar);
236
                    ZipEntry entry = jf.getEntry("META-INF/maven/org.apache.maven/maven-core/pom.properties");//NOI18N
237
                    if (entry != null) {
238
                        InputStream resourceAsStream = jf.getInputStream(entry);
239
                        Properties properties = new Properties();
240
                        properties.load( resourceAsStream );
241
                        if ( properties.getProperty( "builtOn" ) != null ) { //NOI18N
242
                            lblExternalVersion.setText(NbBundle.getMessage(SettingsPanel.class, "LBL_ExMavenVersion1", 
243
                                    properties.getProperty( "version", "unknown" ), properties.getProperty( "builtOn" )));//NOI18N
244
                        } else {
245
                            lblExternalVersion.setText(NbBundle.getMessage(SettingsPanel.class, "LBL_ExMavenVersion2", properties.getProperty( "version", "unknown" )));//NOI18N
246
                        }
247
                        return;
248
                    }
249
                } catch ( IOException ex )
250
                {
251
                    //ignore..
252
                } finally {
253
                    if (jf != null) {
254
                        try {
255
                            jf.close();
256
                        } catch (IOException x) {}
257
                    }
258
                }
259
            }
260
        }
261
        //add red color..
262
        lblExternalVersion.setText(NbBundle.getMessage(SettingsPanel.class, "ERR_NoValidInstallation"));
263
    }
264
    
265
    private void initValues() {
257
    private void initValues() {
266
        comIndex.setSelectedIndex(0);
258
        comIndex.setSelectedIndex(0);
267
        cbSnapshots.setSelected(true);
259
        cbSnapshots.setSelected(true);
268
    }
260
    }
269
    
261
    
270
    private void documentChanged(DocumentEvent e) {
262
    private MavenRuntime getSelectedRuntime(int selected) {
263
        if (selected < 0) {
264
            return null;
265
        }
266
        
267
        if (selected < predefinedRuntimes.size()) {
268
            return predefinedRuntimes.get(selected);
269
270
        } else if (!userDefinedMavenRuntimes.isEmpty() &&
271
                selected - predefinedRuntimes.size() <= userDefinedMavenRuntimes.size()) {
272
            return userDefinedMavenRuntimes.get(selected - 1 - predefinedRuntimes.size());
273
        }
274
        
275
        return null;
276
    }
277
    
278
    private void listDataChanged() {
271
        changed = true;
279
        changed = true;
272
        boolean oldvalid = valid;
280
        boolean oldvalid = valid;
273
        if (txtCommandLine.getText().trim().length() > 0) {
281
        int selected = comMavenHome.getSelectedIndex();
274
            File fil = new File(txtCommandLine.getText());
282
        String path = null;
283
        if (selected >= 0) {
284
            MavenRuntime runtime = getSelectedRuntime(selected);
285
            if (runtime != null) {
286
                activeMavenRuntime = runtime;
287
                if (!runtime.isExternal()) {
288
                    path = null;
289
                    valid = true;
290
                    lblExternalVersion.setText(runtime.getVersion());
291
292
                } else {
293
                    path = runtime.getPath();
294
                }
295
296
            } else {
297
                path = (String) mavenHomeDataModel.getElementAt(selected);
298
                activeMavenRuntime = new MavenRuntime(path, "");
299
                userDefinedMavenRuntimes.add(activeMavenRuntime);
300
            }
301
        }
302
        
303
        if (path != null) {
304
            path = path.trim();
305
            File fil = new File(path);
306
            String ver = null;
275
            if (fil.exists() && new File(fil, "bin" + File.separator + "mvn").exists()) { //NOI18N
307
            if (fil.exists() && new File(fil, "bin" + File.separator + "mvn").exists()) { //NOI18N
308
                ver = MavenUtil.getExternalVersion(path);
309
            }
310
311
            if (ver != null) {                     
312
                lblExternalVersion.setText(ver);
276
                valid = true;
313
                valid = true;
314
                activeMavenRuntime.setVersion(ver);
315
277
            } else {
316
            } else {
278
                valid = false;
317
                lblExternalVersion.setText(NbBundle.getMessage(SettingsPanel.class, "ERR_NoValidInstallation"));
279
            }
318
            }
280
        } else {
281
            valid = true;
282
        }
319
        }
320
        
283
        if (oldvalid != valid) {
321
        if (oldvalid != valid) {
284
            controller.firePropChange(MavenOptionController.PROP_VALID, Boolean.valueOf(oldvalid), Boolean.valueOf(valid));
322
            controller.firePropChange(MavenOptionController.PROP_VALID, Boolean.valueOf(oldvalid), Boolean.valueOf(valid));
285
        }
323
        }
286
        initExternalVersion();
287
    }
324
    }
288
    
325
    
289
    private ComboBoxModel createComboModel() {
326
    private ComboBoxModel createComboModel() {
Lines 308-324 Link Here
308
        bgPlugins = new javax.swing.ButtonGroup();
345
        bgPlugins = new javax.swing.ButtonGroup();
309
        bgFailure = new javax.swing.ButtonGroup();
346
        bgFailure = new javax.swing.ButtonGroup();
310
        lblCommandLine = new javax.swing.JLabel();
347
        lblCommandLine = new javax.swing.JLabel();
311
        txtCommandLine = new javax.swing.JTextField();
312
        btnCommandLine = new javax.swing.JButton();
313
        lblExternalVersion = new javax.swing.JLabel();
348
        lblExternalVersion = new javax.swing.JLabel();
314
        lblOptions = new javax.swing.JLabel();
349
        lblOptions = new javax.swing.JLabel();
315
        txtOptions = new javax.swing.JTextField();
350
        txtOptions = new javax.swing.JTextField();
316
        btnOptions = new javax.swing.JButton();
351
        btnOptions = new javax.swing.JButton();
317
        cbSkipTests = new javax.swing.JCheckBox();
352
        cbSkipTests = new javax.swing.JCheckBox();
318
        lblLocalRepository = new javax.swing.JLabel();
353
        lblLocalRepository = new javax.swing.JLabel();
319
        txtLocalRepository = new MyJTextField();
354
        txtLocalRepository = new org.netbeans.modules.maven.options.JHintedTextField();
320
        btnLocalRepository = new javax.swing.JButton();
355
        btnLocalRepository = new javax.swing.JButton();
321
        lblEmbeddedVersion = new javax.swing.JLabel();
322
        lblBinaries = new javax.swing.JLabel();
356
        lblBinaries = new javax.swing.JLabel();
323
        comBinaries = new javax.swing.JComboBox();
357
        comBinaries = new javax.swing.JComboBox();
324
        lblJavadoc = new javax.swing.JLabel();
358
        lblJavadoc = new javax.swing.JLabel();
Lines 332-349 Link Here
332
        comIndex = new javax.swing.JComboBox();
366
        comIndex = new javax.swing.JComboBox();
333
        btnIndex = new javax.swing.JButton();
367
        btnIndex = new javax.swing.JButton();
334
        cbSnapshots = new javax.swing.JCheckBox();
368
        cbSnapshots = new javax.swing.JCheckBox();
369
        comMavenHome = new javax.swing.JComboBox();
335
370
336
        org.openide.awt.Mnemonics.setLocalizedText(lblCommandLine, org.openide.util.NbBundle.getMessage(SettingsPanel.class, "SettingsPanel.lblCommandLine.text")); // NOI18N
371
        org.openide.awt.Mnemonics.setLocalizedText(lblCommandLine, org.openide.util.NbBundle.getMessage(SettingsPanel.class, "SettingsPanel.lblCommandLine.text")); // NOI18N
337
372
338
        txtCommandLine.setText(org.openide.util.NbBundle.getMessage(SettingsPanel.class, "SettingsPanel.txtCommandLine.text")); // NOI18N
339
340
        org.openide.awt.Mnemonics.setLocalizedText(btnCommandLine, org.openide.util.NbBundle.getMessage(SettingsPanel.class, "SettingsPanel.btnCommandLine.text")); // NOI18N
341
        btnCommandLine.addActionListener(new java.awt.event.ActionListener() {
342
            public void actionPerformed(java.awt.event.ActionEvent evt) {
343
                btnCommandLineActionPerformed(evt);
344
            }
345
        });
346
347
        org.openide.awt.Mnemonics.setLocalizedText(lblExternalVersion, org.openide.util.NbBundle.getMessage(SettingsPanel.class, "SettingsPanel.lblExternalVersion.text", new Object[] {})); // NOI18N
373
        org.openide.awt.Mnemonics.setLocalizedText(lblExternalVersion, org.openide.util.NbBundle.getMessage(SettingsPanel.class, "SettingsPanel.lblExternalVersion.text", new Object[] {})); // NOI18N
348
374
349
        org.openide.awt.Mnemonics.setLocalizedText(lblOptions, org.openide.util.NbBundle.getMessage(SettingsPanel.class, "SettingsPanel.lblOptions.text")); // NOI18N
375
        org.openide.awt.Mnemonics.setLocalizedText(lblOptions, org.openide.util.NbBundle.getMessage(SettingsPanel.class, "SettingsPanel.lblOptions.text")); // NOI18N
Lines 366-373 Link Here
366
            }
392
            }
367
        });
393
        });
368
394
369
        org.openide.awt.Mnemonics.setLocalizedText(lblEmbeddedVersion, org.openide.util.NbBundle.getMessage(SettingsPanel.class, "SettingsPanel.lblEmbeddedVersion.text")); // NOI18N
370
371
        lblBinaries.setLabelFor(comBinaries);
395
        lblBinaries.setLabelFor(comBinaries);
372
        org.openide.awt.Mnemonics.setLocalizedText(lblBinaries, org.openide.util.NbBundle.getMessage(SettingsPanel.class, "SettingsPanel.lblBinaries.text")); // NOI18N
396
        org.openide.awt.Mnemonics.setLocalizedText(lblBinaries, org.openide.util.NbBundle.getMessage(SettingsPanel.class, "SettingsPanel.lblBinaries.text")); // NOI18N
373
397
Lines 410-474 Link Here
410
                .addContainerGap()
434
                .addContainerGap()
411
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
435
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
412
                    .add(layout.createSequentialGroup()
436
                    .add(layout.createSequentialGroup()
437
                        .add(lblCommandLine)
438
                        .add(31, 31, 31)
413
                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
439
                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
414
                            .add(lblCommandLine)
440
                            .add(comMavenHome, 0, 394, Short.MAX_VALUE)
415
                            .add(lblOptions)
441
                            .add(lblExternalVersion, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 394, Short.MAX_VALUE))
416
                            .add(lblLocalRepository))
442
                        .add(137, 137, 137))
417
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
443
                    .add(layout.createSequentialGroup()
418
                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
444
                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
419
                            .add(lblEmbeddedVersion, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 470, Short.MAX_VALUE)
445
                            .add(layout.createSequentialGroup()
446
                                .add(12, 12, 12)
447
                                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
448
                                    .add(lblJavadoc)
449
                                    .add(lblBinaries)
450
                                    .add(lblSource)
451
                                    .add(jLabel3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 570, Short.MAX_VALUE))
452
                                .add(106, 106, 106))
453
                            .add(btnGoals)
420
                            .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
454
                            .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
421
                                .add(txtCommandLine, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 387, Short.MAX_VALUE)
455
                                .add(lblIndex)
456
                                .add(18, 18, 18)
457
                                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
458
                                    .add(org.jdesktop.layout.GroupLayout.LEADING, cbSnapshots)
459
                                    .add(comIndex, 0, 398, Short.MAX_VALUE))
422
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
460
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
423
                                .add(btnCommandLine))
461
                                .add(btnIndex))
424
                            .add(lblExternalVersion, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 470, Short.MAX_VALUE)
462
                            .add(layout.createSequentialGroup()
425
                            .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
426
                                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
463
                                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
427
                                    .add(comSource, 0, 387, Short.MAX_VALUE)
464
                                    .add(lblOptions)
428
                                    .add(comJavadoc, 0, 387, Short.MAX_VALUE)
465
                                    .add(lblLocalRepository)
429
                                    .add(comBinaries, 0, 387, Short.MAX_VALUE)
466
                                    .add(jLabel1))
430
                                    .add(txtLocalRepository, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 387, Short.MAX_VALUE)
431
                                    .add(txtOptions, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 387, Short.MAX_VALUE))
432
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
467
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
433
                                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
468
                                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
434
                                    .add(btnLocalRepository)
469
                                    .add(cbSkipTests)
435
                                    .add(btnOptions)))
470
                                    .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
436
                            .add(cbSkipTests)))
471
                                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
437
                    .add(jLabel1)
472
                                            .add(org.jdesktop.layout.GroupLayout.LEADING, comSource, 0, 394, Short.MAX_VALUE)
438
                    .add(layout.createSequentialGroup()
473
                                            .add(org.jdesktop.layout.GroupLayout.LEADING, comJavadoc, 0, 394, Short.MAX_VALUE)
439
                        .add(12, 12, 12)
474
                                            .add(org.jdesktop.layout.GroupLayout.LEADING, comBinaries, 0, 394, Short.MAX_VALUE)
440
                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
475
                                            .add(org.jdesktop.layout.GroupLayout.LEADING, txtLocalRepository, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 394, Short.MAX_VALUE)
441
                            .add(lblJavadoc)
476
                                            .add(org.jdesktop.layout.GroupLayout.LEADING, txtOptions, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 394, Short.MAX_VALUE))
442
                            .add(lblBinaries)
477
                                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
443
                            .add(lblSource)
478
                                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
444
                            .add(jLabel3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 531, Short.MAX_VALUE))
479
                                            .add(btnLocalRepository)
445
                        .add(106, 106, 106))
480
                                            .add(btnOptions))))))
446
                    .add(btnGoals)
481
                        .addContainerGap())))
447
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
448
                        .add(lblIndex)
449
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
450
                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
451
                            .add(cbSnapshots)
452
                            .add(comIndex, 0, 391, Short.MAX_VALUE))
453
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
454
                        .add(btnIndex)))
455
                .addContainerGap())
456
        );
482
        );
457
483
458
        layout.linkSize(new java.awt.Component[] {btnCommandLine, btnIndex, btnLocalRepository, btnOptions}, org.jdesktop.layout.GroupLayout.HORIZONTAL);
484
        layout.linkSize(new java.awt.Component[] {btnIndex, btnLocalRepository, btnOptions}, org.jdesktop.layout.GroupLayout.HORIZONTAL);
459
485
460
        layout.setVerticalGroup(
486
        layout.setVerticalGroup(
461
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
487
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
462
            .add(layout.createSequentialGroup()
488
            .add(layout.createSequentialGroup()
463
                .add(lblEmbeddedVersion)
489
                .addContainerGap()
464
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
465
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
490
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
466
                    .add(lblCommandLine)
491
                    .add(comMavenHome, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
467
                    .add(txtCommandLine, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
492
                    .add(lblCommandLine))
468
                    .add(btnCommandLine))
493
                .add(8, 8, 8)
469
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
470
                .add(lblExternalVersion, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 14, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
494
                .add(lblExternalVersion, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 14, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
471
                .add(18, 18, 18)
495
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
472
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
496
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
473
                    .add(lblOptions)
497
                    .add(lblOptions)
474
                    .add(txtOptions, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
498
                    .add(txtOptions, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
Lines 480-486 Link Here
480
                    .add(txtLocalRepository, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
504
                    .add(txtLocalRepository, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
481
                    .add(btnLocalRepository)
505
                    .add(btnLocalRepository)
482
                    .add(lblLocalRepository))
506
                    .add(lblLocalRepository))
483
                .add(16, 16, 16)
507
                .add(18, 18, 18)
484
                .add(jLabel1)
508
                .add(jLabel1)
485
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
509
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
486
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
510
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
Lines 505-511 Link Here
505
                    .add(comIndex, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
529
                    .add(comIndex, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
506
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
530
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
507
                .add(cbSnapshots)
531
                .add(cbSnapshots)
508
                .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
532
                .addContainerGap(37, Short.MAX_VALUE))
509
        );
533
        );
510
    }// </editor-fold>//GEN-END:initComponents
534
    }// </editor-fold>//GEN-END:initComponents
511
535
Lines 533-539 Link Here
533
        chooser.setDialogTitle(NbBundle.getMessage(SettingsPanel.class, "TIT_Select"));
557
        chooser.setDialogTitle(NbBundle.getMessage(SettingsPanel.class, "TIT_Select"));
534
        chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
558
        chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
535
        chooser.setFileHidingEnabled(false);
559
        chooser.setFileHidingEnabled(false);
536
        String path = ((MyJTextField)txtLocalRepository).getRealText();
560
        String path = ((JHintedTextField)txtLocalRepository).getRealText();
537
        if (path.trim().length() == 0) {
561
        if (path.trim().length() == 0) {
538
            path = new File(System.getProperty("user.home"), ".m2").getAbsolutePath(); //NOI18N
562
            path = new File(System.getProperty("user.home"), ".m2").getAbsolutePath(); //NOI18N
539
        }
563
        }
Lines 545-562 Link Here
545
        }
569
        }
546
        if (JFileChooser.APPROVE_OPTION == chooser.showOpenDialog(this)) {
570
        if (JFileChooser.APPROVE_OPTION == chooser.showOpenDialog(this)) {
547
            File projectDir = chooser.getSelectedFile();
571
            File projectDir = chooser.getSelectedFile();
548
            ((MyJTextField)txtLocalRepository).setRealText(FileUtil.normalizeFile(projectDir).getAbsolutePath());
572
            ((JHintedTextField)txtLocalRepository).setRealText(FileUtil.normalizeFile(projectDir).getAbsolutePath());
549
        }
573
        }
550
    }//GEN-LAST:event_btnLocalRepositoryActionPerformed
574
    }//GEN-LAST:event_btnLocalRepositoryActionPerformed
551
575
552
    private void btnCommandLineActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCommandLineActionPerformed
576
    private void browseAddNewRuntime() {
553
        JFileChooser chooser = new JFileChooser();
577
        JFileChooser chooser = new JFileChooser();
554
        FileUtil.preventFileChooserSymlinkTraversal(chooser, null);
578
        FileUtil.preventFileChooserSymlinkTraversal(chooser, null);
555
        chooser.setDialogTitle(org.openide.util.NbBundle.getMessage(SettingsPanel.class, "TIT_Select2"));
579
        chooser.setDialogTitle(org.openide.util.NbBundle.getMessage(SettingsPanel.class, "TIT_Select2"));
556
        chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
580
        chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
557
        chooser.setFileHidingEnabled(false);
581
        chooser.setFileHidingEnabled(false);
558
        String path = txtCommandLine.getText();
582
        int selected = comMavenHome.getSelectedIndex();
559
        if (path.trim().length() == 0) {
583
        MavenRuntime selectedRuntime = getSelectedRuntime(selected);
584
        String path = selectedRuntime != null && selectedRuntime.isExternal() ?
585
            selectedRuntime.getPath() : null;
586
        if (path == null || path.trim().length() == 0) {
560
            path = new File(System.getProperty("user.home")).getAbsolutePath(); //NOI18N
587
            path = new File(System.getProperty("user.home")).getAbsolutePath(); //NOI18N
561
        }
588
        }
562
        if (path.length() > 0) {
589
        if (path.length() > 0) {
Lines 567-577 Link Here
567
        }
594
        }
568
        if (JFileChooser.APPROVE_OPTION == chooser.showOpenDialog(this)) {
595
        if (JFileChooser.APPROVE_OPTION == chooser.showOpenDialog(this)) {
569
            File projectDir = chooser.getSelectedFile();
596
            File projectDir = chooser.getSelectedFile();
570
            txtCommandLine.setText(FileUtil.normalizeFile(projectDir).getAbsolutePath());
597
            String newRuntimePath = FileUtil.normalizeFile(projectDir).getAbsolutePath();
598
            boolean existed = false;
599
            List<MavenRuntime> runtimes = new ArrayList<MavenRuntime>();
600
            runtimes.addAll(predefinedRuntimes);
601
            runtimes.addAll(userDefinedMavenRuntimes);
602
            for (MavenRuntime runtime : runtimes) {
603
                if (runtime.getPath().equals(newRuntimePath)) {
604
                    existed = true;
605
                }
606
            }
607
            if (!existed) {
608
                // do not add duplicated directory
609
                if (userDefinedMavenRuntimes.isEmpty()) {
610
                    mavenHomeDataModel.insertElementAt(SEPARATOR, predefinedRuntimes.size());
611
                }
612
                mavenHomeDataModel.insertElementAt(newRuntimePath, runtimes.size() + 1);
613
            }
614
            comMavenHome.setSelectedItem(newRuntimePath);
571
        }
615
        }
572
        
616
    }
573
    }//GEN-LAST:event_btnCommandLineActionPerformed
617
    
574
575
    private void btnGoalsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnGoalsActionPerformed
618
    private void btnGoalsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnGoalsActionPerformed
576
        NbGlobalActionGoalProvider provider = null;
619
        NbGlobalActionGoalProvider provider = null;
577
        for (MavenActionsProvider prov : Lookup.getDefault().lookupAll(MavenActionsProvider.class)) {
620
        for (MavenActionsProvider prov : Lookup.getDefault().lookupAll(MavenActionsProvider.class)) {
Lines 612-618 Link Here
612
    private javax.swing.ButtonGroup bgChecksums;
655
    private javax.swing.ButtonGroup bgChecksums;
613
    private javax.swing.ButtonGroup bgFailure;
656
    private javax.swing.ButtonGroup bgFailure;
614
    private javax.swing.ButtonGroup bgPlugins;
657
    private javax.swing.ButtonGroup bgPlugins;
615
    private javax.swing.JButton btnCommandLine;
616
    private javax.swing.JButton btnGoals;
658
    private javax.swing.JButton btnGoals;
617
    private javax.swing.JButton btnIndex;
659
    private javax.swing.JButton btnIndex;
618
    private javax.swing.JButton btnLocalRepository;
660
    private javax.swing.JButton btnLocalRepository;
Lines 622-656 Link Here
622
    private javax.swing.JComboBox comBinaries;
664
    private javax.swing.JComboBox comBinaries;
623
    private javax.swing.JComboBox comIndex;
665
    private javax.swing.JComboBox comIndex;
624
    private javax.swing.JComboBox comJavadoc;
666
    private javax.swing.JComboBox comJavadoc;
667
    private javax.swing.JComboBox comMavenHome;
625
    private javax.swing.JComboBox comSource;
668
    private javax.swing.JComboBox comSource;
626
    private javax.swing.JLabel jLabel1;
669
    private javax.swing.JLabel jLabel1;
627
    private javax.swing.JLabel jLabel3;
670
    private javax.swing.JLabel jLabel3;
628
    private javax.swing.JLabel lblBinaries;
671
    private javax.swing.JLabel lblBinaries;
629
    private javax.swing.JLabel lblCommandLine;
672
    private javax.swing.JLabel lblCommandLine;
630
    private javax.swing.JLabel lblEmbeddedVersion;
631
    private javax.swing.JLabel lblExternalVersion;
673
    private javax.swing.JLabel lblExternalVersion;
632
    private javax.swing.JLabel lblIndex;
674
    private javax.swing.JLabel lblIndex;
633
    private javax.swing.JLabel lblJavadoc;
675
    private javax.swing.JLabel lblJavadoc;
634
    private javax.swing.JLabel lblLocalRepository;
676
    private javax.swing.JLabel lblLocalRepository;
635
    private javax.swing.JLabel lblOptions;
677
    private javax.swing.JLabel lblOptions;
636
    private javax.swing.JLabel lblSource;
678
    private javax.swing.JLabel lblSource;
637
    private javax.swing.JTextField txtCommandLine;
638
    private javax.swing.JTextField txtLocalRepository;
679
    private javax.swing.JTextField txtLocalRepository;
639
    private javax.swing.JTextField txtOptions;
680
    private javax.swing.JTextField txtOptions;
640
    // End of variables declaration//GEN-END:variables
681
    // End of variables declaration//GEN-END:variables
641
    
682
    
642
    public void setValues() {
683
    public void setValues() {
643
        txtOptions.setText(MavenSettings.getDefault().getDefaultOptions());
684
        txtOptions.setText(MavenSettings.getDefault().getDefaultOptions());
644
        txtCommandLine.getDocument().removeDocumentListener(docList);
685
        
686
        predefinedRuntimes.clear();
687
        predefinedRuntimes.addAll(MavenSettings.getDefault().getPredefinedMavenRuntimes());
688
        userDefinedMavenRuntimes.clear();
689
        userDefinedMavenRuntimes.addAll(MavenSettings.getDefault().getUserDefinedMavenRuntimes());
690
        comMavenHome.removeActionListener(listItemChangedListener);
691
        mavenHomeDataModel.removeAllElements();
645
        File command = MavenSettings.getDefault().getCommandLinePath();
692
        File command = MavenSettings.getDefault().getCommandLinePath();
646
        txtCommandLine.setText(command != null ? command.getAbsolutePath() : ""); //NOI18N
693
        String embedded = null;
647
        initExternalVersion();
694
        for (MavenRuntime runtime : predefinedRuntimes) {
648
        txtCommandLine.getDocument().addDocumentListener(docList);
695
            String desc = org.openide.util.NbBundle.getMessage(SettingsPanel.class,
696
                    (runtime.isExternal() ? "MAVEN_RUNTIME_External" : "MAVEN_RUNTIME_Embedded"),
697
                    new Object[]{runtime.getPath(), runtime.getVersion()}); // NOI18N
698
            mavenHomeDataModel.addElement(desc);
699
            if (embedded == null && !runtime.isExternal()) {
700
                embedded = desc;
701
            }
702
        }
703
        
704
        if (!userDefinedMavenRuntimes.isEmpty()) {
705
            mavenHomeDataModel.addElement(SEPARATOR);
706
            for (MavenRuntime runtime : userDefinedMavenRuntimes) {
707
                String desc = org.openide.util.NbBundle.getMessage(SettingsPanel.class,
708
                        "MAVEN_RUNTIME_External",
709
                        new Object[]{runtime.getPath(), runtime.getVersion()}); // NOI18N
710
                mavenHomeDataModel.addElement(desc);
711
            }
712
        }
713
        
714
        mavenHomeDataModel.addElement(SEPARATOR);
715
        mavenHomeDataModel.addElement(org.openide.util.NbBundle.getMessage(SettingsPanel.class,
716
                    "MAVEN_RUNTIME_Browse"));
717
        mavenHomeDataModel.addElement(org.openide.util.NbBundle.getMessage(SettingsPanel.class,
718
                    "MAVEN_RUNTIME_ClearUserDefines"));
719
        comMavenHome.setSelectedItem(command != null ? command.getAbsolutePath() : embedded); //NOI18N
720
        listDataChanged();
721
        lastSelected = comMavenHome.getSelectedIndex();
722
        comMavenHome.addActionListener(listItemChangedListener);
649
        
723
        
650
        cbSnapshots.setSelected(RepositoryPreferences.getInstance().isIncludeSnapshots());
724
        cbSnapshots.setSelected(RepositoryPreferences.getInstance().isIncludeSnapshots());
651
        comIndex.setSelectedIndex(RepositoryPreferences.getInstance().getIndexUpdateFrequency());
725
        comIndex.setSelectedIndex(RepositoryPreferences.getInstance().getIndexUpdateFrequency());
652
        String repo = MavenSettings.getDefault().getCustomLocalRepository();
726
        String repo = MavenSettings.getDefault().getCustomLocalRepository();
653
        ((MyJTextField)txtLocalRepository).setRealText(repo != null ? repo : "");
727
        ((JHintedTextField)txtLocalRepository).setRealText(repo != null ? repo : "");
654
        comBinaries.setSelectedItem(MavenSettings.getDefault().getBinaryDownloadStrategy());
728
        comBinaries.setSelectedItem(MavenSettings.getDefault().getBinaryDownloadStrategy());
655
        comJavadoc.setSelectedItem(MavenSettings.getDefault().getJavadocDownloadStrategy());
729
        comJavadoc.setSelectedItem(MavenSettings.getDefault().getJavadocDownloadStrategy());
656
        comSource.setSelectedItem(MavenSettings.getDefault().getSourceDownloadStrategy());
730
        comSource.setSelectedItem(MavenSettings.getDefault().getSourceDownloadStrategy());
Lines 661-669 Link Here
661
    
735
    
662
    public void applyValues() {
736
    public void applyValues() {
663
        MavenSettings.getDefault().setDefaultOptions(txtOptions.getText().trim());
737
        MavenSettings.getDefault().setDefaultOptions(txtOptions.getText().trim());
664
        MavenSettings.getDefault().setCustomLocalRepository(((MyJTextField)txtLocalRepository).getRealText());
738
        MavenSettings.getDefault().setCustomLocalRepository(((JHintedTextField)txtLocalRepository).getRealText());
665
        String cl = txtCommandLine.getText().trim();
739
        // remember only user-defined runtimes of RUNTIME_COUNT_LIMIT count at the most
666
        if (cl.length() == 0) {
740
        List<MavenRuntime> runtimes = new ArrayList<MavenRuntime>();
741
        runtimes.addAll(predefinedRuntimes);
742
        int startIndex = 0, endIndex = userDefinedMavenRuntimes.size();
743
        if (!userDefinedMavenRuntimes.isEmpty() && endIndex - startIndex > RUNTIME_COUNT_LIMIT) {
744
            int selected = comMavenHome.getSelectedIndex() - predefinedRuntimes.size() - 1;
745
            if (selected < 0) {
746
                selected = 0;
747
            }
748
            if (selected + RUNTIME_COUNT_LIMIT < endIndex) {
749
                endIndex = selected + RUNTIME_COUNT_LIMIT;
750
            }
751
            if (endIndex - RUNTIME_COUNT_LIMIT > startIndex) {
752
                startIndex = endIndex - RUNTIME_COUNT_LIMIT;
753
            }
754
        }
755
        runtimes.addAll(userDefinedMavenRuntimes.subList(startIndex, endIndex));
756
        MavenSettings.getDefault().setMavenRuntimes(runtimes);
757
        String cl = activeMavenRuntime != null ? activeMavenRuntime.getPath() : null;
758
        if (cl != null && cl.length() == 0) {
667
            cl = null;
759
            cl = null;
668
        }
760
        }
669
        //MEVENIDE-553
761
        //MEVENIDE-553

Return to bug 183455