apigee / apigee-deploy-maven-plugin

Apache License 2.0
80 stars 169 forks source link

config.json does not substitute empty nodes #45

Closed asnowfix closed 8 years ago

asnowfix commented 8 years ago

Trying to set the OAuth scope dynamically, I am using the following replacement instructions:

        {
            "name": "verify-oauth-v2-access-token.xml",
            "tokens": [{
                "xpath": "/OAuthV2/Scope",
                "value": "urn:hp:api:ems:send_email urn:hp:api:ems:set_template"
            }]
        }

The source XML to substitute is:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<OAuthV2 async="false" continueOnError="false" enabled="true" name="verify-oauth-v2-access-token">
    <DisplayName>Verify OAuth v2.0 Access Token</DisplayName>
    <Operation>VerifyAccessToken</Operation>
    <Scope></Scope>
</OAuthV2>

Substitution works if and only if the original node value is non-empty (eg. <Scope>undefined</Scope>), which it should work with:

  1. No <Scope/> defined in the initial document (DOES NOT WORK)
  2. An empty <Scope/> or <Scope></Scope> defined in the source document (DOES NOT WORK) 3 A non-empty <Scope>something</Scope> defined in the source document (WORKS)
ssvaidyanathan commented 8 years ago

Thanks a lot @asnowfix We will take a look at it and get back once its fixed.

Can you please confirm which version of the plugin are you trying this with ?

asnowfix commented 8 years ago

Looks like:

                <groupId>io.apigee.build-tools.enterprise4g</groupId>
                <artifactId>apigee-edge-maven-plugin</artifactId>
                <version>1.0.2</version>
ssvaidyanathan commented 8 years ago

Thanks for getting back quickly.

Can you please try on 1.0.3 as well as that is the latest version and it had some fixes

asnowfix commented 8 years ago

Just duplicated the problem with 1.0.3.

ssvaidyanathan commented 8 years ago

Thanks once again

Will look into it and let you know once its fixed.

ssvaidyanathan commented 8 years ago

@asnowfix - Have attached a SNAPSHOT of the jar file (zipped as Github doesnt allow jar files to be attached). Can you please unzip and add this to your local maven repo and see if that fixed the issue ?

On your confirmation, will release a new version (with few other fixes). Sending this to you so that you are not blocked.

NOTE: Please update your pom.xml to use 1.0.4-SNAPSHOT

<groupId>io.apigee.build-tools.enterprise4g</groupId>
 <artifactId>apigee-edge-maven-plugin</artifactId>
<version>1.0.4-SNAPSHOT</version>

Place this jar in your appropriate local maven repo as 1.0.4-SNAPSHOT or Rename the attached to apigee-edge-maven-plugin-1.0.3.jar, replace your existing jar with this on your local maven repo apigee-edge-maven-plugin-1.0.4-SNAPSHOT.jar.zip

.

ssvaidyanathan commented 8 years ago

@asnowfix - Did that work as expected ?

asnowfix commented 8 years ago

Did not test yet..

asnowfix commented 8 years ago

I cannot test, but this is likely a Maven issue rather than a Plugin one: Although I un-zipped & installed locally successfully, the plugin cannot run. Any advice on the command-line to run?

Install:

$ mvn install:install-file -Dfile=apigee-edge-maven-plugin-1.0.4-SNAPSHOT.jar.zip -DgroupId=io.apigee.build-tools.enterprise4g -DartifactId=apigee-edge-maven-plugin -Dversion=1.0.4-SNAPSHOT -Dpackaging=jar
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building edgemicro_ems 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-install-plugin:2.3.1:install-file (default-cli) @ apiproxy ---
[INFO] Installing /home/kowalskif/Desktop/GIT/ems/cwp_email_apiproxy/apigee-edge-maven-plugin-1.0.4-SNAPSHOT.jar.zip to /home/kowalskif/.m2/repository/io/apigee/build-tools/enterprise4g/apigee-edge-maven-plugin/1.0.4-SNAPSHOT/apigee-edge-maven-plugin-1.0.4-SNAPSHOT.jar
[INFO] Installing /tmp/mvninstall7740534525140409266.pom to /home/kowalskif/.m2/repository/io/apigee/build-tools/enterprise4g/apigee-edge-maven-plugin/1.0.4-SNAPSHOT/apigee-edge-maven-plugin-1.0.4-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.421s
[INFO] Finished at: Wed Jun 08 11:05:06 CEST 2016
[INFO] Final Memory: 14M/724M
[INFO] ------------------------------------------------------------------------

Target:

$ mvn -e clean process-resources apigee-enterprise:configure -Papigee-env-dev
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[WARNING] Could not transfer metadata org.codehaus.mojo:findbugs-maven-plugin:2.5.3-SNAPSHOT/maven-metadata.xml from/to ccp-central (${ccp.central}): No connector available to access repository ccp-central (${ccp.central}) of type default using the available factories WagonRepositoryConnectorFactory
[WARNING] Failed to retrieve plugin descriptor for io.apigee.build-tools.enterprise4g:apigee-edge-maven-plugin:1.0.4-SNAPSHOT: Plugin io.apigee.build-tools.enterprise4g:apigee-edge-maven-plugin:1.0.4-SNAPSHOT or one of its dependencies could not be resolved: Could not find artifact io.apigee.build-tools.enterprise4g:apigee-edge-maven-plugin:jar:1.0.4-SNAPSHOT
[WARNING] Could not transfer metadata org.apache.maven.plugins/maven-metadata.xml from/to ccp-central (${ccp.central}): No connector available to access repository ccp-central (${ccp.central}) of type default using the available factories WagonRepositoryConnectorFactory
[WARNING] Could not transfer metadata org.codehaus.mojo/maven-metadata.xml from/to ccp-central (${ccp.central}): No connector available to access repository ccp-central (${ccp.central}) of type default using the available factories WagonRepositoryConnectorFactory
[WARNING] Failure to transfer org.apache.maven.plugins/maven-metadata.xml from ${ccp.central} was cached in the local repository, resolution will not be reattempted until the update interval of ccp-central has elapsed or updates are forced. Original error: Could not transfer metadata org.apache.maven.plugins/maven-metadata.xml from/to ccp-central (${ccp.central}): No connector available to access repository ccp-central (${ccp.central}) of type default using the available factories WagonRepositoryConnectorFactory
[WARNING] Failure to transfer org.codehaus.mojo/maven-metadata.xml from ${ccp.central} was cached in the local repository, resolution will not be reattempted until the update interval of ccp-central has elapsed or updates are forced. Original error: Could not transfer metadata org.codehaus.mojo/maven-metadata.xml from/to ccp-central (${ccp.central}): No connector available to access repository ccp-central (${ccp.central}) of type default using the available factories WagonRepositoryConnectorFactory
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-metadata.xml
Downloading: http://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metadata.xml
Downloading: http://nexus.cld.gbl.rd.hpicorp.net:8080/nexus/content/groups/cdo-central/org/apache/maven/plugins/maven-metadata.xml
Downloading: http://nexus.cld.gbl.rd.hpicorp.net:8080/nexus/content/groups/cdo-central/org/codehaus/mojo/maven-metadata.xml
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-metadata.xml (13 KB at 17.3 KB/sec)
Downloaded: http://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metadata.xml (20 KB at 23.2 KB/sec)
Downloaded: http://nexus.cld.gbl.rd.hpicorp.net:8080/nexus/content/groups/cdo-central/org/apache/maven/plugins/maven-metadata.xml (10 KB at 8.8 KB/sec)
Downloaded: http://nexus.cld.gbl.rd.hpicorp.net:8080/nexus/content/groups/cdo-central/org/codehaus/mojo/maven-metadata.xml (23 KB at 17.1 KB/sec)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.197s
[INFO] Finished at: Wed Jun 08 11:08:22 CEST 2016
[INFO] Final Memory: 18M/913M
[INFO] ------------------------------------------------------------------------
[ERROR] No plugin found for prefix 'apigee-enterprise' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (/home/kowalskif/.m2/repository), ccp-central (${ccp.central}), cdo-central (http://nexus.cld.gbl.rd.hpicorp.net:8080/nexus/content/groups/cdo-central/), central (http://repo.maven.apache.org/maven2)] -> [Help 1]
org.apache.maven.plugin.prefix.NoPluginFoundForPrefixException: No plugin found for prefix 'apigee-enterprise' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (/home/kowalskif/.m2/repository), ccp-central (${ccp.central}), cdo-central (http://nexus.cld.gbl.rd.hpicorp.net:8080/nexus/content/groups/cdo-central/), central (http://repo.maven.apache.org/maven2)]
    at org.apache.maven.plugin.prefix.internal.DefaultPluginPrefixResolver.resolve(DefaultPluginPrefixResolver.java:94)
    at org.apache.maven.lifecycle.internal.MojoDescriptorCreator.findPluginForPrefix(MojoDescriptorCreator.java:262)
    at org.apache.maven.lifecycle.internal.MojoDescriptorCreator.getMojoDescriptor(MojoDescriptorCreator.java:222)
    at org.apache.maven.lifecycle.internal.DefaultLifecycleTaskSegmentCalculator.calculateTaskSegments(DefaultLifecycleTaskSegmentCalculator.java:106)
    at org.apache.maven.lifecycle.internal.DefaultLifecycleTaskSegmentCalculator.calculateTaskSegments(DefaultLifecycleTaskSegmentCalculator.java:86)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:98)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[ERROR] 
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/NoPluginFoundForPrefixException
ssvaidyanathan commented 8 years ago

Thanks for the update @asnowfix Looks like you ran the maven install on the zip file directly. (I zipped the jar file as Github was not allowing me to attach the jar file directly.)

Can you please delete the directory --> /home/kowalskif/.m2/repository/io/apigee/build-tools/enterprise4g/apigee-edge-maven-plugin/1.0.4-SNAPSHOT/

Unzip the zip file to get the jar file and run the maven install command again - mvn install:install-file -Dfile=apigee-edge-maven-plugin-1.0.4-SNAPSHOT.jar -DgroupId=io.apigee.build-tools.enterprise4g -DartifactId=apigee-edge-maven-plugin -Dversion=1.0.4-SNAPSHOT -Dpackaging=jar

Once this is successful, please check if the other command works

asnowfix commented 8 years ago

Hello, after deleting the local repository artefacts, the installation command went Ok:

$ mvn install:install-file -Dfile=apigee-edge-maven-plugin-1.0.4-SNAPSHOT.jar -DgroupId=io.apigee.build-tools.enterprise4g -DartifactId=apigee-edge-maven-plugin -Dvers
ion=1.0.4-SNAPSHOT -Dpackaging=jar
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-install-plugin:2.4:install-file (default-cli) @ standalone-pom ---
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/maven-project/2.0.6/maven-project-2.0.6.jar
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-api/2.0.6/maven-plugin-api-2.0.6.jar
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-registry/2.0.6/maven-plugin-registry-2.0.6.jar
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/maven-profile/2.0.6/maven-profile-2.0.6.jar
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/maven-settings/2.0.6/maven-settings-2.0.6.jar
Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/maven-profile/2.0.6/maven-profile-2.0.6.jar (0 B at 0.0 KB/sec)
Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/maven-project/2.0.6/maven-project-2.0.6.jar (0 B at 0.0 KB/sec)
Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-api/2.0.6/maven-plugin-api-2.0.6.jar (0 B at 0.0 KB/sec)
Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/maven-settings/2.0.6/maven-settings-2.0.6.jar (0 B at 0.0 KB/sec)
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/maven-artifact/2.0.6/maven-artifact-2.0.6.jar
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/maven-repository-metadata/2.0.6/maven-repository-metadata-2.0.6.jar
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/maven-artifact-manager/2.0.6/maven-artifact-manager-2.0.6.jar
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/maven-model/2.0.6/maven-model-2.0.6.jar
Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-registry/2.0.6/maven-plugin-registry-2.0.6.jar (0 B at 0.0 KB/sec)
Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/maven-model/2.0.6/maven-model-2.0.6.jar (0 B at 0.0 KB/sec)
Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/maven-repository-metadata/2.0.6/maven-repository-metadata-2.0.6.jar (0 B at 0.0 KB/sec)
Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/maven-artifact-manager/2.0.6/maven-artifact-manager-2.0.6.jar (0 B at 0.0 KB/sec)
Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/maven-artifact/2.0.6/maven-artifact-2.0.6.jar (0 B at 0.0 KB/sec)
[INFO] Installing /Users/kowalskif/Desktop/apigee-edge-maven-plugin-1.0.4-SNAPSHOT.jar to /Users/kowalskif/.m2/repository/io/apigee/build-tools/enterprise4g/apigee-edge-maven-plugin/1.0.4-SNAPSHOT/apigee-edge-maven-plugin-1.0.4-SNAPSHOT.jar
[INFO] Installing /var/folders/_s/9bx0r0vn0171qhj2c4f8nbnw0000gt/T/mvninstall4467911010246496553.pom to /Users/kowalskif/.m2/repository/io/apigee/build-tools/enterprise4g/apigee-edge-maven-plugin/1.0.4-SNAPSHOT/apigee-edge-maven-plugin-1.0.4-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.274 s
[INFO] Finished at: 2016-06-09T22:06:51+02:00
[INFO] Final Memory: 9M/202M
[INFO] ------------------------------------------------------------------------

... but the configuration substitution command does not work better. Here is the log of the 2nd command:

mvn -e clean process-resources apigee-enterprise:configure -Papigee-env-dev
[...]
[ERROR] Failed to execute goal io.apigee.build-tools.enterprise4g:apigee-edge-maven-plugin:1.0.3:configure (default-cli) on project apiproxy: Index: 0, Size: 0 -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal io.apigee.build-tools.enterprise4g:apigee-edge-maven-plugin:1.0.3:configure (default-cli) on project apiproxy: Index: 0, Size: 0
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Index: 0, Size: 0
        at io.apigee.buildTools.enterprise4g.mavenplugin.ConfigureMojo.configurePackage(ConfigureMojo.java:125)
        at io.apigee.buildTools.enterprise4g.mavenplugin.ConfigureMojo.execute(ConfigureMojo.java:51)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
        ... 20 more
[ERROR] 
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
ssvaidyanathan commented 8 years ago

@asnowfix

Looks like your bundle pom.xml or shared-pom.xml is still using 1.0.3 version, please update your pom.xml to use 1.0.4-SNAPSHOT

<groupId>io.apigee.build-tools.enterprise4g</groupId>
<artifactId>apigee-edge-maven-plugin</artifactId>
<version>1.0.4-SNAPSHOT</version>
ssvaidyanathan commented 8 years ago

Hi @asnowfix - Any luck ?

kashiViswanath commented 8 years ago

Hi @ssvaidyanathan , I tried to deploy api proxy using maven, I have followed the steps which are there in below url. https://github.com/apigee/apigee-deploy-maven-plugin But still I am unable to deploy the proxy.. I am facing below issue Please help me out to resolve the issue. SpikeArrestExample.zip

C:\Users\414015\Documents\SpikeArrestExample\src\gateway\spkiearrestexample>mvn apigee-enterprise:deploy -Ptest -Dusername= -Dpassword= [INFO] Scanning for projects... Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom [WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-clean-plugin:2.5: Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.5 Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.6/maven-resources-plugin-2.6.pom [WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-resources-plugin:2.6: Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin: jar:2.6 [WARNING] The POM for io.apigee.build-tools.enterprise4g:apigee-edge-maven-plugin:jar:1.0.4-SNAPSHOT is missing, no dependency information available [WARNING] Failed to retrieve plugin descriptor for io.apigee.build-tools.enterprise4g:apigee-edge-maven-plugin:1.0.4-SNAPSHOT: Plugin io.apigee.build-tools.enterprise4g:apigee-edge-maven-plugin:1.0.4-SNAPSHOT or one of its dependencies could not be resolved: Could not find artifact io.apigee.build-t ools.enterprise4g:apigee-edge-maven-plugin:jar:1.0.4-SNAPSHOT Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-install-plugin/2.4/maven-install-plugin-2.4.pom [WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-install-plugin:2.4: Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-install-plugin:jar:2. 4 Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-deploy-plugin/2.7/maven-deploy-plugin-2.7.pom [WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-deploy-plugin:2.7: Plugin org.apache.maven.plugins:maven-deploy-plugin:2.7 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-deploy-plugin:jar:2.7 Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-site-plugin/3.3/maven-site-plugin-3.3.pom [WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-site-plugin:3.3: Plugin org.apache.maven.plugins:maven-site-plugin:3.3 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-site-plugin:jar:3.3 Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-antrun-plugin/1.3/maven-antrun-plugin-1.3.pom [WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-antrun-plugin:1.3: Plugin org.apache.maven.plugins:maven-antrun-plugin:1.3 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-antrun-plugin:jar:1.3 Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-assembly-plugin/2.2-beta-5/maven-assembly-plugin-2.2-beta-5.pom [WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-assembly-plugin:2.2-beta-5: Plugin org.apache.maven.plugins:maven-assembly-plugin:2.2-beta-5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-assem bly-plugin:jar:2.2-beta-5 Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-dependency-plugin/2.8/maven-dependency-plugin-2.8.pom [WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-dependency-plugin:2.8: Plugin org.apache.maven.plugins:maven-dependency-plugin:2.8 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-dependency-plug in:jar:2.8 Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-release-plugin/2.3.2/maven-release-plugin-2.3.2.pom [WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-release-plugin:2.3.2: Plugin org.apache.maven.plugins:maven-release-plugin:2.3.2 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-release-plugin:ja r:2.3.2 Downloading: http://repo1.maven.org/maven2/org/codehaus/mojo/maven-metadata.xml Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-metadata.xml [WARNING] Could not transfer metadata org.apache.maven.plugins/maven-metadata.xml from/to central (http://repo1.maven.org/maven2): Connect to repo1.maven.org:80 [repo1.maven.org/151.101.40.209] failed: Connection refused: connect [WARNING] Could not transfer metadata org.codehaus.mojo/maven-metadata.xml from/to central (http://repo1.maven.org/maven2): Connect to repo1.maven.org:80 [repo1.maven.org/151.101.40.209] failed: Connection refused: connect [WARNING] Failure to transfer org.apache.maven.plugins/maven-metadata.xml from http://repo1.maven.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer metadata org. apache.maven.plugins/maven-metadata.xml from/to central (http://repo1.maven.org/maven2): Connect to repo1.maven.org:80 [repo1.maven.org/151.101.40.209] failed: Connection refused: connect [WARNING] Failure to transfer org.codehaus.mojo/maven-metadata.xml from http://repo1.maven.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer metadata org.codehau s.mojo/maven-metadata.xml from/to central (http://repo1.maven.org/maven2): Connect to repo1.maven.org:80 [repo1.maven.org/151.101.40.209] failed: Connection refused: connect [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 10.821 s [INFO] Finished at: 2016-06-21T12:41:13+05:30 [INFO] Final Memory: 5M/15M [INFO] ------------------------------------------------------------------------ [ERROR] No plugin found for prefix 'apigee-enterprise' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (C:\Users\414015.m2\repository), central (http://repo1.maven.org/maven2)] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/NoPluginFoundForPrefixException

seymen commented 8 years ago

Did a quick test on this using 1.0.4-SNAPSHOT. I can see that the bug is fixed. Empty elements <Scope/> and <Scope></Scope are populated properly now. An element that doesn't exist in the original document is not added but I am not sure that is the intent of this feature.

My setup is as follows:

OAuth.xml

<OAuthV2 async="false" continueOnError="false" enabled="true" name="verify-oauth-v2-access-token">
    <DisplayName>Verify OAuth v2.0 Access Token</DisplayName>
    <Operation>VerifyAccessToken</Operation>
    <Scope>scope</Scope>
    <Scope1>value</Scope1>
    <Scope2></Scope2>
    <Scope3/>
    <!-- <Scope4/> -->
</OAuthV2>

config.json

{
    "configurations": [
        {
            "name": "test",
            "proxies": [],
            "policies": [
                {
                    "name": "OAuth.xml",
                    "tokens": [
                        {
                            "value": "scope1",
                            "xpath": "/OAuthV2/Scope1"
                        },
                        {
                            "value": "scope2",
                            "xpath": "/OAuthV2/Scope2"
                        },
                        {
                            "value": "scope3",
                            "xpath": "/OAuthV2/Scope3"
                        },
                        {
                            "value": "scope4",
                            "xpath": "/OAuthV2/Scope4"
                        }
                    ]
                }
            ],
            "targets": []
        }
    ]
}

OAuth.xml After Change

<OAuthV2 async="false" continueOnError="false" enabled="true" name="verify-oauth-v2-access-token">
    <DisplayName>Verify OAuth v2.0 Access Token</DisplayName>
    <Operation>VerifyAccessToken</Operation>
    <Scope>scope</Scope>
    <Scope1>scope1</Scope1>
    <Scope2>scope2</Scope2>
    <Scope3>scope3</Scope3>
    <!-- <Scope4/> -->
</OAuthV2>
ssvaidyanathan commented 8 years ago

HI @kashiViswanath

Thanks for the bundle. Can you please update your shared-pom.xml from

                <groupId>io.apigee.build-tools.enterprise4g</groupId>
         <artifactId>apigee-edge-maven-plugin</artifactId>
        <version>1.0.4-SNAPSHOT</version>

to

                <groupId>io.apigee.build-tools.enterprise4g</groupId>
         <artifactId>apigee-edge-maven-plugin</artifactId>
        <version>1.0.3</version>

1.0.3 is the latest version on Central Maven Repo - [http://repo1.maven.org/maven2/io/apigee/build-tools/enterprise4g/apigee-edge-maven-plugin/]

1.0.4-SNAPSHOT is a snapshot version with some fixes we have worked on. Will be releasing it soon. For now, please try using 1.0.3 as suggested above.

Let me know if it works.

If you still have issues - I would recommend you to open a new Issue so that its handled separately.

ssvaidyanathan commented 8 years ago

@seymen -Thanks a lot for testing it

ssvaidyanathan commented 8 years ago

HI @asnowfix - we have released new version 1.0.4 which should have a fix. Please get the latest and let me know if it fixed.. Please re-open or open a new issue if you find any problem

ealdwairi commented 3 years ago

hello, really having hard time with running this project: I am at this error now( fixed a couple based on above recommedations):

[ERROR] Failed to execute goal io.apigee.build-tools.enterprise4g:apigee-edge-maven-plugin:1.0.4-SNAPSHOT:deploy (default-cli) on project parent-pom: Execution default-cli of goal io.apigee.build-tools.enterprise4g:apigee-edge-maven-plugin:1.0.4-SNAPSHOT:deploy failed: A required class was missing while executing io.apigee.build-tools.enterprise4g:apigee-edge-maven-plugin:1.0.4-SNAPSHOT:deploy: com/google/api/client/http/HttpTransport [ERROR] ----------------------------------------------------- [ERROR] realm = plugin>io.apigee.build-tools.enterprise4g:apigee-edge-maven-plugin:1.0.4-SNAPSHOT [ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy [ERROR] urls[0] = file:/Users/enewcomb/.m2/repository/io/apigee/build-tools/enterprise4g/apigee-edge-maven-plugin/1.0.4-SNAPSHOT/apigee-edge-maven-plugin-1.0.4-SNAPSHOT.jar [ERROR] urls[1] = file:/Users/enewcomb/.m2/repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar [ERROR] Number of foreign imports: 1 [ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]

ssvaidyanathan commented 3 years ago

@ealdwairi - can you please open a new GitHub issue with all the details.