Getting started with apigee maven plugin proxies and targets for node swagger project

Not applicable

I am trying to use the apigee-deploy-maven-plugin for swagger node project and facing difficulty in understanding the xml that are generated in proxies and targets folder.

As I see in the samples, there are xmls under proxies and target folder.

So, I have an swagger node project, then are the xml under proxies and target folder generated as part of build process of the apigee maven plugin using swagger.yaml of our swagger node project?

if not, how can they be auto generated?

Please help.

0 5 632
5 REPLIES 5

Hey @Mohit GUpta - Welcome to the community !!!

Any proxy that is being deployed into Edge needs to have a particular folder structure. And as part of that defined structure, you see the proxies, policies, targets directories.

The Maven deploy plugin is only used to package this for you and deploy them (through configurations). As part of the deployment, it has some options you can use like override, update, etc that is documented here

The samples that we have on the Github are non-node proxies. This brings a good idea to include a Node sample as well. Will work on it.

What you could do is - if you have the node proxy deployed in Edge successfully, just download the proxy bundle using the UI. This automatically will have the Node code and the other directories created. Just include the pom.xml from the samples and then make some basic changes like the profiles and the artifact info. Once this is done, run the maven command from your machine and see if it deployed

Let me know if you have any questions.

Thank you for the reply. We wanted to avoid creation of proxy through console and wanted to have it generated using swagger yaml and are looking to leverage the same with maven plugin.

Let me know if its possible to have the xml generated through swagger yaml with maven plugin.

Hi @Mohit GUpta - There are plugins written that can create a proxy for a given YAML file, but that will just create the skeleton of the proxy. I assume that is not what you want. Would be nice if you could explain your entire case - what is the YAML used for, how is the proxy being created (Node or non-node proxies), how are the policies being added, etc etc ? With those information, I would be able to get an idea and help with some solution

Hi @Sai Saran Vaidyanathan - We have Swagger files for all our API's, We are trying to generate Skeleton folders for all these API's and then copy the standard policies to these folders. Do you know if there is any maven plugin that does that?



you can use the openapi2apigee npm within the maven build and generate the Apigee proxy structure and continue with your build by copying your policies and code to the generated directory within your pom