github / maven-plugins

Official GitHub Maven Plugins
MIT License
584 stars 198 forks source link

support for encrypted passwords #16

Closed brettporter closed 12 years ago

brettporter commented 12 years ago

Added the Maven 3 API for retrieving the authentication credentials from the repository system, rather than manually getting them from the settings file, which will ensure that they are first decrypted.

With this in place, you could remove the Settings object and extra branch altogether - if you're not looking to maintain the behaviour of the API.

I haven't tested this change on the download mojo as I'm not using it, but I expect it works the same. Happy to revise as needed.

kevinsawicki commented 12 years ago

First off, thanks for contributing this. Just had a minor question to start:

With this in place, you could remove the Settings object and extra branch altogether - if you're not looking to maintain the behaviour of the API.

What do you mean by "extra branch"?

brettporter commented 12 years ago

Sorry, should have realised that'd be the wrong word to use there!

I just meant the extra "if" statements in the code that fallback to pulling it from settings instead of session. If the mojos all pass the session in, the settings will become unnecessary.

kevinsawicki commented 12 years ago

Oh okay, got it, thanks for clarifying.

kevinsawicki commented 12 years ago

@brettporter I merged in your commit to master and made some further tweaks to support it in the downloads plugin as well.

Could you pull the latest master and verify it still works for you? If everything looks good I'll push a new release with your fix for issue #15.

Thanks again.

brettporter commented 12 years ago

Thanks for making the revisions - this still works for me.

It just occurred to me to check - I think this might be the first use of a Maven 3-only API in the plugin. Given the dependencies used, supporting Maven 3 only seemed to be your intent, but I believe it may have still worked on Maven 2. Do you expect any problem with cutting off support for Maven 2 users?