Coursera Apigee API Development 1 - why use maven to deploy proxies?

Trying to learn how to use apigee, and going through this course. I guess I am not used to using maven on anything Node.js related (previous company I worked for was all gitlab runner based ci/cd), so I was surprised to see this in the code the class has you execute:

/*
Executes the maven deployment plugin twice:
1) creates the target serve, deploys the proxy.
2) creates the Apigee product, apps, and developer
*/
function deployProxyAndDependencies(proxyDir, options){
  const mvn = require('maven').create({
        cwd: proxyDir,
        profiles: [options.env],
        debug: false
      });

  var mvnArgs = {
    'username': options.username,
    'password': options.password,
    'org': options.org,
    'https.protocols' : 'TLSv1.2',
    'options': 'update',
    'apigee.config.options': 'update'
  };
  mvn.execute(['clean', 'install'], mvnArgs).then(() => {
    console.log(proxyDir+ ' successfully configured!');
  });
}

'options' references a json file that looks like the config for the proxies.

So my question is why is maven used here? I am guessing this creates the api proxies that you will use. I would think that I would just hit an API inside apigee to do the same thing.

Can anyone explain why they think this was done and is it better/different then just making http requests to do the same thing (if that can even be done)?

I used maven in a previous life for Java development/builds etc it just seems a little excessive for this process. I am probably wrong, that's why I figured I would ask. 🙂

Thank you,

Ryan

0 0 161
0 REPLIES 0