1. Sling
  2. SLING-861

Add HTTP PUT support for maven-sling-plugin



      In addition to the standard POST that is tailored for the felix webconsole in the maven-sling-plugin install goal, it can also be useful to support simple PUT uploads of the bundle jar. This is useful in combination with the jcrinstall extension, where you could PUT the jar file via Jackrabbit's or Sling's WebDAV into a folder that is watched by jcrinstall.

      Therefore I implemented this feature, using PUT for the install goal and DELETE for the uninstall goal. There is a new config option "sling.usePut" that must be set to "true" for using PUT or DELETE - by default it is false, so that the POST behaviour stays default.

      To make the configuration of the plugin in a multi-module POM structure simpler, I also added a new config "sling.urlSuffix" that (if present) will be appended to the "sling.url" (in all cases, POST, PUT and DELETE). That allows you to specify a base path in your parent POM (sling.url=http://localhost:8080) and define a different path for each project (sling.urlSuffix=/libs/myproject/install), because with jcrinstall you can place them at different locations in the repository, if you wish.

      There is also a "sling.mimeTypeForPut" option to set the content-type for the PUT request (by default it is "application/java-archive").

      Just for reference, since the config names are different if you specify them in the pom (using the java field name in the Mojo rather than the defined expression....), here is a sample configuration:



        Alexander Klimetschek created issue -
        Alexander Klimetschek made changes -
        Field Original Value New Value
        Attachment sling-install-PUT-support.patch [ 12400413 ]
        Carsten Ziegeler made changes -
        Assignee Carsten Ziegeler [ cziegeler ]
        Carsten Ziegeler made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Carsten Ziegeler made changes -
        Affects Version/s Maven Sling Plugin 2.0.2 [ 12313226 ]
        Carsten Ziegeler made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Felix Meschberger made changes -
        Workflow jira [ 12452870 ] no-reopen-closed,doc-test-required [ 12475182 ]
        Gavin made changes -
        Workflow no-reopen-closed,doc-test-required [ 12475182 ] Copy of no-reopen-closed,doc-test-required [ 12762963 ]
        Gavin made changes -
        Workflow Copy of no-reopen-closed,doc-test-required [ 12762963 ] no-reopen-closed,doc-test-required [ 12766696 ]
        Gavin made changes -
        Workflow no-reopen-closed,doc-test-required [ 12766696 ] re-open possible,doc-test-required [ 12788581 ]
        Gavin made changes -
        Workflow re-open possible,doc-test-required [ 12788581 ] no-reopen-closed,doc-test-required [ 12790643 ]


          • Assignee:
            Carsten Ziegeler
            Alexander Klimetschek
          • Votes:
            0 Vote for this issue
            0 Start watching this issue


            • Created: