Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proxy autodetection + autoconfiguration for Maven. #5038

Merged
merged 6 commits into from
Dec 7, 2022

Conversation

sdedic
Copy link
Member

@sdedic sdedic commented Dec 1, 2022

Similar to #5006 but for Maven. For "priming build" and maven online invocations, the proxy is checked first. If mismatch is found, the IDE asks the user (the default setting) other actions can be: ignore, auto-update maven settings.xml or override on-the-fly.

The override is done by generating a copy of the ~/.m2/settings.xml with relevant parts changed/added, maven is then invoked with --settings option. Generated files are put into $nbuserdir/var/cache.

@sdedic sdedic added LSP [ci] enable Language Server Protocol tests Maven [ci] enable "build tools" tests labels Dec 1, 2022
@sdedic sdedic added this to the NB17 milestone Dec 1, 2022
@sdedic sdedic self-assigned this Dec 1, 2022
Copy link
Contributor

@MartinBalin MartinBalin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has to go to 16.0.1 patch release along with Gradle fixes.

Copy link
Contributor

@dbalek dbalek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine. Thanks.

Copy link
Member

@mbien mbien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this shouldn't be empty, right? ;)

empty_combo

The position right now is right between global exec options and global custom goals. It might look better if its moved one row up which would leave the other settings grouped together.

@sdedic
Copy link
Member Author

sdedic commented Dec 6, 2022

The position right now is right between global exec options and global custom goals. It might look better if its moved one row up which would leave the other settings grouped together.

You mean reorder to:

  • network proxy
  • global exec options
  • the rest ?

If so then I'd separate the exec + network options (that affect the execution of maven) from the rest that affects behaviour of the tool

@mbien
Copy link
Member

mbien commented Dec 6, 2022

The position right now is right between global exec options and global custom goals. It might look better if its moved one row up which would leave the other settings grouped together.

You mean reorder to:

* network proxy

* global exec options

* the rest ?

yep

If so then I'd separate the exec + network options (that affect the execution of maven) from the rest that affects behaviour of the tool

maybe its fine. Its just that I usually wouldn't expect NW options between command line flags and maven goal definitions. If it should remain where it is right now, I would try to make the combo box the same width as the text field.

This panel might need a UI pass anyway, e.g maybe it would make sense to move everything what is below "edit global custom goal defs" to the appearance category which is almost empty ATM.

@sdedic
Copy link
Member Author

sdedic commented Dec 6, 2022

maybe its fine. Its just that I usually wouldn't expect NW options between command line flags and maven goal definitions. If it should remain where it is right now, I would try to make the combo box the same width as the text field.

Kept order, made textfield + combo same size, resizable, aligned. Combo filled -- 1126d75

@mbien
Copy link
Member

mbien commented Dec 6, 2022

looks much better to me now + can confirm that the combo box is working now

one more thing if you have the patience:

  • double click on all cards starting with the children on the navigator and shrink the height till it snaps to default size.
  • once done do the same for the main panel

this will remove the scrollbar since everything will be set to default size and the layout manager can do the rest.

here a diff if you want to apply it directly instead:

diff --git a/java/maven/src/org/netbeans/modules/maven/options/SettingsPanel.form b/java/maven/src/org/netbeans/modules/maven/options/SettingsPanel.form
index 595c94e..151e2a9 100644
--- a/java/maven/src/org/netbeans/modules/maven/options/SettingsPanel.form
+++ b/java/maven/src/org/netbeans/modules/maven/options/SettingsPanel.form
@@ -216,7 +216,7 @@
                       </Group>
                       <EmptySpace max="-2" attributes="0"/>
                       <Component id="jLabel3" min="-2" pref="44" max="-2" attributes="0"/>
-                      <EmptySpace pref="379" max="32767" attributes="0"/>
+                      <EmptySpace max="32767" attributes="0"/>
                   </Group>
               </Group>
             </DimensionLayout>
@@ -322,7 +322,7 @@
                       <Component id="cbDisableIndex" min="-2" max="-2" attributes="0"/>
                       <EmptySpace max="-2" attributes="0"/>
                       <Component id="jLabel5" min="-2" max="-2" attributes="0"/>
-                      <EmptySpace pref="450" max="32767" attributes="0"/>
+                      <EmptySpace max="32767" attributes="0"/>
                   </Group>
               </Group>
             </DimensionLayout>
@@ -422,7 +422,7 @@
                           <Component id="txtDirectory" alignment="3" min="-2" max="-2" attributes="0"/>
                           <Component id="btnDirectory" alignment="3" min="-2" max="-2" attributes="0"/>
                       </Group>
-                      <EmptySpace pref="332" max="32767" attributes="0"/>
+                      <EmptySpace max="32767" attributes="0"/>
                   </Group>
               </Group>
             </DimensionLayout>
diff --git a/java/maven/src/org/netbeans/modules/maven/options/SettingsPanel.java b/java/maven/src/org/netbeans/modules/maven/options/SettingsPanel.java
index 187de3b..b960bfc 100644
--- a/java/maven/src/org/netbeans/modules/maven/options/SettingsPanel.java
+++ b/java/maven/src/org/netbeans/modules/maven/options/SettingsPanel.java
@@ -525,7 +525,7 @@
                     .addComponent(comSource, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                 .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE)
-                .addContainerGap(379, Short.MAX_VALUE))
+                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
         );
 
         pnlCards.add(pnlDependencies, "dependencies");
@@ -585,7 +585,7 @@
                 .addComponent(cbDisableIndex)
                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                 .addComponent(jLabel5)
-                .addContainerGap(450, Short.MAX_VALUE))
+                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
         );
 
         pnlCards.add(pnlIndex, "index");
@@ -641,7 +641,7 @@
                     .addComponent(lblDirectory)
                     .addComponent(txtDirectory, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                     .addComponent(btnDirectory))
-                .addContainerGap(332, Short.MAX_VALUE))
+                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
         );
 
         pnlCards.add(plnExperimental, "experimental");

@sdedic sdedic merged commit e37e856 into apache:master Dec 7, 2022
pepness pushed a commit to pepness/incubator-netbeans that referenced this pull request Jan 9, 2023
Proxy autodetection + autoconfiguration for Maven. Reset gaps/panels to default size.
@matthiasblaesing
Copy link
Contributor

matthiasblaesing commented Jan 31, 2023

I saw this dialog the first time today:

image

What is missing IMHO is a guide how to silence this. I had to come here to realize, that he solution is as easy as going to maven settings and setting the proxy selection to "Do not check".

Spelling this out for me ("Go to Options -> Java -> Maven -> Execution -> Network proxy to change the default action") would have helped me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LSP [ci] enable Language Server Protocol tests Maven [ci] enable "build tools" tests Need Squashing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants