Closed simantstha closed 2 years ago
You are using the wrong version if you are using Apigee X or hybrid. The version for Apigee X or hybrid is 2.x Please follow the README
I did change the version but still getting the same problem. Also does it work on apigeex which is on apigee.google.com. As, apigee does not offer the old trial version. if it does work then what should be the organization for that.
The error message clearly states the issue - "Service Account file or bearer token missing"
Yes the version 2.x works with Apigee X. If you login to your Apigee setup (apigee.google.com), it will show you the org name on the top.
For the issue you saw, you will need to setup a service account in GCP IAM with Apigee Organization Admin role, download the JSON Key and then pass the path of the file in the plugin.
Or else.. install gcloud SDK on your laptop and then run gcloud auth login
from your terminal. Once logged in, you can generate the token on your terminal using gcloud auth print-access-token
and then pass that to the plugin with the -Dbearer=$token
argument
I did install gcloud sdk and was able to generate token. but i was not sure what was the full command to execute -Dbearer=$token
just run your mvn command and for the bearer argument just run -Dbearer=$(gcloud auth print-access-token)
I got this after i did previous step
@simantstha - The error is very clear. It says the environment is not found which means you have a different name for your Apigee environment but the Maven configuration is using "test" I would appreciate you investigate a little deeper before reaching out
Sorry for this was i was meaning to post this. Also is it possible to make proxy using a yaml file?
Can you share the pom.xml and shared-pom.xml you are using? You need to update the config to point to your Apigee instance. Also can you share the Apigee org and env details so that I can help you?
No - this plugin does not support yaml
Org: testdrupal2022 Env: eval POM.XML
Shared POM
<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">
<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>https://repo1.maven.org/maven2</url>
<layout>default</layout>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<updatePolicy>never</updatePolicy>
</releases>
</pluginRepository>
</pluginRepositories>
<properties>
<main.basedir>${project.basedir}</main.basedir>
</properties>
<build>
<plugins>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>2.5</version>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<overwrite>true</overwrite>
<encoding>UTF-8</encoding>
<echo message="basedir parent : ${basedir}"/>
<outputDirectory>${basedir}/target/apiproxy</outputDirectory>
<resources>
<resource>
<directory>apiproxy</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>io.apigee.build-tools.enterprise4g</groupId>
<artifactId>apigee-edge-maven-plugin</artifactId>
<version>2.3.1</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>
I think you have the wrong pom pasted here
Follow these steps
1) Download this repo - https://github.com/apigee/apigee-deploy-maven-plugin/archive/refs/heads/hybrid.zip
2) Navigate to the samples/mockapi-recommended/src/gateway/Mock-v1
directory in your terminal
3) Execute the following command in your terminal mvn clean install -Ptest -Dorg=testdrupal2022 -Denv=eval -Dbearer=$(gcloud auth print-access-token)
4) Once the above executes successfully, you should see a Mock-v1
proxy deployed to Apigee. Check in the Apigee console.
5) Now using this template, you can deploy other Apigee proxies
It has now throwing me 401 unauthorized access. Last time it did not. Can you see if i am doing initial steps right.
You have a $ sign in the front of the token
Either remove that or else use -Dbearer=$(gcloud auth print-access-token)
It worked thank you so much.