public class MavenProxySupport extends Object
ProxySelector
API, then reads the current Maven
settings using EmbedderFactory.getProjectEmbedder()
. If the maven settings do not contain proper proxy setup, maven options (MavenSettings.getNetworkProxy()
is consulted:
BeanRunConfig
will be instructed to use it
settings.xml.old
or a numbered settings.xml.old.N
, first unused N is selected. If the settings file contins
the proxy in effect, but not active, the active
property of that proxy will be set to true, and the others to false. Otherwise a new proxy entry with the desired proxy host/port is created.
To disable proxies, all active
entries are set to false.
The MavenProxySupport.ProxyResult.configure(org.netbeans.modules.maven.execute.BeanRunConfig)
should be run before each maven online invocation to potentially replace the global settings file with a customized one,
that specifies the correct proxy.
When creating customized settings.xml files, the files are named like settings-[hashcode of the oroginal]-[sanitized proxy host].xml
. If the settings.xml file does not exist at all, "new" is used
instead of the hashcode. Proxy host sanitization just replaces weird characters by "_".
Modifier and Type | Class and Description |
---|---|
static class |
MavenProxySupport.ProxyResult |
static class |
MavenProxySupport.Status |
Constructor and Description |
---|
MavenProxySupport(Project project) |
Modifier and Type | Method and Description |
---|---|
CompletableFuture<MavenProxySupport.ProxyResult> |
checkProxySettings() |
public MavenProxySupport(Project project)
public CompletableFuture<MavenProxySupport.ProxyResult> checkProxySettings()