How to install bundles from netbeans with maven-sling-plugin

Custom Maven Goal Definition

  1. In Netbeans open the options dialog in Tools - Options.
  2. Go to the Miscellaneous category and select the Maven tab.
  3. Open the Global Custom Goal Definitions dialog.
  4. Click Add... to add a new goal definition. Enter a custom name (e.g. "install sling") for the goal in the dialog that open and confirm with Ok.
  5. Select the action just created (install sling in this example) and in the Execute Goals text field enter: "install org.apache.sling:maven-sling-plugin:install ".
  6. in Set Properties enter (adapt the url property to the host and port of the instance you want to deploy the bundle on): 
  7. Confirm with Ok.

     

Using the Custom Maven Goal to Deploy a Bundle

To build and then automatically deploy a bundle from Netbeans, use the custom goal defined earlier. It can be triggered by right-clicking on the project in Netbeans, then choosing Custom - install sling. "install sling" may differ depending on how the action has been named before. If the bundle has not been installed before, the run-level may need to be changed. this can be done in the felix shell with the command bundlelevel <level> <bundleid> (e.g. bundlelevel 3 146). Use bundlelevel 3 for custom bundles.


 



Labels

 
(None)