[ https://issues.apache.org/jira/browse/SLING-5627?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15209868#comment-15209868 ]
Konrad Windszus edited comment on SLING-5627 at 3/24/16 10:10 AM: ------------------------------------------------------------------ I am pretty sure, that this is just a misconfiguration on your side: The Felix WebConsole BundlesServlet will never return a 201 for a POST request (https://github.com/apache/felix/blob/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/core/BundlesServlet.java#L322). And the maven-sling-plugin has not been changed recently in the regard of how status codes are handled for POSTs towards the Felix WebConsole (https://github.com/apache/sling/blame/74d2764d4a092dfd02e2b173564e0105f696c607/tooling/maven/maven-sling-plugin/src/main/java/org/apache/sling/maven/bundlesupport/AbstractBundleInstallMojo.java#L344). I am assuming that somehow the Sling Post Servlet is answering here, because probably your {{slingUrl}} does not point towards the Sling Web Console ({{/system/console}}). was (Author: kwin): I am pretty sure, that this is just a misconfiguration on your side: The Felix WebConsole BundlesServlet will never return a 201 for a POST request (https://github.com/apache/felix/blob/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/core/BundlesServlet.java#L322). And the maven-sling-plugin has not been changed recently in the regard of how status codes are handled for POSTs towards the Felix WebConsole (https://github.com/apache/sling/blame/74d2764d4a092dfd02e2b173564e0105f696c607/tooling/maven/maven-sling-plugin/src/main/java/org/apache/sling/maven/bundlesupport/AbstractBundleInstallMojo.java#L344). I am assuming that somehow the Sling Post Servlet is answering here, because probably your {{slingUrl}} does not point towards the Sling Web Console ({{/console/bundles}}). > maven-sling-plugin: HTTP Status is not checked correctly when WebConsole > install method used > -------------------------------------------------------------------------------------------- > > Key: SLING-5627 > URL: https://issues.apache.org/jira/browse/SLING-5627 > Project: Sling > Issue Type: Bug > Components: Maven Plugins and Archetypes > Affects Versions: Maven Sling Plugin 2.1.8 > Environment: AEM 6.1 sp1 > Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; > 2015-04-22T14:57:37+03:00) > Maven home: d:\Java\apache-maven-3.3.3\bin\.. > Java version: 1.8.0_66, vendor: Oracle Corporation > Java home: c:\Program Files\Java\jdk1.8.0_66\jre > Default locale: ru_RU, platform encoding: Cp1251 > OS name: "windows 7", version: "6.1", arch: "amd64", family: "dos" > Reporter: Peter Melnikov > Labels: maven, sling > > Maven Sling Plugin fails upon bundle installation on a fresh instance: > [ERROR] Failed to execute goal > org.apache.sling:maven-sling-plugin:2.1.8:install (install-bundle) on project > core: Insta > llation on http://localhost:4502/apps/beneteau/install failed, cause: > Installation failed, cause: Created -> [Help 1] > Accordingly to the code in AbstractBundleInstallMojo.java the HTTP result is > expected 200 OK while for HTTP POST the status 201 Created is also a valid > status of normal execution: > int status = getHttpClient().executeMethod(filePost); > if (status == HttpStatus.SC_OK) { > getLog().info("Bundle installed"); > } else { > Proposed fix is to add also condition status == HttpStatus.SC_CREATED -- This message was sent by Atlassian JIRA (v6.3.4#6332)