Time for action - building and deploying the bundle

Open up a command shell and go to the project base directory (in my case, it's C:projectsfelixbooksourcescom.packtpub.felixguide.bookshelf-inventory-api).

Run the following command to first clean the previous build temporary file (in this case, it's the first build, so there are none), then go through the build lifecycle up to deploy:

mvn clean deploy

The final outcome is the deployment of the bundle artifact to the repository under file:///C:/projects/felixbook/releases/com/packtpub/felix/com.packtpub.felix.bookshelf-inventory-api/1.5.0/com.packtpub.felix.bookshelf-inventory-api-1.5.0.jar and its registration on the repository for later use.

What just happened?

We've just used Maven to build, package, and deploy our bundle. It's that easy.

The repository it has deployed to is listed in the last parts of the build steps; look for logs like the following:

...
[INFO] [bundle:deploy]
[INFO] LOCK file:///C:/projects/felixbook/releases/repository.xml
[INFO] Downloading repository.xml
[INFO] Computed bundle uri: file:/C:/projects/felixbook/releases/com/packtpub/felix/com.packtpub.felix.bookshelf-inventory-api/1.5.0/com.packtpub.felix.bookshelf-inventory-api-1.5.0.jar
[INFO] Writing OBR metadata
[INFO] Deploying file:/C:/projects/felixbook/releases/com/packtpub/felix/com.packtpub.felix.bookshelf-inventory-api/1.5.0/com.packtpub.felix.bookshelf-inventory-api-1.5.0.jar
[INFO] Writing OBR metadata
[INFO] Uploading repository.xml
[INFO] UNLOCK file:///C:/projects/felixbook/releases/repository.xml
[INFO] ----------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL

...

My OBR repository will be file:///C:/projects/felixbook/releases/repository.xml. This is the repository that we'll feed into Felix's bundle repository service as an additional source of bundles. We will cover OBRs in more details in Chapter 6,Using the OSGi Bundle Repository.

For now, let's carry on and create another bundle, the one for the inventory implementation.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.141.3.175