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

Support for maven proxy tag <active> #1074

Open
hazendaz opened this issue Jan 20, 2018 · 8 comments
Open

Support for maven proxy tag <active> #1074

hazendaz opened this issue Jan 20, 2018 · 8 comments

Comments

@hazendaz
Copy link

hazendaz commented Jan 20, 2018

Maven has a tag called <active> in the proxies of settings.xml

https://maven.apache.org/guides/mini/guide-proxies.html

Currently this plugin does not handle the active tag and instead throws an error that the mavenSettingsProxyId must be set.

It would be a nice improvement if it handled that tag so we didn't have to put proxy information into our pom.

In my case, I have two proxies listed with one active 'true' and one active 'false'. This is not an issue if I remove one of those proxies regardless of the active setting.

@jeremylong
Copy link
Owner

I'll look into implementing this. Thanks for the suggestion.

@hazendaz
Copy link
Author

hazendaz commented Feb 4, 2018

Great! Thanks. I updated the original report as the tag was not showing (markdown issue) and my grammer was off a bit.

@davidmoten
Copy link

davidmoten commented Jul 25, 2018

I have a related problem. When I have two active proxy definitions (one for http and another for https) in my settings.xml I get this error:

Failed to execute goal org.owasp:dependency-check-maven:3.3.0:aggregate (default-cli) on project parent: Execution default-cli of goal org.owasp:dependency-check-maven:3.3.0:aggregate failed: Ambiguous proxy definition

The workaround is to disable the http proxy while I do the dependency check.

@davidmoten
Copy link

One approach to solve this is to use a class like ProxyConfig from:

https://github.com/eirslett/frontend-maven-plugin/blob/4f21ed9a467fe407f849356957e2b9c27e5eb972/frontend-plugin-core/src/main/java/com/github/eirslett/maven/plugins/frontend/lib/ProxyConfig.java

The idea is that the list of active proxies is encapsulated by ProxyConfig and given a url the ProxyConfig instance gives you a suitable Proxy object to use for accessing the url.

@aikebah
Copy link
Collaborator

aikebah commented Dec 18, 2018

I have a related problem. When I have two active proxy definitions (one for http and another for https) in my settings.xml I get this error:

Failed to execute goal org.owasp:dependency-check-maven:3.3.0:aggregate (default-cli) on project parent: Execution default-cli of goal org.owasp:dependency-check-maven:3.3.0:aggregate failed: Ambiguous proxy definition

The workaround is to disable the http proxy while I do the dependency check.

@davidmoten you are aware that more than one active proxy is not supported by maven? And that the protocol of the settings refers to the protocol of the proxy-server and not of the URL that is accessed? Settings reference
Having two active proxies is useless in Maven

@aikebah
Copy link
Collaborator

aikebah commented Dec 18, 2018

@jeremylong Shall I take a look into this and prepare a PR? Or do you already have local coding in progress for it?

@davidmoten
Copy link

@aikebah nope, wasn't aware, thanks for the heads-up and the links!

@aikebah
Copy link
Collaborator

aikebah commented Dec 19, 2018

Already solved with the fixes of #831 / #1493 in 19ce3f4 and 8190a86 @jeremylong this enhancement request should be closed. Was fixed with version 3.3.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants