volkertb / autoproxy-maven-plugin

Tired of having to manually edit your Maven proxy settings as you move between corporate networks? Now there's a way to handle it automatically. Introducing the Autoproxy Maven plugin.
Other
9 stars 2 forks source link

NullPointerException if no proxy is defined in settings.xml #2

Closed michael-schnell closed 7 years ago

michael-schnell commented 9 years ago

Seems as if the code fails with a NullPointerException if no proxy is defined in the "settings.xml" at all:

[INFO] Available proxy 1:
[INFO]   * Proxy type: HTTP
[INFO]   * Proxy address: 192.168.x.y:8080
[INFO] Overriding Maven proxy settings with the first detected available proxy (192.168.x.y:8080)...
...
Caused by: java.lang.NullPointerException
        at com.buisonje.AutoProxyMojo.overrideMavenProxySettings(AutoProxyMojo.java:151)
        at com.buisonje.AutoProxyMojo.execute(AutoProxyMojo.java:131)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133)
volkertb commented 9 years ago

Thanks for the bug report! I'll look into it. Patches are welcome, of course. :-)

volkertb commented 9 years ago

Should be fixed in commit https://github.com/volkertb/autoproxy-maven-plugin/commit/c70011bf601041e2b2ce75c36c5ec39caad71124

@michael-schnell Could you please retest if that fixes it for you as well? I'll close this ticket within a week until I hear otherwise. Thanks! :-)