Hi Mirko,
thanks! What are the necessary imports and the POM dependencies for that?
Thanks.


Michael



> Hello Michael,
>
> reading your Agile ALM book right now :-):
>
> Here is an example how to get all servers with password decrypted:
>
> public class MyMojo extends AbstractMojo {
>
>     /**
>      * Maven settings.
>      */
>     @Component
>     private Settings settings;
>     /**
>      * The decrypter for passwords.
>      */
>     @Component
>     private SettingsDecrypter settingsDecrypter;
>
>     /**
>      * Returns the list of servers with decrypted passwords.
>      *
>      * @return list of servers with decrypted passwords.
>      */
>     List<Server> getDecryptedServers() {
>         final SettingsDecryptionRequest settingsDecryptionRequest =
> new DefaultSettingsDecryptionRequest();
>         settingsDecryptionRequest.setServers(settings.getServers());
>         final SettingsDecryptionResult decrypt =
> settingsDecrypter.decrypt(settingsDecryptionRequest);
>         return decrypt.getServers();
>     }
> }
>
> Regards Mirko
> --
> http://illegalstateexception.blogspot.com/
> https://github.com/mfriedenhagen/
> https://bitbucket.org/mfriedenhagen/
> https://twitter.com/mfriedenhagen
>
>
> On Fri, Aug 24, 2012 at 11:36 AM, Michael Hüttermann
> <[email protected]> wrote:
>> Hello,
>>
>> how can I (e.g. programmatically, in an own Maven plugin) access the
>> "server">"password" element of settings.xml, to re-use the value. Is
>> there
>> any chance to do so?
>>
>>
>>
>> Thanks!
>>
>> Michael
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to