Apache Felix File Install example - osgi

Is there any example of how to configure/install Apache Felix File install? In official website, it has been mentioned you need to configure properties etc. But no way they have mentioned where you need to put those configuration properties, how to set it up etc.
I have downloaded org.apache.felix.fileinstall-3.2.6.jar file and I have felix framework installed. Now I am not getting where should I put those configuration properties so that file install will read that.
Can anyone guide me on this?

As specified in the File Install Docs you can provide the configuration via system properties. Below steps work for Felix started from standard distribution
Download Felix from here
Unzip the content
Download the File Install bundle from here and copy it to the bundle folder. By default Felix would auto deploy all bundles from this folder.
Create a folder named deploy. This directory would be configured with File install
Start Felix java -Dfelix.fileinstall.dir=./deploy -jar bin/felix.jar.
Now any jar which is added to the deploy folder would be installed by the File Install bundle

Related

Can't force Apache Karaf to load a new version of the bundle (version w/o "-SNAPSHOT")

I've tried to update bundle in Karaf without changing its version. Version doesn't contain "-SNAPSHOT".
Is there a way to do it?
I've installed bundle to Apache Karaf through the mvn link
The code inside this bundle was changed without changing its (bundle's) version (according to some inner reasons).
Then I removed this bundle from Karaf, and from Nexus.
Next step was deploying new bundle to Nexus.
When I finally tried to install the "new" bundle, I saw there were no changes in it.
It looks like there is some cache inside Karaf where he stores bundles, that was already installed.
Adding flags like -c or -cc doesn't help.

maven and bower task

I 'm using Spring Boot and Angularjs with bower plugins.
In static directory, 'bower_components' use many space.
How to optimize build please (without extra plugins files)?
You can use bower-installer which is a node package to control which files to be copied to your static resources folder from the downloaded distribution package folder. Please look into below link.
https://www.npmjs.com/package/bower-installer
I followed below steps to select which files to be copied to my lib folder
1) Install bower-installer by runnnig npm install -g bower-installer command
2) Create 'bower_components' folder outside of your src folder.
3) Edit bower.json configuration file(in the 'bower_component's folder ) and specify path for each js library components.
4) Run bower-installer from terminal
Please let me know if you need more details.

Apache karaf how to easily install bundle from Maven repo

I am trying out Karaf and installed some bundle X. This bundle X complains about a missing requirement: Unresolved requirements ... osgi.wiring.package; (osgi.wiring.package=org.apache.commons.httpclient)]
Hence, I tried to provide the org.apache.commons.httpclient through bundle:install mvn:commons-httpclient/commons-httpclient/3.1 which worked.
But, after trying to start the X again, I still get the same error message.
thanks!
That jar is not a bundle, hence can't be deployed to karaf, it's just ignored.
Try
karaf#root>bundle:install -s mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-httpclient/3.1_7
Make it sure that your bundle has in their META-INF/MANIFEST.MF the osgi import declarations syntax. I assume that you use bndtools to generate the bundle.
Agree with #Antonio, for third party libraries which are not OSGi bundles you can also try to install them with wrap:
bundle:install -s wrap:mvn:commons-httpclient/commons-httpclient/3.1
This will create a basic OSGi MANIFEST for the library...
You can find more info here: http://karaf.apache.org/manual/latest/developers-guide/creating-bundles.html

how to install a plugin in elasticsearch

i have downloaded the zip package for hello world plugin from https://github.com/brusic/elasticsearch-hello-world-plugin/blob/master/src/main/java/org/elasticsearch/plugin/helloworld/HelloWorldPlugin.java
and have installed maven also but i want to know where to unzip this package and which command will be used to install and run it.I am working on windows so please provide a stepwise procedure according to it.please help
Check the project from github, build it, place the jar from the directory
elasticsearch-hello-world-plugin/target
Into the lib folder in Elastcsearch
elasticsearch/lib
Restart Elasticsearch

Build a Hadoop Ecplise Library from CDH4 jar files

I am trying to build a Hadoop library of all the jar files that I need to a build map/reduce job in Eclipse.
What are the .jar files that I need AND from what folders of the single node install of CDH4 when installed Hadoop on Ubuntu?
Assuming you've downloaded the CDH4 tarball distro from https://ccp.cloudera.com/display/SUPPORT/CDH4+Downloadable+Tarballs
Unpack the tarball
locate the build.properties file in the unpacked directory:
hadoop-2.0.0-cdh4.0.0/src/hadoop-mapreduce-project/src/contrib/eclipse-plugin
Add a property to this file for your eclipse installation directory:
eclipse.home=/opt/eclipse/jee-indigo-SR2
Finally run ant from the hadoop-2.0.0-cdh4.0.0/src/hadoop-mapreduce-project directory to build the jar
You'll now have a jar in the hadoop-2.0.0-cdh4.0.0/src/hadoop-mapreduce-project/build/contrib/eclipse-plugin/ folder
To finally answer your question, the dependency jars are now in:
hadoop-2.0.0-cdh4.0.0/src/hadoop-mapreduce-project/build/contrib/eclipse-plugin/
And to be really verbose if you want the list, see this pastebin

Resources