Apigee X - maven config multi-file skipping Target Servers

Hello, 

I'm currently developing a script for our CICD pipeline to deploy the targetServers.json file to an environment, but when I run the maven command the output says it was skipped and I haven't been able to figure out why it is skipping the step. 

Here is the folder structure. 

AMetelski_0-1659406151429.png

pom.xml

<?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">
	<parent>
		<groupId>apigee</groupId>
		<artifactId>parent-pom</artifactId>
		<version>1.0</version>
		<relativePath>shared-pom.xml</relativePath>
	</parent>
	<modelVersion>4.0.0</modelVersion>
	<groupId>Apigee</groupId>
	<artifactId>ConfigOnly</artifactId>
	<version>1.0</version>
	<name>ConfigOnly</name>
	<packaging>pom</packaging>
</project>

 shared-pom.xml

<?xml version="1.0" ?>
<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>https://repo1.maven.org/maven2</url>
            <layout>default</layout>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <releases>
                <updatePolicy>never</updatePolicy>
            </releases>
        </pluginRepository>
    </pluginRepositories>
    <!-- Since Maven 3.0.3, for two plugins bound to the same phase, the order 
         of execution is the same as the order in which you define them. -->
    <build>
        <plugins>
            <plugin>
                <groupId>com.apigee.edge.config</groupId>
                <artifactId>apigee-config-maven-plugin</artifactId>
                <version>2.3.0</version>
                <executions>
                    <execution>
                        <id>create-config-targetserver</id>
                        <phase>install</phase>                        
                        <goals>
                            <goal>targetservers</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>create-config-kvm</id>
                        <phase>install</phase>                        
                        <goals>
                            <goal>keyvaluemaps</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>create-config-keystores</id>
                        <phase>install</phase>                        
                        <goals>
                            <goal>keystores</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>create-config-aliases</id>
                        <phase>install</phase>                        
                        <goals>
                            <goal>aliases</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>create-config-references</id>
                        <phase>install</phase>                        
                        <goals>
                            <goal>references</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>create-config-resourcefiles</id>
                        <phase>install</phase>                        
                        <goals>
                            <goal>resourcefiles</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>create-config-apiproduct</id>
                        <phase>install</phase>                        
                        <goals>
                            <goal>apiproducts</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>create-config-developer</id>
                        <phase>install</phase>                        
                        <goals>
                            <goal>developers</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>create-config-app</id>
                        <phase>install</phase>                        
                        <goals>
                            <goal>apps</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>create-config-reports</id>
                        <phase>install</phase>                        
                        <goals>
                            <goal>reports</goal>
                        </goals>
                    </execution>
                    <execution> 
                        <id>create-config-flowhooks</id>
                        <phase>install</phase>
                        <goals>
                            <goal>flowhooks</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>import-app-keys</id>
                        <phase>install</phase>                        
                        <goals>
                            <goal>importKeys</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>            
        </plugins>
    </build>
	<profiles>
		<profile>
			<id>development</id>
			<properties>
				<apigee.profile>development</apigee.profile>
				<apigee.hosturl>https://apigee.googleapis.com</apigee.hosturl>
				<apigee.apiversion>v1</apigee.apiversion>
				<apigee.org>XXXX-MASKED-XXXX</apigee.org>
				<apigee.env>${env}</apigee.env>
				<apigee.authtype>oauth</apigee.authtype>
				<apigee.bearer>${bearer}</apigee.bearer>
				<apigee.options>update</apigee.options>
				<apigee.config.dir>resources/edge</apigee.config.dir>
			</properties>
		</profile>
	</profiles>
    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.8.2</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
</project>
Solved Solved
0 2 272
1 ACCEPTED SOLUTION

After searching in the repository for "Skipping Target Servers (default actions)" I found that my sharepom.xml had an error in the options element. It should have been <apigee.config.options>${options}</apigee.config.options> 

https://github.com/apigee/apigee-config-maven-plugin/blob/7365b980db7a76c1311e297f73548818acea94a8/s... 

View solution in original post

2 REPLIES 2

Here is some of the console output with debug enabled. 

mvn apigee-config:targetservers `
-Pdevelopment `
-Denv=development1 `
-Dbearer=$accessToken `
-X

 

e.config:apigee-config-maven-plugin:2.3.0, parent: sun.misc.Launcher$AppClassLoader@4e25154f]
[DEBUG] Configuring mojo 'com.apigee.edge.config:apigee-config-maven-plugin:2.3.0:targetservers' with basic configurator -->
[DEBUG]   (f) apiVersion = v1
[DEBUG]   (f) artifactId = ConfigOnly
[DEBUG]   (f) authType = oauth
[DEBUG]   (s) baseDirectory = C:\git\apigee\src\ApigeeXConfig
[DEBUG]   (f) bearer = $accessToken
[DEBUG]   (f) buildDirectory = C:\git\apigee\src\ApigeeXConfig\target
[DEBUG]   (f) configDir = resources/edge/
[DEBUG]   (f) deploymentEnv = development1
[DEBUG]   (f) hostURL = https://apigee.googleapis.com
[DEBUG]   (s) id = development
[DEBUG]   (s) ignoreProductsForApp = false
[DEBUG]   (s) kvmOverride = true
[DEBUG]   (f) orgName = XXXX-MASKED-XXX
[DEBUG]   (f) project = MavenProject: Apigee:ConfigOnly:1.0 @ C:\git\apigee\src\ApigeeXConfig\pom.xml
[DEBUG]   (f) projectName = ConfigOnly
[DEBUG]   (f) projectVersion = 1.0
[DEBUG]   (f) session = org.apache.maven.execution.MavenSession@dc7b462
[DEBUG]   (f) settings = org.apache.maven.execution.SettingsAdapter@26a2f7f9
[DEBUG]   (s) skip = false
[DEBUG]   (f) tokenURL = https://login.apigee.com/oauth/token
[DEBUG] -- end configuration --
************************************************************************
Apigee Target Servers
************************************************************************
Skipping Target Servers (default action)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  2.027 s
[INFO] Finished at: 2022-08-01T19:15:43-07:00
[INFO] ------------------------------------------------------------------------

 

After searching in the repository for "Skipping Target Servers (default actions)" I found that my sharepom.xml had an error in the options element. It should have been <apigee.config.options>${options}</apigee.config.options> 

https://github.com/apigee/apigee-config-maven-plugin/blob/7365b980db7a76c1311e297f73548818acea94a8/s...