Error Config file org/apiProducts.json not found

Hi All,

 

<?xml version="1.0" encoding="UTF-8"?>
<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>apigee-test</artifactId>
	<version>v1</version>
	<name>apigee-test</name>
	<packaging>pom</packaging>
	<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>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
		<org.slf4j.simpleLogger.defaultLogLevel>info</org.slf4j.simpleLogger.defaultLogLevel>
		<project.root.dir>${basedir}</project.root.dir>
		<target.root.dir>${basedir}/target</target.root.dir>
		<deployment.suffix>${user.name}</deployment.suffix>
		<commit></commit>
		<branch>a local</branch>
	</properties>

	<!-- This is where you add the environment specific properties under various profile names -->
	<!-- For apigee.options, refer to "Advanced Configuration Options" under https://github.com/apigee/apigee-deploy-maven-plugin#pom-xml-sample -->
	<profiles>
		<profile>
			<id>sandbox-test</id>
			<properties>
				<apigee.profile>sandbox-test</apigee.profile>
				<apigee.env>sandbox-test</apigee.env>
				<apigee.hosturl>https://apigee.googleapis.com</apigee.hosturl>
				<apigee.apiversion>v1</apigee.apiversion>
				<apigee.org>${org}</apigee.org>
				<apigee.options>override</apigee.options> <!-- overrides is default and the only option -->
				<apigee.bearer>${bearer}</apigee.bearer> <!-- this takes precedence over service account file -->
				<apigee.serviceaccount.file>${file}</apigee.serviceaccount.file>
				<apigee.config.dir>./target/resources/edge</apigee.config.dir>
				<apigee.config.options>update</apigee.config.options>
				<api.northbound.domain>${domain}</api.northbound.domain>
				<api.testtag>~@wip,~@mock</api.testtag>
			</properties>
		</profile>
                <profile>
			<id>apigee-test</id>
			<properties>
				<apigee.profile>apigee-test</apigee.profile>
				<apigee.env>apigee-test</apigee.env>
				<apigee.hosturl>https://apigee.googleapis.com</apigee.hosturl>
				<apigee.apiversion>v1</apigee.apiversion>
				<apigee.org>${org}</apigee.org>
				<apigee.options>override</apigee.options> <!-- overrides is default and the only option -->
				<apigee.bearer>${bearer}</apigee.bearer> <!-- this takes precedence over service account file -->
				<apigee.serviceaccount.file>${file}</apigee.serviceaccount.file>
				<apigee.config.dir>./target/resources/edge</apigee.config.dir>
				<apigee.config.options>update</apigee.config.options>
				<api.northbound.domain>${domain}</api.northbound.domain>
				<api.testtag>~@wip,~@mock</api.testtag>
			</properties>
		</profile>
		
	</profiles>

	<build>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>io.apigee.build-tools.enterprise4g</groupId>
					<artifactId>apigee-edge-maven-plugin</artifactId>
					<version>2.3.1</version>
				</plugin>
				<plugin>
					<groupId>com.apigee.edge.config</groupId>
				    <artifactId>apigee-config-maven-plugin</artifactId>
				    <version>2.4.0</version>
			    </plugin>
				<plugin>
					<groupId>com.apigee.smartdocs.config</groupId>
					<artifactId>apigee-smartdocs-maven-plugin</artifactId>
					<version>2.2.3</version>
				</plugin>
			</plugins>
		</pluginManagement>

		<plugins>
			<!-- copy the full apiproxy folder to target folder -->
			<plugin>
				<artifactId>maven-resources-plugin</artifactId>
				<version>2.6</version>
				<executions>
					<execution>
						<id>copy-resources</id>
						<phase>process-resources</phase>
						<goals>
							<goal>copy-resources</goal>
						</goals>
						<configuration>
							<overwrite>true</overwrite>
							<resources>
								<resource>
									<!--source -->
									<directory>${project.root.dir}</directory>
									<filtering>true</filtering>
									<includes>
										<include>apiproxy/**</include>
										<include>test/integration/**</include>
										<include>resources/**</include>
										<include>openapi/**</include>
									</includes>
								</resource>
							</resources>
							<!--target -->
							<outputDirectory>${target.root.dir}</outputDirectory>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>com.google.code.maven-replacer-plugin</groupId>
				<artifactId>replacer</artifactId>
				<version>1.5.2</version>
				<executions>
					<execution>
						<phase>process-resources</phase>
						<goals>
							<goal>replace</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<basedir>${target.root.dir}</basedir>
					<includes>
						<include>openapi/currency-v1.yaml</include>
						<include>apiproxy/proxies/default.xml</include>
						<include>apiproxy/proxies/loggly.xml</include>
						<include>apiproxy/currency-v1.xml</include>
						<include>resources/edge/org/apiproducts.json</include>  <! I removed this path and tried with latest file name>
						<include>test/integration/test-config.json</include>
					</includes>
					<replacements>
						<replacement>
							<token>/currency/v1</token>
							<value>/currency/${deployment.suffix}v1</value>
						</replacement>
						<replacement>
							<token>demo-test.apigee.net</token>
							<value>${api.northbound.domain}</value>
						</replacement>
						<replacement>
							<token>@description</token>
							<value>commit ${commit} from ${branch} branch. Deployed by ${user.name}</value>
						</replacement>
						<replacement>
							<token>env-name</token>
							<value>${apigee.env}</value>
						</replacement>
						<replacement>
							<token>proxy-name</token>
							<value>apigee-single-pom-${deployment.suffix}v1</value>
						</replacement>
					</replacements>
				</configuration>
			</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-step</id>
						<phase>package</phase>
						<goals>
							<goal>configure</goal>
						</goals>
					</execution>
					<!--deploy bundle -->
					<execution>
						<id>deploy-bundle-step</id>
						<phase>install</phase>
						<goals>
							<goal>deploy</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

			<plugin>
			    <groupId>com.apigee.edge.config</groupId>
			    <artifactId>apigee-config-maven-plugin</artifactId>
			    <version>2.4.0</version>
			    <executions>
			    	<execution>
			            <id>create-config-keyvaluemaps</id>
			            <phase>package</phase>                        
			            <goals>
			                <goal>keyvaluemaps</goal>
			            </goals>
			        </execution>
			        <execution>
			            <id>create-config-resourcefiles</id>
			            <phase>package</phase>                        
			            <goals>
			                <goal>resourcefiles</goal>
			            </goals>
			        </execution>
			        <execution>
			            <id>create-config-targetservers</id>
			            <phase>package</phase>                        
			            <goals>
			                <goal>targetservers</goal>
			            </goals>
			        </execution>
			        <execution>
			            <id>create-config-apiproducts</id>
			            <phase>install</phase>                        
			            <goals>
			                <goal>apiproducts</goal>
			            </goals>
			        </execution>
			        <execution>
			            <id>create-config-developers</id>
			            <phase>install</phase>                        
			            <goals>
			                <goal>developers</goal>
			            </goals>
			        </execution>
			        <execution>
			            <id>create-config-apps</id>
			            <phase>install</phase>                        
			            <goals>
			                <goal>apps</goal>
			            </goals>
			        </execution>
			    </executions>
			</plugin> 
			<plugin>
				<groupId>com.apigee.smartdocs.config</groupId>
				<artifactId>apigee-smartdocs-maven-plugin</artifactId>
				<version>2.2.3</version>
				<executions>
					<execution>
						<id>smartdocs-deploy</id>
						<phase>deploy</phase>
						<goals>
							<goal>apidoc</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>

</project>

 

I am trying to create separate apiprodcut.json file for each env for deploying CICD. but while deploying always maven plugin is looking   org/apiProducts.json path. when i am running below command i am getting this error "Config file org/apiProducts.json not found" from command line i pass the file path and folder dir options but no luck, I am tried multiple ways but every time i am getting same error.

 

 

 

mvn apigee-config:apiproducts -P$(APIGEE_PROFILE) -Dorg=$(APIGEE_ORG) -Dfile=$(mySecureFile.secureFilePath) -Dapigee.config.file=dev-apiproducts.json

 

 

 
2022-09-20T00:33:26.3956135Z [INFO] --- apigee-config-maven-plugin:2.4.0:apiproducts (default-cli) @ apigee-test ---
2022-09-20T00:33:27.5742413Z ************************************************************************
2022-09-20T00:33:27.5769036Z Apigee API Product
2022-09-20T00:33:27.5772174Z ************************************************************************
2022-09-20T00:33:27.5779074Z Config file org/apiProducts.json not found.
2022-09-20T00:33:27.5782114Z No API Products found.
2022-09-20T00:33:27.5789783Z [INFO] ------------------------------------------------------------------------
2022-09-20T00:33:27.5793873Z [INFO] BUILD SUCCESS
2022-09-20T00:33:27.5822452Z [INFO] ------------------------------------------------------------------------
2022-09-20T00:33:27.5823159Z [INFO] Total time:  1.360 s
2022-09-20T00:33:27.5823912Z [INFO] Finished at: 2022-09-20T00:33:27apigee-issue.PNG
0 0 108
0 REPLIES 0