Apigee deploy shared flows using maven plugin

Hi,

I want to deploy my proxies and sharedflows using the maven plugin. For the proxies it already works following the instructions on github (https://github.com/apigee/apigee-deploy-maven-plugin#step-1-create-a-maven-compatible-file-structure) and after recognizing that the maven plugin expects the zip file to be in the target folder (what is not mentioned there?)

However I did not manage to get my sharedflows uploaded yet. Is there also a folder structure required that differs from the one described in the link

https://github.com/apigee/apigee-deploy-maven-plugin#building-shared-flow-bundles

is also an additional target folder/ zipping required?

Thx in advance!

Solved Solved
0 7 2,522
1 ACCEPTED SOLUTION

HI @maria thanner

In your pom

<plugin>
    <groupId>io.apigee.build-tools.enterprise4g</groupId>
    <artifactId>apigee-edge-maven-plugin</artifactId>
    <version>1.1.6</version>
    <executions>
        <execution>
            <id>configure-bundle</id>
            <phase>package</phase>
            <goals>
                <goal>configure</goal>
            </goals>
        </execution>
        <execution>
            <id>deploy-bundle</id>
            <phase>install</phase>
            <goals>
                <goal>deploy</goal>
            </goals>
        </execution>
    </executions>
</plugin>

the configure goal within the execution will create the zip in the target folder and the deploy goal below will deploy it to Apigee. The same will work for shared flow. The only difference between proxy and sharedflow is that for a sharedflow, you need to provide the below property in the Maven profile you call through the maven command

<apigee.apitype>sharedflow</apigee.apitype>

View solution in original post

7 REPLIES 7

HI @maria thanner

In your pom

<plugin>
    <groupId>io.apigee.build-tools.enterprise4g</groupId>
    <artifactId>apigee-edge-maven-plugin</artifactId>
    <version>1.1.6</version>
    <executions>
        <execution>
            <id>configure-bundle</id>
            <phase>package</phase>
            <goals>
                <goal>configure</goal>
            </goals>
        </execution>
        <execution>
            <id>deploy-bundle</id>
            <phase>install</phase>
            <goals>
                <goal>deploy</goal>
            </goals>
        </execution>
    </executions>
</plugin>

the configure goal within the execution will create the zip in the target folder and the deploy goal below will deploy it to Apigee. The same will work for shared flow. The only difference between proxy and sharedflow is that for a sharedflow, you need to provide the below property in the Maven profile you call through the maven command

<apigee.apitype>sharedflow</apigee.apitype>

Hi @Sai Saran Vaidyanathan,

and thx for you provided answer! That's also how I configured my shared-pom.xml.. however when execution it only uploads the proxy when I already created a target directory with the zipped apiproxy+version number.. the error it says when I try upload the unzipped (original directory) is a deploy goal execution failure saying the following:

"code" : "messaging.config.beans.InvalidBundle",
[ERROR] "message" : "Bundle is invalid. Empty bundle",

..

probably this is also the reason why I don't get my unzipped sharedflows deployed.. do you have any suggestions/ ideas what still could be wrong configured? Here is also my shared-pom-xml:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>

<groupId>apigee</groupId>

<artifactId>parent-pom</artifactId>

<packaging>pom</packaging>

<version>1.0</version>

<pluginRepositories>

<pluginRepository>

<id>central</id>

<name>Maven Plugin Repository</name>

<url> http://repo1.maven.org/maven2 </url>

<layout>default</layout>

<snapshots>

<enabled>false</enabled>

</snapshots>

<releases>

<updatePolicy>never</updatePolicy>

</releases>

</pluginRepository>

</pluginRepositories>

<properties>

</properties>

<build>

<plugins>

<plugin>

<groupId>io.apigee.build-tools.enterprise4g</groupId>

<artifactId>apigee-edge-maven-plugin</artifactId>

<version>1.1.6</version>

<executions>

<execution>

<id>configure-bundle</id>

<phase>package</phase>

<goals>

<goal>configure</goal>

</goals>

</execution>

<execution>

<id>deploy-bundle</id>

<phase>install</phase>

<goals>

<goal>deploy</goal>

</goals>

</execution>

</executions>

</plugin>

</plugins>

</build>

<!-- This is where you add the environment specific properties under various profile names -->

<profiles>

...........

.</profiles>

</project>


@maria thanner - can you try the samples provided and see if that works ? If yes, then you can reuse the same pom for your sharedflow

thx. sample works ( sharedflows also now, since I didn't do the install step twice)

(however still have to figure out why I get an

[ERROR] Failed to execute goal io.apigee.build-tools.enterprise4g:apigee-edge-maven-plugin:1.1.6:configure (configure-bundle) on project forecastweatherapi: Index 0 out-of-bounds for length 0 -> [Help 1]

when copying the folder to my own proxy folder and doing the execution step..)

Hi, am getting that same error, i tried to place the zipped apiproxy folder within the targets folder of apiproxy. Is this right or should I place it somewhere else? Could you please elaborate on what needs to be done?

You would need to follow below steps apart from apiproxy deployment

  • Bundle folder should be named "sharedflowbundle" instead of 'apiproxy'
  • Flows folder should be named "sharedflows" instead of 'proxies'
  • Add "<apigee.apitype>sharedflow</apigee.apitype>" property in parent pom.xml

You can try out the example from https://github.com/apigee/apigee-deploy-maven-plugin/tree/master/samples/security-sharedflow/src/sha...

Read more at: https://github.com/apigee/apigee-deploy-maven-plugin#building-shared-flow-bundles

Hi @Sai Saran Vaidyanathan

package generates the artifact in output directory with artifactid-null or if we are giving profile id it is getting generate with artificatid-profileid .How can we only generate with only artifactid?

Also is there a way to deploy only single proxy . lets say mvn package I have two proxy as module and mvn package generates two bundle but while deploying can we add additional parameter to deploy only specific proxy.

Thanks,

Patty