Read from multiple repos - Apigee Maven proxy dependency Plugin

Does Apigee Maven proxy dependency plugin require the common folder where the flow fragments and policies are defined, to be in the same folder/repo as the API proxy code?

I am using the proxy dependency plugin for the following usecase

I have the common policies and flow defined in a separate repo called "common" - this is to support reuse of steps and policies across proxies

I have the api proxy code in a separate repo "apiproxy1"

I have a pipeline where I am trying to build and deploy the API proxy bundle with the following steps:

apigee-deployment-pipeline.jpg

Is there a way to configure the apigee proxy dependency maven plugin to read from the common repo while the "resolve" goal is invoked?

If the name of the proxyEndpoint and targetEndpoints is not "default" will the dependency plugin be able to resolve the flow fragment steps in the api proxy code? This post - from Anil Sagar indicates that the plugin expects "default" target endpoint. Is there a way to override this?

@Dino-at-Google - any pointers or info for this?

0 2 235
2 REPLIES 2

rmishra
Participant V

While Maven Proxy Dependency Plugin might require that the flow fragments and policies are in the same repo, you do not have to define those artifacts in the same repo.

You can configure Maven Dependency Plugin (https://maven.apache.org/plugins/maven-dependency-plugin/get-mojo.html) to fetch artifacts and unpack it into your current repo BEFORE the maven proxy dependency plugin executes. This assumes two things:

1. Your flow fragments/common policies are uploaded in a maven repository

2. The Maven Dependency GET executes BEFORE Maven Proxy Dependency plugin kicks in. Typically you do this by binding the Maven Dependency Plugin to an earlier phase of the Maven Lifecycle (Pre Package,etc.)

I had implemented this before shared flows were introduced, works like a charm.

If you run into issues while implementing this, run Maven goals in Verbose mode and notice the changes to your workspace (unpack, proxy dependency resolution, packaging, installation, deployment)..Following them closely will tell you where your configuration is going wrong..

Personally, i can never make it work the first time 🙂

Good Luck

@Rahul M Thank you for the detailed inputs. Now that I got some idea on what needs to be done, I will probably try to check if I can

1. configure my build pipeline to checkout from both repos

2. prepare the folder structure as required by the proxy dependency plugin

3. Execute the proxy dependency plugin to resolve the flow fragments and the policies