Hi, you can use Pax Exam[1] for that and start Karaf embedded, this will give you a clean state for every run. The other way would be to have a Karaf with Jolokia running and deploy via JMX, I once created a sample for that [2].
regards, Achim [1] - https://ops4j1.jira.com/wiki/display/PAXEXAM4/Pax+Exam [2] - https://github.com/ANierbeck/Karaf-Microservices-Tooling/tree/master/karaf-deployer-maven-plugin 2016-09-20 9:05 GMT+02:00 <t...@quarendon.net>: > What's the best way of deploying an application from a CI build such as > Jenkins, > into Karaf, for the purposes of testing? > > I was hoping to set something up so that I have a jenkins job that builds > my > application and then deploys the built application to a test instance on > karaf. > The karaf would be running on a separate machine, so I would most likely > write a > simple piece of java, either as an ANT task or similar that uses the JMX > management bean interface to interact with karaf (seems more reliable than > trying to script the shell interface and detect errors). > > My question really is what the best was of transferring things was. > Naively I > assumed that I would publish the artifacts into artifactory as snapshots > and > then pull them from there using mvn: URLs, but maybe I just don't know > enough > about how maven repositories work, as I'm getting into difficulties with > the > artifacts being cached, so that what is deployed is what has just been > built. > > I could probably pull them directly from jenkins using the > "lastSuccessfulBuild/artifacts" URLs, and maybe that the best way? > > Any thoughts? > Thanks. > -- Apache Member Apache Karaf <http://karaf.apache.org/> Committer & PMC OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer & Project Lead blog <http://notizblog.nierbeck.de/> Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS> Software Architect / Project Manager / Scrum Master