Skip to content

Commit 8c7d4bd

Browse files
Merge pull request #181 from apigee/Issue178
Proxy settings
2 parents 31bea57 + c72ad7b commit 8c7d4bd

File tree

17 files changed

+477
-78
lines changed

17 files changed

+477
-78
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ Learn more, check out this video! [Ask the Expert](https://www.youtube.com/watch
3838
- [pom.xml Sample](#pom-xml-sample)
3939
- [Config.json Sample](#config-json-sample)
4040
- [Commands](#commands-for-deploying-the-proxy-using-maven)
41+
- [To configure a proxy](#to-configure-a-proxy)
4142

4243
# Prerequisites
4344
You will need the following to run the samples:
@@ -296,6 +297,11 @@ The [samples](./samples/security-sharedflow/src/sharedflows) has an example of a
296297

297298
This is required to differentiate the build and deployment process.
298299

300+
## To configure a proxy
301+
Supported from v2.3.0
302+
303+
Please refer to this [doc](http://maven.apache.org/guides/mini/guide-proxies.html) that explains how to setup proxy settings in your settings.xml usually in your $HOME/.m2 directory. Only `https` protocol is supported
304+
299305
------------------------------------------
300306
Recommended Convention for Contributions
301307
------------------------------------------

pom.xml

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<packaging>maven-plugin</packaging>
2020
<!-- This is inherited from <version>0.0.15</version> of the the non-opensource
2121
plugin -->
22-
<version>2.2.3-SNAPSHOT</version>
22+
<version>2.3.0-SNAPSHOT</version>
2323
<name>apigee-edge-maven-plugin maven mojo</name>
2424
<url>http://maven.apache.org</url>
2525

@@ -67,9 +67,11 @@
6767
<maven.compiler.source>1.8</maven.compiler.source>
6868
<maven.compiler.target>1.8</maven.compiler.target>
6969
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
70-
<spring.version>4.3.20.RELEASE</spring.version>
71-
<spring.security.version>4.2.9.RELEASE</spring.security.version>
70+
<spring.version>5.3.15</spring.version>
71+
<spring.security.version>5.6.1</spring.security.version>
7272
<log4j.version>2.17.1</log4j.version>
73+
<maven.version>3.1.0</maven.version>
74+
<maven.api.version>3.5</maven.api.version>
7375
</properties>
7476
<!-- mgmt-api-java-sdk -->
7577

@@ -135,6 +137,23 @@
135137
<artifactId>maven-plugin-api</artifactId>
136138
<version>2.0</version>
137139
</dependency>
140+
<dependency>
141+
<groupId>org.apache.maven</groupId>
142+
<artifactId>maven-plugin-api</artifactId>
143+
<version>${maven.version}</version>
144+
</dependency>
145+
<dependency>
146+
<groupId>org.apache.maven</groupId>
147+
<artifactId>maven-core</artifactId>
148+
<version>${maven.version}</version>
149+
<scope>provided</scope>
150+
</dependency>
151+
<dependency>
152+
<groupId>org.apache.maven.plugin-tools</groupId>
153+
<artifactId>maven-plugin-annotations</artifactId>
154+
<version>${maven.api.version}</version>
155+
<scope>provided</scope>
156+
</dependency>
138157

139158
<!-- using google http client for http rest protocols. supposed to be better
140159
than all -->

samples/mockapi-recommended/src/gateway/shared-pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
<plugin>
7474
<groupId>io.apigee.build-tools.enterprise4g</groupId>
7575
<artifactId>apigee-edge-maven-plugin</artifactId>
76-
<version>2.2.1</version>
76+
<version>2.3.0</version>
7777
<executions>
7878
<execution>
7979
<id>configure-bundle</id>
@@ -104,7 +104,7 @@
104104
<apigee.org>${org}</apigee.org>
105105
<apigee.env>${env}</apigee.env>
106106
<apigee.authtype>oauth</apigee.authtype> <!-- only option -->
107-
<apigee.bearer>${bearer}</apigee.bearer> <!-- this takes precedence over service account file -->
107+
<apigee.bearer>${bearer}</apigee.bearer> <!-- this takes precedence over service account file -->
108108
<apigee.serviceaccount.file>${file}</apigee.serviceaccount.file>
109109
<apigee.options>override</apigee.options> <!-- override is default. Other options are async|clean-->
110110
<apigee.googletoken.email>${googleTokenEmail}</apigee.googletoken.email> <!-- Available in Apigee X and Apigee hybrid 1.6 + -->

samples/security-sharedflow/src/sharedflows/parent-sharedflow-pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
<plugin>
7474
<groupId>io.apigee.build-tools.enterprise4g</groupId>
7575
<artifactId>apigee-edge-maven-plugin</artifactId>
76-
<version>2.2.1</version>
76+
<version>2.3.0</version>
7777
<executions>
7878
<execution>
7979
<id>configure-bundle</id>

src/main/java/io/apigee/buildTools/enterprise4g/mavenplugin/DeployMojo.java

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,8 @@ protected void doImport() throws IOException, MojoFailureException,Exception {
146146

147147
logger.info("\n\n=============Importing App================\n\n");
148148
state = State.IMPORTING;
149-
bundleRevision = RestUtil.uploadBundle(super.getProfile(), super.getApplicationBundlePath());
149+
RestUtil restUtil = new RestUtil(super.getProfile());
150+
bundleRevision = restUtil.uploadBundle(super.getProfile(), super.getApplicationBundlePath());
150151

151152

152153
} catch (IOException e) {
@@ -165,7 +166,8 @@ protected void doUpdate(String revision) throws IOException, MojoFailureExceptio
165166

166167
logger.info("\n\n=============Updating App================\n\n");
167168
state = State.IMPORTING;
168-
bundleRevision = RestUtil.updateBundle(super.getProfile(), super.getApplicationBundlePath(),revision);
169+
RestUtil restUtil = new RestUtil(super.getProfile());
170+
bundleRevision = restUtil.updateBundle(super.getProfile(), super.getApplicationBundlePath(),revision);
169171

170172
} catch (IOException e) {
171173
throw e;
@@ -185,7 +187,8 @@ public void doDeactivae() throws IOException, MojoFailureException,Exception {
185187
try {
186188
logger.info("\n\n=============Deactivating App================\n\n");
187189
state = State.DEACTIVATING;
188-
RestUtil.deactivateBundle(super.getProfile());
190+
RestUtil restUtil = new RestUtil(super.getProfile());
191+
restUtil.deactivateBundle(super.getProfile());
189192
}
190193
catch (IOException e) {
191194
throw e ;
@@ -204,7 +207,8 @@ public void doRefreshBundle() throws IOException, MojoFailureException{
204207
try {
205208
logger.info("\n\n=============Refresh Bundle================\n\n");
206209
state = State.ACTIVATING;
207-
RestUtil.refreshBundle(super.getProfile(), this.bundleRevision);
210+
RestUtil restUtil = new RestUtil(super.getProfile());
211+
restUtil.refreshBundle(super.getProfile(), this.bundleRevision);
208212
} catch (IOException e) {
209213
throw e ;
210214
} catch (RuntimeException e) {
@@ -222,7 +226,8 @@ public void doActivateBundle() throws IOException, MojoFailureException, Interr
222226
try {
223227
logger.info("\n\n=============Activating Bundle================\n\n");
224228
state = State.ACTIVATING;
225-
String revision = RestUtil.activateBundleRevision(super.getProfile(), this.bundleRevision);
229+
RestUtil restUtil = new RestUtil(super.getProfile());
230+
String revision = restUtil.activateBundleRevision(super.getProfile(), this.bundleRevision);
226231

227232
// if user passed -Dapigee.options=async, no need for polling, exit early
228233
if (Options.async) {
@@ -232,7 +237,7 @@ public void doActivateBundle() throws IOException, MojoFailureException, Interr
232237
boolean deployed = false;
233238
//Loop to check the deployment status
234239
for (; !deployed; ) {
235-
deployed = RestUtil.getDeploymentStateForRevision(super.getProfile(), revision);
240+
deployed = restUtil.getDeploymentStateForRevision(super.getProfile(), revision);
236241
Thread.sleep(5*1000);
237242
}
238243
} catch (IOException e) {
@@ -249,14 +254,15 @@ public void doActivateBundle() throws IOException, MojoFailureException, Interr
249254

250255
public void doDelete() throws IOException, MojoFailureException,Exception {
251256
try {
252-
String status = RestUtil.deactivateBundle(this.getProfile());
257+
RestUtil restUtil = new RestUtil(this.getProfile());
258+
String status = restUtil.deactivateBundle(this.getProfile());
253259
if(status == null) {
254260
logger.info("No bundle to delete");
255261
return;
256262
}
257263
logger.info("\n\n=============Deleting bundle================\n\n");
258264
state = State.DELETING;
259-
RestUtil.deleteBundle(this.getProfile());
265+
restUtil.deleteBundle(this.getProfile());
260266
} catch (IOException e) {
261267
throw e ;
262268
} catch (RuntimeException e) {

0 commit comments

Comments
 (0)