This is a great little piece of code, but it connects to AWS twice for each Maven request, including metadata requests. Have you considered caching the access token and an expiration timestamp, say in a system property (one access per 'mvn' process)?