@David_Graeff we´ve just had a topic on binding dependencies and jar files. You´ve mentioned the kar files.
I´ve seen that the
maven karaf plugin can do remote deployments to a karaf instance. But only if kar files are used…
Do you know if I can change the packaging of my binding to kar and do remote deployment. (Sounds like a quite cool feature and a much better development workflow/experience).
There is a maven goal that I keep forgetting to generate kar files, by the mentioned maven plugin.
But remote deployment is new to me. How does the plugin know where to find the remote karaf instance?
Look at the end of
Problems with maven dependencies and bnd
We talked about the whole kar generation (worked for me)
Just have a look at this
This file has been truncated.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
=== Using the karaf-maven-plugin
The Karaf Maven plugin allows you:
* to work with Karaf features: verify and validate a features descriptor, add features bundle into a repository, create a KAR archive from a features descriptor, etc.
* to create Karaf commands help: it generates help from Karaf commands
Sounds promissing to me. There‘s a run goal too.
If you run Karaf locally and you would like to have hotdeploy then its sufficient to run inside Karaf
bundle:watch <binding-bundle-id> or simply
if you have bunch of things built within single maven execution.
And how do I send the changes to the bundle? I guess karaf is waiting for a change in the bundle and then restarts the bundle or do I get it wrong?
Karaf watches the local maven repository (usually in $HOME/.m2 on all operating systems). And Eclipse can be instructed to install a bundle to the local maven repo whenever you click “Debug”. (I think that’s even the default for maven in Eclipse?!)
Indeed - you need to install bundle into local maven repository. There are various ways - ie
run as >
maven build >
mvn install. You can also build new snapshot via command line.
That’s really cool. Installing to local maven and using watch seems to be a good way for me…