*** The wcm.io Project is closing down this JIRA Instance in favor of GitHub issues. *** Please use the corresponding GitHub projects to report issues - or the mailing list for general discussion.

wcmio-content-package-maven-plugin swallows JSON upload error

Description

The code specifically checks the "success"-attribute in the JSON response. If that is not true, it checks the message for package existence, but then if that is not true, it reports an error. That error comes from the JSON object; which is not correct.

I would rather see the full JSON that was returned + the HTTP status code.

boolean success = jsonResponse.optBoolean("success", false); String msg = jsonResponse.optString("msg", null); String path = jsonResponse.optString("path", null); if (success) { ... } else if ((StringUtils.startsWith(msg, "Package already exists: ")) && (!this.force)) { getLog().info("Package skipped because it was already uploaded."); } else { throw new MojoExecutionException("Package upload failed: " + msg); }

Gliffy Diagrams

Activity

Show:

Stefan Seifert July 11, 2018 at 5:25 PM

this is fixed in wcm.io Content Package Maven Plugin 1.6.14

Henry Kuijpers June 12, 2018 at 9:28 AM

I found out the problem: The configuration we received contained <userId>${cq.dev.user</userId> (notice the missing }).

So you can test it with an invalid username/password. You will receive a 401, and then the "Package upload failed: " message will be shown. It should indicate something about not getting a response (and should actually show an authorization error or similar).

Stefan Seifert June 12, 2018 at 8:31 AM

how can we reproduce the issue (or test the fix if we apply one)?

do you have a simple example - e.g. a corrupt AEM package or a command line call to reproduce the problem you encountered?

Fixed

Details

Assignee

Reporter

Priority

Created June 11, 2018 at 12:04 PM
Updated July 13, 2018 at 8:18 AM
Resolved July 11, 2018 at 5:25 PM