You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by petertirrell <pt...@gmail.com> on 2014/08/14 04:53:52 UTC

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.

Re: How to transfer Karaf installation and setup to offline server?

Posted by Andreas Gies <an...@wayofquality.de>.
Hello,

you can find a complete example in a project I have created on github at 
[1].

The interesting pieces are in the _blended-karaf-parent_ module where 
all the required plugins
are configured. There is a sample container in the 
module_blended-karaf-demo_.

In the sample container you will find a directory src/main/resources/etc 
which holds replacement file
for the etc directory if you wanted to change certain configs within the 
underlying karaf distro.
Also, the setup uses the features-maven-plugin to prepopulate the system 
directory for offline usage.

Note, that this setup also creates an offline installer that does not 
require karaf to be running to use it.
I have simply reused the karaf code that was executed within the shell 
command and repackeaged that
into an offline installer. Perhaps you do not require that functionality.

If of interest, there is a module that packages the outcome of the 
package outlined above into a docker image
at _blended-docker/blended-docker-demo_. The intention is to be able to 
use that as a container within integration
tests.

An example integration test is in the module _blended/blended-akka-itest_.


Some preliminary documentation for the project is at [2], but I haven't 
found the time to write the docs for the packaging and integration tests.
If you want to have a look at the latest build outputs to see what the 
maven build looks like, look at [3].

[1] https://github.com/woq-blended/blended
[2] http://www.wayofquality.de/projects/blended/index.html
[3] http://ci.wayofquality.de:8081/jenkins/

Best regards & Happy Hacking
Andreas

On 14/08/14 04:53, petertirrell wrote:
> 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.
>

-- 


    Andreas Gies

WoQ -- Way of Quality GmbH

Geschäftsführer & CTO

/eMail:/andreas@wayofquality.de <ma...@wayofquality.de>

/Tel:/ +49 151 23470823

/Fax:/ +49 1805 006534 2114

/Twitter:/ andreasgies /Skype:/ giessonic

/LinkedIn:/ <http://de.linkedin.com/pub/andreas-gies/0/594/aa5/> 
(http://de.linkedin.com/pub/andreas-gies/0/594/aa5/)

/Xing:/ <http://www.xing.com/profile/Andreas_Gies> 
(http://www.xing.com/profile/Andreas_Gies)

/Blog:/ <http://www.wayofquality.de/index.php/en/blog> 
(http://www.wayofquality.de/index.php/en/blog)

/Github:/ <https://github.com/atooni> (https://github.com/atooni)

/Amtsgericht Landshut:/HRB 8352//

//

/Ust.-Id.:/ DE274771254


      Haftungsausschluss

Diese Email kann vertrauliche und/oder rechtlich geschützte 
Informationen enthalten und ist ausschließlich für den/die benannten 
Adressaten bestimmt. Sollten Sie nicht der beabsichtigte Empfänger sein 
oder diese Email irrtümlich erhalten haben, ist es Ihnen nicht gestattet 
diese Mail oder einen Teil davon ohne unsere Erlaubnis zu verbreiten, zu 
kopieren, unbefugt weiterzuleiten oder zu behalten. Informieren Sie 
bitte sofort den Absender telefonisch oder per Email und löschen Sie 
diese Email und alle Kopien aus Ihrem System. Wir haften nicht für die 
Unversehrtheit von Emails, nachdem sie unseren Einflussbereich verlassen 
haben.


      Disclaimer

This email may contain confidential and/or privileged information and is 
intended solely for the attention and use of the named addressee(s). If 
you are not the intended recipient, or a person responsible for 
delivering it to the intended recipient, you are not authorized to and 
must not disclose, copy, distribute, or retain this message or any part 
of it without our authority. Please contact the sender by call or reply 
email immediately and destroy all copies and the original message. We 
are not responsible for the integrity of emails after they have left our 
sphere of control.

//

Re: How to transfer Karaf installation and setup to offline server?

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi,

you can create your own distribution (as we do in ServiceMix) to 
populate the system repo. Like this you have your own atomic and 
standalone Karaf runtime.

You can also create kar files that you drop in the deploy folder.

Another possible way is to create a Maven repository on the filesystem 
that you refer into etc/org.ops4j.pax.url.mvn.cfg.

Regards
JB

On 08/14/2014 04:53 AM, petertirrell wrote:
> 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.
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

RE: How to transfer Karaf installation and setup to offline server?

Posted by XiLai Dai <xl...@talend.com>.
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:ptirrell@gmail.com] 
Sent: Thursday, August 14, 2014 10:54 AM
To: user@karaf.apache.org
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.