Search code examples
mavenapigee

Unable to deploy API bundle on Apigee using Maven


I am unable deploy an API to Apigee using Maven. Following is the command i am using to deploy the bundle to my org on Apigee-

mvn clean install [email protected] -Dpassword=PassWord@123 -Dorg=orgName -Ptest

I am getting the following error:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 24.211 s
[INFO] Finished at: 2015-12-01T17:57:52+05:30
[INFO] Final Memory: 19M/179M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.apigee.build-tools.enterprise4g:apigee-edge-maven-plugin:1.0.0:deploy (install-bundle-step) on project XYZ-API: MojoExecutionException: connect timed out -> [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/MojoExecutionException

I notice that build(zip file) is created properly inside target folder, but it's not getting deployed on apigee.

Also i would mention that i am using the setup behind my corporate proxy, and i have accordingly configured the setting.xml inside conffolder for maven.

What could be the various reasons for this? Also please suggest the work around. Thanks in advance

This is detailed error log:

[ERROR] Failed to execute goal io.apigee.build-tools.enterprise4g:apigee-edge-maven-plugin:1.0.0:deploy (install-bundle-step) on project AllergyIntolerance-FHIR-API: MojoExecutionException: connect timed out -> [Help
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal io.apigee.build-tools.enterprise4g:apigee-edge-maven-plugin:1.0.0:deploy (install-bundle-step) on project AllergyIntolerance-FHIR-API:
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
        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:862)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        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:
        at io.apigee.buildTools.enterprise4g.mavenplugin.DeployMojo.processHelpfulErrorMessage(DeployMojo.java:343)
        at io.apigee.buildTools.enterprise4g.mavenplugin.DeployMojo.execute(DeployMojo.java:328)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
        ... 20 more
Caused by: java.net.SocketTimeoutException: connect timed out
        at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
        at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:85)
        at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
        at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
        at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
        at java.net.Socket.connect(Socket.java:579)
        at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:618)
        at sun.net.NetworkClient.doConnect(NetworkClient.java:175)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:432)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:527)
        at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:275)
        at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:371)
        at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:191)
        at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:932)
        at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:177)
        at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1091)
        at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:250)
        at com.google.api.client.http.javanet.NetHttpRequest.execute(NetHttpRequest.java:79)
        at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:895)
        at io.apigee.buildTools.enterprise4g.rest.RestUtil.uploadBundle(RestUtil.java:342)
        at io.apigee.buildTools.enterprise4g.mavenplugin.DeployMojo.doImport(DeployMojo.java:152)
        at io.apigee.buildTools.enterprise4g.mavenplugin.DeployMojo.execute(DeployMojo.java:297)
        ... 22 more
[ERROR]
[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

Solution

  • This error

    Caused by: java.net.SocketTimeoutException: connect timed out
    

    is emitted when the system is trying to connect to a server, but cannot. The reason is usually one of two items:

    1. The server is not properly named in the profile configuration <apigee.hosturl>https://api.enterprise.apigee.com</apigee.hosturl>

    2. Your host does not have the ability to reach the server, probably because of a network configuration. In this case, you may need to configure an outbound proxy.

    If you have additional questions you might try http://community.apigee.com for more help.