Am 2018-05-21 um 19:53 schrieb Mark Raynsford:
On 2018-05-21T19:46:26 +0200
"Robert Scholte" <rfscho...@apache.org> wrote:

Of course :)

This is probably a good example:
https://github.com/apache/maven-javadoc-plugin/blob/master/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java#L3582

Hah, thanks! That's a pretty direct example!

For future visitors:

1. Inject a Settings instance using the normal injection mechanisms:

   @Parameter( defaultValue = "${settings}", readonly = true, required
   = true )
   private Settings settings;

2. Proxy activeProxy = settings.getActiveProxy();

It is pretty good that Robert raised the example with the Javadoc mojo because it is broken. Our current approach does not scale and the Javadoc Mojo will fail if your activ proxy is for HTTP, but the resources are HTTPS and vice versa. Settings needs an overhaul. I constantly suffer from broken Javadoc URLs at work because of this.

Upshot: don't rely on #getActiveProxy(), but iterate manually and get *all* protocols you need.

Michael

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org

Reply via email to