Expand my Community achievements bar.

SOLVED

Deploying packages to a secure (HTTPS) server with content-package-maven-plugin

Avatar

Level 1

Hello,

I am running into an issue trying to build and deploy to an Adobe Managed Services server with the content-package-maven-plugin. The server only has port 443 open for security purposes and will only work with HTTPS rather than an un-secure HTTP connection. I have downloaded and added the SSL certificate from the URL to my Java cacerts file and still the connection gets reset or times out when I try to build and deploy packages to that server through maven. I have also checked our firewall and our ports are open and we allow connection to the AMS server, I can telnet directly to the server with no issues from my local machine.

Regardless, if I use the IP address with the port or the domain attached to the IP address to build to our Author instance it still times out or the connection gets reset.

I also explicitly defined the location of the truststore cacert file in a .mavenrc file, and still no luck.

Here is the .mavenrc file:

MAVEN_OPTS="-Xmx512m  -Djavax.net.ssl.trustStore=/Library/Java/JavaVirtualMachines/jdk1.8.0_73.jdk/Contents/Home/jre/lib/security/cacerts \

                     -Djavax.net.ssl.trustStorePassword=*************"

Here is the plugin configuration for the pom.xml:

<plugin>

    <groupId>com.day.jcr.vault</groupId>

    <artifactId>content-package-maven-plugin</artifactId>

    <version>0.0.24</version>

    <extensions>true</extensions>

    <executions>

          <execution>

               <id>install-package</id>

               <configuration>

                    <failOnError>true</failOnError>

                    <targetURL>https://${aem.host}:${aem.port}/crx/packmgr/service.jsp</targetURL>

                    <userId>${sling.user}</userId>

                    <password>${sling.password}</password>

                    <useProxy>false</useProxy>

               </configuration>

          </execution>

     </executions>

</plugin>

Here are the maven commands being used to run the build:

mvn clean install -X -P adobe-public,autoInstallPackage -Daem.host=(IP address or URL) -Daem.port=443

-Dsling.user=******** -Dsling.password=********* -Dvault.user=********** -Dvault.password=**************

Here is a snippet of the logs from the build:

[DEBUG]   (s) skip = false

[DEBUG]   (f) updateReleaseInfo = false

[DEBUG] -- end configuration --

[INFO] Installing /Users/ismailamzovski/git/git2/adobe-experience-manager/common-components/ui.apps/target/common-components.ui.apps-1.0-SNAPSHOT.zip to /Users/ismailamzovski/.m2/repository/tju/common-components.ui.apps/1.0-SNAPSHOT/common-components.ui.apps-1.0-SNAPSHOT.zip

[DEBUG] Writing tracking file /Users/ismailamzovski/.m2/repository/tju/common-components.ui.apps/1.0-SNAPSHOT/_remote.repositories

[INFO] Installing /Users/ismailamzovski/git/git2/adobe-experience-manager/common-components/ui.apps/pom.xml to /Users/ismailamzovski/.m2/repository/tju/common-components.ui.apps/1.0-SNAPSHOT/common-components.ui.apps-1.0-SNAPSHOT.pom

[DEBUG] Writing tracking file /Users/ismailamzovski/.m2/repository/tju/common-components.ui.apps/1.0-SNAPSHOT/_remote.repositories

[DEBUG] Installing tju:common-components.ui.apps:1.0-SNAPSHOT/maven-metadata.xml to /Users/ismailamzovski/.m2/repository/tju/common-components.ui.apps/1.0-SNAPSHOT/maven-metadata-local.xml

[DEBUG] Installing tju:common-components.ui.apps/maven-metadata.xml to /Users/ismailamzovski/.m2/repository/tju/common-components.ui.apps/maven-metadata-local.xml

[INFO]

[INFO] --- content-package-maven-plugin:0.0.24:install (install-package) @ common-components.ui.apps ---

[DEBUG] Configuring mojo com.day.jcr.vault:content-package-maven-plugin:0.0.24:install from plugin realm ClassRealm[extension>com.day.jcr.vault:content-package-maven-plugin:0.0.24, parent: sun.misc.Launcher$AppClassLoader@33909752]

[DEBUG] Configuring mojo 'com.day.jcr.vault:content-package-maven-plugin:0.0.24:install' with basic configurator -->

[DEBUG]   (f) failOnError = true

[DEBUG]   (f) install = true

[DEBUG]   (f) localRepository =       id: local

      url: file:///Users/ismailamzovski/.m2/repository/

   layout: default

snapshots: [enabled => true, update => always]

releases: [enabled => true, update => always]

[DEBUG]   (f) name = common-components.ui.apps

[DEBUG]   (f) packageFile = /Users/ismailamzovski/git/git2/adobe-experience-manager/common-components/ui.apps/target/common-components.ui.apps-1.0-SNAPSHOT.zip

[DEBUG]   (f) packaging = zip

[DEBUG]   (f) password = *****************

[DEBUG]   (f) pomRemoteRepositories = [      id: adobe-public-releases

      url: https://repo.adobe.com/nexus/content/groups/public

   layout: default

snapshots: [enabled => false, update => daily]

releases: [enabled => true, update => never]

,       id: central

      url: https://repo.maven.apache.org/maven2

   layout: default

snapshots: [enabled => false, update => daily]

releases: [enabled => true, update => daily]

]

[DEBUG]   (f) project = MavenProject: tju:common-components.ui.apps:1.0-SNAPSHOT @ /Users/ismailamzovski/git/git2/adobe-experience-manager/common-components/ui.apps/pom.xml

[DEBUG]   (f) relaxedSSLCheck = false

[DEBUG]   (f) repositoryId = temp

[DEBUG]   (f) serviceURL = http://localhost:4502/crx/packmgr/service/.json

[DEBUG]   (f) settings = org.apache.maven.execution.SettingsAdapter@18f13756

[DEBUG]   (f) targetURL = http://**.***.***.***:443/crx/packmgr/service.jsp

[DEBUG]   (f) timeout = 5

[DEBUG]   (f) useProxy = true

[DEBUG]   (f) userId = *******************

[DEBUG]   (f) verbose = true

[DEBUG] -- end configuration --

[INFO] Installing common-components.ui.apps (/Users/ismailamzovski/git/git2/adobe-experience-manager/common-components/ui.apps/target/common-components.ui.apps-1.0-SNAPSHOT.zip) to http://**.***.***.***:443/crx/packmgr/service.jsp

[DEBUG] Set parameter http.useragent = Jakarta Commons-HttpClient/3.1

[DEBUG] Set parameter http.protocol.version = HTTP/1.1

[DEBUG] Set parameter http.connection-manager.class = class org.apache.commons.httpclient.SimpleHttpConnectionManager

[DEBUG] Set parameter http.protocol.cookie-policy = default

[DEBUG] Set parameter http.protocol.element-charset = US-ASCII

[DEBUG] Set parameter http.protocol.content-charset = ISO-8859-1

[DEBUG] Set parameter http.method.retry-handler = org.apache.commons.httpclient.DefaultHttpMethodRetryHandler@48144f1a

[DEBUG] Set parameter http.dateparser.patterns = [EEE, dd MMM yyyy HH:mm:ss zzz, EEEE, dd-MMM-yy HH:mm:ss zzz, EEE MMM d HH:mm:ss yyyy, EEE, dd-MMM-yyyy HH:mm:ss z, EEE, dd-MMM-yyyy HH-mm-ss z, EEE, dd MMM yy HH:mm:ss z, EEE dd-MMM-yyyy HH:mm:ss z, EEE dd MMM yyyy HH:mm:ss z, EEE dd-MMM-yyyy HH-mm-ss z, EEE dd-MMM-yy HH:mm:ss z, EEE dd MMM yy HH:mm:ss z, EEE,dd-MMM-yy HH:mm:ss z, EEE,dd-MMM-yyyy HH:mm:ss z, EEE, dd-MM-yyyy HH:mm:ss z]

[DEBUG] Set parameter http.protocol.expect-continue = true

[DEBUG] Java version: 1.8.0_73

[DEBUG] Java vendor: Oracle Corporation

[DEBUG] Java class path: /usr/local/Cellar/maven/3.3.9/libexec/boot/plexus-classworlds-2.5.2.jar

[DEBUG] Operating system name: Mac OS X

[DEBUG] Operating system architecture: x86_64

[DEBUG] Operating system version: 10.11.6

[DEBUG] SUN 1.8: SUN (DSA key/parameter generation; DSA signing; SHA-1, MD5 digests; SecureRandom; X.509 certificates; JKS & DKS keystores; PKIX CertPathValidator; PKIX CertPathBuilder; LDAP, Collection CertStores, JavaPolicy Policy; JavaLoginConfig Configuration)

[DEBUG] SunRsaSign 1.8: Sun RSA signature provider

[DEBUG] SunEC 1.8: Sun Elliptic Curve provider (EC, ECDSA, ECDH)

[DEBUG] SunJSSE 1.8: Sun JSSE provider(PKCS12, SunX509/PKIX key/trust factories, SSLv3/TLSv1/TLSv1.1/TLSv1.2)

[DEBUG] SunJCE 1.8: SunJCE Provider (implements RSA, DES, Triple DES, AES, Blowfish, ARCFOUR, RC2, PBE, Diffie-Hellman, HMAC)

[DEBUG] SunJGSS 1.8: Sun (Kerberos v5, SPNEGO)

[DEBUG] SunSASL 1.8: Sun SASL provider(implements client mechanisms for: DIGEST-MD5, GSSAPI, EXTERNAL, PLAIN, CRAM-MD5, NTLM; server mechanisms for: DIGEST-MD5, GSSAPI, CRAM-MD5, NTLM)

[DEBUG] XMLDSig 1.8: XMLDSig (DOM XMLSignatureFactory; DOM KeyInfoFactory; C14N 1.0, C14N 1.1, Exclusive C14N, Base64, Enveloped, XPath, XPath2, XSLT TransformServices)

[DEBUG] SunPCSC 1.8: Sun PC/SC provider

[DEBUG] Apple 1.8: Apple Provider

[DEBUG] Set parameter http.authentication.preemptive = true

[DEBUG] Proxying disabled (useProxy=true) or no proxies configured

[DEBUG] Set parameter http.connection.timeout = 5000

[DEBUG] Preemptively sending default basic credentials

[DEBUG] Authenticating with BASIC <any realm>@**.***.***.***:443

[DEBUG] Credential charset not configured, using HTTP element charset

[DEBUG] Open connection to **.***.***.***:443

[DEBUG] >> "POST /crx/packmgr/service.jsp HTTP/1.1[\r][\n]"

[DEBUG] Adding Host request header

[DEBUG] >> "referer: about:blank[\r][\n]"

[DEBUG] >> "Authorization: Basic YWRtaW46QCtaUXhnRHtRRmJ9MjI=[\r][\n]"

[DEBUG] >> "User-Agent: Jakarta Commons-HttpClient/3.1[\r][\n]"

[DEBUG] >> "Host: **.***.***.***:443[\r][\n]"

[DEBUG] >> "Expect: 100-continue[\r][\n]"

[DEBUG] >> "Content-Length: 22163848[\r][\n]"

[DEBUG] >> "Content-Type: multipart/form-data; boundary=smpKOUIeCnt3x9GfgLQfDSGy6WmiIvKh_-GbdTfY[\r][\n]"

[DEBUG] >> "[\r][\n]"

[DEBUG] Closing the connection.

[INFO] I/O exception (org.apache.commons.httpclient.NoHttpResponseException) caught when processing request: The server **.***.***.*** failed to respond

[DEBUG] The server **.***.***.*** failed to respond

org.apache.commons.httpclient.NoHttpResponseException: The server **.***.***.*** failed to respond

at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1976)

at org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:2082)

at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1096)

at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398)

at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)

at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)

at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)

at com.day.jcr.vault.maven.mgr.AbstractPackageManagerMojo.postRequest(AbstractPackageManagerMojo.java:228)

at com.day.jcr.vault.maven.mgr.PackageInstallMojo.uploadPackage(PackageInstallMojo.java:267)

at com.day.jcr.vault.maven.mgr.PackageInstallMojo.execute(PackageInstallMojo.java:200)

at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)

at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)

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)

[INFO] Retrying request

[DEBUG] Open connection to **.***.***.***:443

[DEBUG] >> "POST /crx/packmgr/service.jsp HTTP/1.1[\r][\n]"

[DEBUG] Adding Host request header

[DEBUG] >> "referer: about:blank[\r][\n]"

[DEBUG] >> "Authorization: Basic YWRtaW46QCtaUXhnRHtRRmJ9MjI=[\r][\n]"

[DEBUG] >> "User-Agent: Jakarta Commons-HttpClient/3.1[\r][\n]"

[DEBUG] >> "Expect: 100-continue[\r][\n]"

[DEBUG] >> "Content-Length: 22163848[\r][\n]"

[DEBUG] >> "Content-Type: multipart/form-data; boundary=smpKOUIeCnt3x9GfgLQfDSGy6WmiIvKh_-GbdTfY[\r][\n]"

[DEBUG] >> "Host: **.***.***.***:443[\r][\n]"

[DEBUG] >> "[\r][\n]"

[DEBUG] Closing the connection.

[INFO] I/O exception (org.apache.commons.httpclient.NoHttpResponseException) caught when processing request: The server **.***.***.*** failed to respond

[DEBUG] The server **.***.***.*** failed to respond

org.apache.commons.httpclient.NoHttpResponseException: The server **.***.***.*** failed to respond

at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1976)

at org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:2082)

at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1096)

at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398)

at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)

at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)

at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)

at com.day.jcr.vault.maven.mgr.AbstractPackageManagerMojo.postRequest(AbstractPackageManagerMojo.java:228)

at com.day.jcr.vault.maven.mgr.PackageInstallMojo.uploadPackage(PackageInstallMojo.java:267)

at com.day.jcr.vault.maven.mgr.PackageInstallMojo.execute(PackageInstallMojo.java:200)

at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)

at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)

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)

DEBUG] Releasing connection back to connection manager.

[INFO] ------------------------------------------------------------------------

[INFO] Reactor Summary:

[INFO]

[INFO] common-components .................................. SUCCESS [  0.190 s]

[INFO] common-components - Core ........................... SUCCESS [  2.090 s]

[INFO] common-components - UI apps ........................ FAILURE [  4.315 s]

[INFO] common-components - Integration Tests Bundles ...... SKIPPED

[INFO] common-components - Integration Tests Launcher ..... SKIPPED

[INFO] enterprise ......................................... SKIPPED

[INFO] enterprise - Core .................................. SKIPPED

[INFO] enterprise - UI apps ............................... SKIPPED

[INFO] enterprise - Integration Tests Bundles ............. SKIPPED

[INFO] enterprise - Integration Tests Launcher ............ SKIPPED

I have noticed the targetUrl variable is always set to HTTP even if I explicitly set it to HTTPS in the assignment of it.  And I tried setting the relaxedSSLCheck flag to true but I do not know how to go about doing that, is that set in the pom.xml or elsewhere?

The end goal is to have Jenkins build and deploy our packages to our author server, however I cannot seem to get it to deploy over HTTPS locally with maven or in Jenkins. Is there some other plugin I should be using, or am I configuring this incorrectly? Can you please help?

I was following this documentation and I see no mention on how to deploy over HTTPS, only HTTP: Managing Packages Using Maven

1 Accepted Solution

Avatar

Correct answer by
Level 1

Hello, yes adding the protocol is the way it should be handled. I was able to find the solution to this issue eventually, just forgot to update this question. What I found is when you create a template multi module project with the AEM Maven Archtypes, it hardcodes HTTP into the content-package-maven-plugin targetURL. So every project and their child projects pom.xml had HTTP hardcoded in there. Once that was removed it was a matter of also uploading the AMS servers SSL Certificate into the Java Keystore that Jenkins uses. Now I have the pom.xml setup to take a different protocol (Either HTTP or HTTPS) rather than have it hardcoded.

View solution in original post

4 Replies

Avatar

Employee Advisor

ixa020 Can you try the following parameters:-

mvn clean install -PautoInstallBundle -Padobe-public -Daem.port=5433(or whichever port AEM is using SSL) -Daem.protocol=https -Daem.host=<hostname> -Dvault.user=<user> -Dvault.password=<password>

Avatar

Correct answer by
Level 1

Hello, yes adding the protocol is the way it should be handled. I was able to find the solution to this issue eventually, just forgot to update this question. What I found is when you create a template multi module project with the AEM Maven Archtypes, it hardcodes HTTP into the content-package-maven-plugin targetURL. So every project and their child projects pom.xml had HTTP hardcoded in there. Once that was removed it was a matter of also uploading the AMS servers SSL Certificate into the Java Keystore that Jenkins uses. Now I have the pom.xml setup to take a different protocol (Either HTTP or HTTPS) rather than have it hardcoded.

Avatar

Level 1

Hi,

I am having similar issue while deploying to HTTPS server.

I am trying to run the build on my local machine to deploy it to DEV author. This is a trail run before setting up the Jenkins job to ensure

build and deployment works.

I have changed pom files to have https instead of http.

When I run the below build on my local host, it is replacing https with http.

mvn clean install -DskipTests -DproxySet=true -Daem.host=https://dev1.author.mercury.dnitv.com -Daem.port=443 -PautoInstallPackage -Dproject.version=2.3.32-SNAPSHOT

I also tried setting the protocol through command line.

mvn clean install -DskipTests -DproxySet=true -Daem.host=dev1.author.mercury.dnitv.com  -Daem.protocol=https -Daem.port=443 -PautoInstallPackage -Dproject.version=2.3.32-SNAPSHOT

Issue remain the same.

However, if I hard code the host name in the pom file, and don't pass host details from the command line deployment works fine to https server. But I can't hardcode the server details in the pom file as same git repo will be used by Jenkins to build and deploy into different environments.

Any help or suggestions would be appreciated.

Avatar

Employee

Hi ixa020,

plz clarify on how you resolved this issue.

we face the same problem..

And we are passing the protocol, host and port details via command line.

Regards,

venkatesh S