5
votes

I have a maven multi module project set up for an AEM application:

  • core
  • ui.apps
  • it.launcher
  • it.tests
  • ui.workflows (added more recently)

The application is deployed through Jenkins via a Maven build using the 0.0.24 version of the com.day.jcr.vault content-package-maven-plugin:

mvn clean install -PautoInstallPackage (-D... [admin creds] -D... [server info])

Intermittently, the Jenkins build will fail because the deployment of ui.workflows to http://{server}.{port}/crx/packmgr/service.jsp will fail with the following message:

[ERROR] Missing response status information in response:

Checking in the logs of successful and unsuccessful deployments, I can see that the successful deployment requests returns an XML response that begins with

<crx version="1.4.1" user="admin" workspace="crx.default">

and ends with

Package installed in 4098ms. </log> </data> <status code="200">ok</status> </response> </crx>

The unsuccessful deployment requests returns an HTML response that begins with

<html> <head> <title>Content modified /crx/packmgr/service.jsp</title> </head> <body> <h1>Content modified /crx/packmgr/service.jsp</h1> <table> <tbody> <tr> <td>Status</td> <td><div id="Status">200</div></td> </tr>

I surmise that the request to the service endpoint in AEM was successful but that the plugin could not parse the HTML response. It looks like AEM in 6.2 is moving away from the /crx/packmgr/service.jsp endpoint, as well as XML responses in this documentation here

In the Adobe Nexus Repo for the maven plugin, there is a new version (0.5), which is a significant leap in version number from the previous number, and also coincides with the AEM 6.2 version release (April 2016) but I cannot find any documentation on how to configure the new plugin.

If anyone has experienced this issue, how did you resolve it?

4

4 Answers

2
votes

For help on the latest plugin you could do following -

mvn com.day.jcr.vault:content-package-maven-plugin:0.5.1:help

This will give you list of goals available with new plugin. Given that you are looking into installing the package, the goal to get details will be install, you could type following command to get the details for configuring the goal -

mvn com.day.jcr.vault:content-package-maven-plugin:0.5.1:help -Ddetail=true -Dgoal=install

This will give you configuration details, something like -

[INFO] Adobe Content Package Maven Plugin 0.5.1 Maven Plugin supporting creation of content packages and controlling the package manager on a remote system.

content-package:install Install a Content Package on a remote CRX or Communique 5 system.

Available parameters:

artifact
  A string of the form groupId:artifactId:version[:packaging].
  User property: vault.artifact

artifactId
  The artifactId of the artifact to install
  User property: vault.artifactId

failOnError (Default: false)
  If true, fail the build if there is an error while installing.
  User property: vault.failOnError

groupId
  The groupId of the artifact to install
  User property: vault.groupId

install (Default: true)
  Whether to install (unpack) the uploaded package automatically or not.
  User property: vault.install

name (Default: ${project.artifactId})
  The name of the content package
  User property: vault.name

packageFile (Default:
${project.build.directory}/${project.build.finalName}.zip)
  The name of the content package file to install on the target system. If
  not set, the primary artifact of the project is considered the content
  package to be installed.
  User property: vault.file

packaging (Default: zip)
  The packaging of the artifact to install
  User property: vault.packaging

password (Default: admin)
  The password to authenticate against the remote CRX system.
  Required: Yes
  User property: vault.password

relaxedSSLCheck (Default: false)

  User property: vault.relaxedSSLCheck

repositoryId (Default: temp)
  The id of the repository from which we'll download the artifact
  User property: vault.repoId

repositoryUrl
  The url of the repository from which we'll download the artifact
  User property: vault.repoUrl

serverId
  The server id with which to get the username and password from the user's
  settings file.
  User property: vault.serverId

serviceURL (Default: http://localhost:4502/crx/packmgr/service/.json)

  Required: Yes
  User property: vault.serviceURL

targetURL (Default: http://localhost:4502/crx/packmgr/service.jsp)
  The URL to the HTTP service API of the CRX package manager. See HTTP
  Service Interface for details on this interface.
  Required: Yes
  User property: vault.targetURL

timeout (Default: 5)
  The connection timeout to set when communicating with the package manager
  service. Default value is 5 seconds. Value is specified in seconds.
  User property: vault.timeout

useProxy (Default: true)
  Setting this to false disables considering the use of any of the active
  proxies configured in the Maven Settings. By default the first active
  proxy configuration in the Maven Settings is used to proxy any request to
  the package manager.
  User property: vault.useProxy

userId (Default: admin)
  The user name to authenticate as against the remote CRX system.
  Required: Yes
  User property: vault.userId

verbose (Default: false)
  Enable verbose logging when set to true.
  User property: vault.verbose

version
  The version of the artifact to install
  User property: vault.version
1
votes

I had the same problem for my multimodule project:

  • module 1: simple content
  • module 2: simple content, assets and bundle
  • module 3: simple content

Packages for these modules were installed in the order shown above and it seemed to be the issue.

It turned out that the problem occurred when installing the third package and in error.log there was a problem with some workflows for assets. I don't know what's the exact reason, but changing the order of packages actually helped, so what I had to do is to install the package with assets and bundle at the end. You may consider a similar solution depending on your project structure.

1
votes

I know it's an old problem but we encountered this issue recently. Updating to version 0.5.24 of content-package-maven-plugin resolves the issue.

The deploy profile on local machines works ok but failed in CI environment for which I'll create another story and link it here.

0
votes
<plugins>
   <plugin>
   <groupId>com.day.jcr.vault</groupId>
   <artifactId>content-package-maven-plugin</artifactId>
   <executions>
      <execution>
          <id>install-package</id>
          <goals>
             <goal>install</goal>
          </goals>
      </execution>
   </executions>
   <version>0.0.24</version>
       <extensions>true</extensions>
       <configuration>
           <failOnError>true</failOnError>
           <username>${crx.username}</username>
           <password>${crx.password}</password>
       </configuration>
  </plugin>
</plugins>