Hi JB,
I want to adapt the Karaf distribution to some "project" constraints.
This is my intention.
I created the custom distribution using karaf-assembly of the
karaf-maven-plugin.
For testing I changed the directory layout using
"maven-assembly-plugin" on the artifact.
So, unpack the artifact and repack it with a new directory layout.
The startup script I used (see below) changed KARAF_BASE, KARAF_HOME,
KARAF_ETC and KARAF_DATA to point to the new directories.
The the assembly XML it attached below, too.
If I start Karaf now, I see the following warning / error message
before the console prompt occurs (I shortened the path):
Unable to update instance pid: Child instance started but no root
registered in /home/maggu2810/.../karaf/home/instances/instance.properties
At the moment it seems to work, but how can I get rid of this message
about the instances and what does it mean at all?
Best regards,
Markus
=== assembly XML ===
<assembly>
<id>bin</id>
<formats>
<format>tar.gz</format>
<format>zip</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<fileSet>
<directory>target/dependencies/${repack.artifactId}-${repack.version}</directory>
<outputDirectory>/</outputDirectory>
<excludes>
<exclude>bin/**</exclude>
<exclude>data/**</exclude>
<exclude>deploy/**</exclude>
<exclude>etc/**</exclude>
<exclude>lib/**</exclude>
<exclude>system/**</exclude>
</excludes>
</fileSet>
<fileSet>
<directory>target/dependencies/${repack.artifactId}-${repack.version}</directory>
<outputDirectory>/karaf/base</outputDirectory>
<includes>
<include>deploy/**</include>
</includes>
</fileSet>
<fileSet>
<directory>target/dependencies/${repack.artifactId}-${repack.version}</directory>
<outputDirectory>/karaf/home</outputDirectory>
<includes>
<include>bin/**</include>
<include>lib/**</include>
<include>system/**</include>
</includes>
</fileSet>
<fileSet>
<directory>target/dependencies/${repack.artifactId}-${repack.version}</directory>
<outputDirectory>/karaf/data</outputDirectory>
<includes>
<include>data/**</include>
</includes>
</fileSet>
<fileSet>
<directory>target/dependencies/${repack.artifactId}-${repack.version}</directory>
<outputDirectory>/karaf/etc</outputDirectory>
<includes>
<include>etc/**</include>
</includes>
</fileSet>
</fileSets>
<files>
<file>
<source>src/main/resources/start.sh</source>
<outputDirectory>/</outputDirectory>
<fileMode>0755</fileMode>
<lineEnding>unix</lineEnding>
</file>
</files>
</assembly>
=== startup script ===
#!/bin/sh
DIRNAME=`dirname "$0"`
cd "${DIRNAME}"
DIRNAME="${PWD}"
cd "${OLDPWD}"
TEST_HOME="${DIRNAME}"
export KARAF_HOME="${TEST_HOME}/karaf/home"
export KARAF_DATA="${TEST_HOME}/karaf/data/data"
export KARAF_BASE="${TEST_HOME}/karaf/base"
export KARAF_ETC="${TEST_HOME}/karaf/etc/etc"
exec "${KARAF_HOME}"/bin/karaf
2015-09-20 7:06 GMT+02:00 Jean-Baptiste Onofré <[email protected]>:
> Hi Markus,
>
> for the deploy folder, just remove
> etc/org.apache.felix.fileinstall-deploy.cfg file and the deploy folder:
> deploy will be disable. I also advise to not deploy the deployer bundles (as
> it's no more used).
>
> For the distribution layout, starting for the framework kar, it's not really
> possible as the kar already have the layout.
> I will create Jira to improve that and allow the plugin to change the target
> locations.
>
> The purpose of the current variables is more to be able to adapt to your
> machine/administrator constraint: put KARAF_ETC in /etc/karaf, put
> KARAF_BASE in /var/karaf and KARAF_HOME in /home/karaf for instance (by
> moving the directories).
>
> Regards
> JB
>
>
> On 09/18/2015 07:44 PM, Markus Rathgeb wrote:
>>
>> Hello,
>> I would like to change the directory layout of my custom distribution.
>>
>> Changing "etc/org.apache.felix.fileinstall-deploy.cfg" I could set
>> another felix.fileinstall.dir.
>> But how can I remove the "deploy" directory?
>>
>> Using bin/setsenv[.bat] I can change KARAF_BASE, KARAF_HOME and KARAF_ETC.
>> But how can I change the assembly so e.g. etc is changed to something_etc,
>> the stuff for KARAF_HOME is packed to something_home and
>> the stuff for KARAF_BASE is packed to something_base.
>>
>> How can I change the directory name in the created archives (.tar.gz
>> and zip) or instruct the plugin to not create a sub directory at all?
>>
>> Thanks in advance,
>> Markus
>>
>
> --
> Jean-Baptiste Onofré
> [email protected]
> http://blog.nanthrax.net
> Talend - http://www.talend.com