appengine-maven-plugin icon indicating copy to clipboard operation
appengine-maven-plugin copied to clipboard

Store email and password in ~/.m2/Settings.xml

Open GoogleCodeExporter opened this issue 9 years ago • 19 comments

Is it possible to store the email and password in ~/.m2/settings.xml for use 
with automated deployments?

If this or is not possible, would it be possible to add this to the wiki?

Nice job and thanks,
Brandon Donnelson




Original issue reported on code.google.com by [email protected] on 26 Jan 2013 at 6:54

GoogleCodeExporter avatar Aug 25 '15 18:08 GoogleCodeExporter

Original comment by [email protected] on 19 Feb 2013 at 6:44

  • Changed state: Accepted

GoogleCodeExporter avatar Aug 25 '15 18:08 GoogleCodeExporter

There are some ways to do this, I'll see about putting some docs together.

Original comment by [email protected] on 19 Feb 2013 at 6:48

  • Added labels: Type-Enhancement
  • Removed labels: Type-Defect

GoogleCodeExporter avatar Aug 25 '15 18:08 GoogleCodeExporter

using --oauth2 with the first appcfg update would be much better, no?

Original comment by [email protected] on 11 Apr 2013 at 3:57

GoogleCodeExporter avatar Aug 25 '15 18:08 GoogleCodeExporter

The main use case for this is automated deploys from ci build slaves...
where would we pass in/store the tokens?

Original comment by [email protected] on 11 Apr 2013 at 5:57

GoogleCodeExporter avatar Aug 25 '15 18:08 GoogleCodeExporter

Hey Matt,

"There are some ways to do this"
Can you name a few ways to do this or provide some pointers? Of course I want 
to use this with our CI server. Without this feature I cannot use the plugin.

Thanks,
Ingo

Original comment by [email protected] on 17 Apr 2013 at 1:07

GoogleCodeExporter avatar Aug 25 '15 18:08 GoogleCodeExporter

One good way to store credentials would be to use Maven server password 
encryption:

http://maven.apache.org/guides/mini/guide-encryption.html

That said, I'm really confused about the current behavior. I turned off OAuth2 
by including

<appengine.oauth2>false</appengine.oauth2>

in my pom.xml file. However, I was completely surprised when I ran "mvn 
appengine:update" and it WORKED without prompting for any email or password! 
Where in the world is it getting credentials to update my app?

Original comment by [email protected] on 21 Apr 2013 at 5:33

GoogleCodeExporter avatar Aug 25 '15 18:08 GoogleCodeExporter

OK, found it: a cookie stored in ~/.java/.userPrefs. Sorry for the digression.

Original comment by [email protected] on 21 Apr 2013 at 6:42

GoogleCodeExporter avatar Aug 25 '15 18:08 GoogleCodeExporter

Hi,

I am having the same problem of not knowing how to use the plugin on my CI 
server.

I don't have access to the CI server to plant an oauth token on the users 
folder.

Matt, did you find the time yet to write those docs? ;)

Thanks

Original comment by [email protected] on 12 Jun 2013 at 12:20

GoogleCodeExporter avatar Aug 25 '15 18:08 GoogleCodeExporter

Maven has a <server> declaration that is perfect for this. One can define their 
credentials in settings.xml and the plugin just needs to know the id of the 
server to pull the username and password.

Original comment by [email protected] on 3 Oct 2013 at 10:19

GoogleCodeExporter avatar Aug 25 '15 18:08 GoogleCodeExporter

How do you specify which <server> to pick form the settings.xml?

Original comment by [email protected] on 17 Oct 2013 at 7:48

GoogleCodeExporter avatar Aug 25 '15 18:08 GoogleCodeExporter

In the old maven-gae-plugin, there was a server configuration parameter that 
specified this, defaulting to "appengine.google.com"


Original comment by [email protected] on 17 Oct 2013 at 8:10

GoogleCodeExporter avatar Aug 25 '15 18:08 GoogleCodeExporter

I managed to work around this issue using this config:

<plugin>
  <groupId>com.google.appengine</groupId>
  <artifactId>appengine-maven-plugin</artifactId>
  <version>1.8.6</version>
  <configuration>
    <email>[email protected]</email>
    <oauth2>false</oauth2>
    <noCookies>true</noCookies>
    <passin>true</passin>
  </configuration>
</plugin>

and by invoking the update goal like this:

mvn clean appengine:update <<< "yourPassW00rd"

Original comment by [email protected] on 18 Oct 2013 at 5:42

GoogleCodeExporter avatar Aug 25 '15 18:08 GoogleCodeExporter

The problem is that your password is in clear in the command line in your CI 
server. Not really nice in terms of security.

Original comment by [email protected] on 22 May 2014 at 3:57

GoogleCodeExporter avatar Aug 25 '15 18:08 GoogleCodeExporter

Yes I totally agree with you. Picking the credentials from the <server> in 
Maven's settings.xml would be a much cleaner solution. 

Original comment by [email protected] on 22 May 2014 at 4:03

GoogleCodeExporter avatar Aug 25 '15 18:08 GoogleCodeExporter

i tried to use this command: mvn clean appengine:update <<< "yourPassW00rd"... 
but how do i do it? The Travis-ci console keeps saying my email and password do 
not match.

I though it was just substituting yourPassW00rd with my google app engine 
password.

Original comment by [email protected] on 28 May 2014 at 11:01

GoogleCodeExporter avatar Aug 25 '15 18:08 GoogleCodeExporter

@simon - this does not work in Jenkins. Not the standard way at least.

We need this...

Original comment by [email protected] on 8 Oct 2014 at 6:43

GoogleCodeExporter avatar Aug 25 '15 18:08 GoogleCodeExporter

I forked the project and merged in the settings.xml authentication from the old 
kindleit plugin.

https://github.com/rdwallis/appengine-maven-plugin

Needs some codestyle attention but otherwise works well.

No idea how to issue a PR to this project though.  Are there contribution 
guidelines anywhere?

Original comment by [email protected] on 22 Nov 2014 at 4:28

GoogleCodeExporter avatar Aug 25 '15 18:08 GoogleCodeExporter

'+'1000! You rock!

Original comment by [email protected] on 22 Nov 2014 at 4:29

GoogleCodeExporter avatar Aug 25 '15 18:08 GoogleCodeExporter

It's an old ticket, but since it is still open: ClientLogin has been deprecated and removed in April, so Simon's approach does not work anymore. Related configuration options (email, oauth2, noCookies, passin in appengine-maven-plugin and corresponding command line arguments in appcfg.sh) are still around but seem useless. So storing email and password in settings.xml does not look feasible anymore.

It would be good however to document the recommended approach for headless CI servers, e.g. how to setup them to use OAuth2 with a service account.

sparhomenko avatar Jul 03 '16 11:07 sparhomenko