faresd / appengine-maven-plugin

Automatically exported from code.google.com/p/appengine-maven-plugin
Apache License 2.0
0 stars 0 forks source link

proxyHost and proxyHttps options do not work. #46

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Using the following configuration options:
<proxyHost>proxy.xxx.com:80</proxyHost> 

produces the following output:

...
[INFO] Retrieving Google App Engine Java SDK from Maven
[INFO] Updating Google App Engine Application
Bad argument: Unknown option: --proxy
usage: AppCfg [options] <action> [<app-dir>] [<argument>]
...

same thing with proxyHttps, which produces:
Bad argument: Unknown option: --proxy_https

Both error messages look weird as later in the output both --proxy and 
--proxy_https are listed as acceptable options.

I get this error launching maven both from the command line and from within 
eclipse.

I tried setting jvm arguments to force the use of a proxy, but it seems that 
appcfg is launched in an separate jvm than the one running maven and I couldn't 
find a way to pass jvm options as for many plugins with a similar design.

Bottom line I didn't find a way to use the plugin from behind my corporate 
proxy.

Also as a separate note I didn't find any page with detailed documentation on 
the options available for this plugin.
These pages:
https://developers.google.com/appengine/docs/java/tools/maven
https://code.google.com/p/appengine-maven-plugin/

are good for a start but incomplete.

Thanks
Raffaele

Original issue reported on code.google.com by raffaele...@gmail.com on 6 Dec 2013 at 3:11

GoogleCodeExporter commented 8 years ago
Hi,

I downloaded the plugin and had a look at the code. I think I found a bug in 
how the proxy parameters were managed.
Here is my proposed patch:

diff --git a/src/main/java/com/google/appengine/appcfg/AbstractAppCfgMojo.java 
b/src/main/java/com/google/appengine/appcfg/AbstractAppCfgMojo.java
index 6793085..f6c3148 100644
--- a/src/main/java/com/google/appengine/appcfg/AbstractAppCfgMojo.java
+++ b/src/main/java/com/google/appengine/appcfg/AbstractAppCfgMojo.java
@@ -236,6 +236,8 @@

     arguments.add(action);
     arguments.add(appDir);
+    
+    getLog().debug("passing arguments: " + arguments.toString());

     try {
       AppCfg.main(arguments.toArray(new String[arguments.size()]));
@@ -280,13 +282,12 @@
     }

     if (proxyHost != null && !proxyHost.isEmpty()) {
-      arguments.add("--proxy");
+      arguments.add("-p");
       arguments.add(proxyHost);
     }

     if (proxyHttps != null && !proxyHttps.isEmpty()) {
-      arguments.add("--proxy_https");
-      arguments.add(proxyHttps);
+      arguments.add("--proxy_https="+proxyHttps);
     }

     if (noCookies) {

Original comment by raffaele...@gmail.com on 6 Dec 2013 at 7:48

GoogleCodeExporter commented 8 years ago
I need this fix as well. The workaround that I used is to pass the proxy 
settings on the maven command line:

mvn -DproxySet=true -DproxyHost=proxy.example.com -DproxyPort=8080 ...

But I definitely want the fix and not my band-aid. Ideally it would be nice if 
this could use the maven proxy settings in my settings.xml. 

Original comment by bruce.br...@gmail.com on 19 Dec 2013 at 9:39

GoogleCodeExporter commented 8 years ago
This bug applies to all parameters which expect an equal sign between the 
parameter name and its value. So in the current version this bug should affect 
parameters proxy, proxy_https, jar_splitting_excludes, num_days, severity e 
num_runs.

I also need this fix. 

Original comment by leonardo...@gmail.com on 14 May 2014 at 5:35

GoogleCodeExporter commented 8 years ago
Fix will be in 1.9.7
For now, you can 
$ git clone https://code.google.com/p/appengine-maven-plugin/
$ cd appengine-maven-plugin
$ mvn install

and use the version 1.9.7-SNAPSHOT in the plugin version as a workaround until 
1.9.7 is pushed

Original comment by l...@google.com on 14 Jun 2014 at 4:58

GoogleCodeExporter commented 8 years ago

Original comment by l...@google.com on 14 Jun 2014 at 4:58