Hi,
I think the best way is building your own karaf distribution and use it in
Test/Production env.
1) using karaf-maven-plugin to assemble 3rd party and your apps
features/bundles into karaf_home/system, an sample:
<plugin>
<groupId>org.apache.karaf.tooling</groupId>
<artifactId>karaf-maven-plugin</artifactId>
<version>${karaf.version}</version>
<extensions>true</extensions>
<executions>
<execution>
<id>add-features-to-repo</id>
<phase>process-resources</phase>
<goals>
<goal>features-add-to-repository</goal>
</goals>
<configuration>
<descriptors>
<descriptor>mvn:org.apache.cxf.karaf/apache-cxf/2.7.12/xml/features
</descriptor>
<descriptor>mvn:com.your.company/app.feature/${version}/xml/features</descriptor>
......
</descriptors>
<features>
<feature>cxf-http</feature>
<feature>cxf-jawrs</feature>
<feature>abc</feature>
......
</features>
<repository>target/features-repo</repository>
</configuration>
</execution>
</executions>
</plugin>
2) make change to etc/ org.ops4j.pax.url.mvn.cfg
org.ops4j.pax.url.mvn.localRepository=file:${karaf.home}/${karaf.default.repository}@id=system.repository
(with this configure, karaf will look up the system/ at first, and then local
maven repo (.m2), then remote maven centre)
Regards.
Xilai Dai
-----Original Message-----
From: petertirrell [mailto:[email protected]]
Sent: Thursday, August 14, 2014 10:54 AM
To: [email protected]
Subject: How to transfer Karaf installation and setup to offline server?
I'm a bit new to working with Karaf, but have set up locally a Karaf 3
installation (on Windows) and have developed an application consisting of a
number of OSGI bundles. So now I want to move what I have set up to test and
production tier servers. The thing is, these servers have no internet
connection enabled; they are internal only.
As part of my bundle requirements, I created a REST endpoint so I used the
feature repo and install for cxf and http. When I tried this when setting up
on my test server it of course complained about not being able to download the
package. Next I tried creating a kar archive of the cxf feature, which
appeared to work, except that when I drop that in the deploy folder on the test
server it still didn't work and complained about not being able to find the
maven URL for the package.
So ultimately, is there a definitive way I should be going about setting up
Karaf and my application (and dependencies) on a standalone server once I've
done my development? I have the stock Karaf install, the cxf repo with cxf and
http features installed, probably a half dozen separate maven libraries I had
to add, and my application code. I found the page about doing a custom
distribution
(http://karaf.apache.org/manual/latest/developers-guide/custom-distribution.html)
which maybe sounds like what I'm looking for, but do I ignore the deprecated
section? What is the most straightforward way to take an existing and working
karaf installation and set it up somewhere else when that destination won't
have Internet connectivity?
Thanks for any info,
--
View this message in context:
http://karaf.922171.n3.nabble.com/How-to-transfer-Karaf-installation-and-setup-to-offline-server-tp4034760.html
Sent from the Karaf - User mailing list archive at Nabble.com.