Have you tried to create a custom distribution of Karaf ? It's great to
use in offline environment.
Here an example of pom assembly :
-- <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.mycustom</groupId>
<artifactId>distrib</artifactId>
<version>1.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>org.mycustom.karaf.assembly</artifactId>
<packaging>karaf-assembly</packaging>
<name>Mycustom :: Karaf Distribution :: Assembly</name>
<description>Karaf Custom distribution assembly</description>
<dependencies>
<dependency>
<groupId>org.apache.karaf.features</groupId>
<artifactId>framework</artifactId>
<version>${karaf.version}</version>
<type>kar</type>
</dependency>
<dependency>
<groupId>org.apache.karaf.features</groupId>
<artifactId>enterprise</artifactId>
<version>${karaf.version}</version>
<classifier>features</classifier>
<type>xml</type>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.cxf.karaf</groupId>
<artifactId>apache-cxf</artifactId>
<classifier>features</classifier>
<version>${cxf-core.version}</version>
<type>xml</type>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.ops4j.pax.jdbc</groupId>
<artifactId>pax-jdbc-features</artifactId>
<classifier>features</classifier>
<version>${pax-jdbc.version}</version>
<type>xml</type>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.karaf.cellar</groupId>
<artifactId>apache-karaf-cellar</artifactId>
<classifier>features</classifier>
<version>${karaf-cellar.version}</version>
<type>xml</type>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>io.oxsoftware.kastle</groupId>
<artifactId>io.oxsoftware.kastle.features</artifactId>
<classifier>features</classifier>
<version>${project.parent.version}</version>
<type>xml</type>
<scope>runtime</scope>
</dependency>
</dependencies>
<build>
<!-- if you want to include resources in the distribution -->
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>false</filtering>
<includes>
<include>**/*</include>
</includes>
</resource>
<resource>
<directory>src/main/filtered-resources</directory>
<filtering>true</filtering>
<includes>
<include>**/*</include>
</includes>
</resource>
</resources>
<plugins>
<!-- if you want to include resources in the distribution -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
<executions>
<execution>
<id>process-resources</id>
<goals>
<goal>resources</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.karaf.tooling</groupId>
<artifactId>karaf-maven-plugin</artifactId>
<version>${karaf.version}</version>
<extensions>true</extensions>
<configuration>
<installedFeatures>
<feature>custom-distrib</feature>
<feature>custom-distrib-services</feature>
<feature>custom-distrib-rest</feature>
</installedFeatures>
<bootFeatures>
<feature>wrapper</feature>
<feature>wrap</feature>
<feature>aries-blueprint</feature>
<feature>shell</feature>
<feature>shell-compat</feature>
<feature>feature</feature>
<feature>jaas</feature>
<feature>ssh</feature>
<feature>management</feature>
<feature>bundle</feature>
<feature>config</feature>
<feature>deployer</feature>
<feature>diagnostic</feature>
<feature>instance</feature>
<feature>kar</feature>
<feature>log</feature>
<feature>package</feature>
<feature>service</feature>
<feature>system</feature>
<feature>eventadmin</feature>
<feature>scr</feature>
<feature>jdbc</feature>
<feature>jndi</feature>
<feature>transaction</feature>
<feature>war</feature>
<feature>cxf</feature>
<feature>cxf-jaxrs</feature>
<feature>cxf-rs-description-swagger2</feature>
<feature>pax-jdbc</feature>
<feature>pax-jdbc-config</feature>
<feature>pax-jdbc-pool-hikaricp</feature>
<feature>pax-jdbc-pool-aries</feature>
<feature>pax-jdbc-postgresql</feature>
<feature>cellar</feature>
</bootFeatures>
<libraries>
<library>mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.jaxrs-api-2.1/${servicemix.specs.jaxrs.version};type:=endorsed;export:=true</library>
<library>mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.json-api-1.1/${servicemix.specs.json.version};type:=endorsed;export:=true</library>
</libraries>
<javase>1.8</javase>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store Eclipse
m2e settings
only. It has no influence on the Maven build itself. -->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>
org.apache.karaf.tooling
</groupId>
<artifactId>
karaf-maven-plugin
</artifactId>
<versionRange>
[4.1.0,)
</versionRange>
<goals>
<goal>assembly</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore></ignore>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
Le 17/04/2018 à 10:30, nino martinez wael a écrit :
> Yes, I want to include at least first level dependencies for my kar /
> application.. But we need to be able todo an offline installation.
> With released applications.
>
> On Sat, Apr 14, 2018 at 6:41 PM, Francois Papon
> <francois.papon@openobject.fr <mailto:francois.papon@openobject.fr>>
> wrote:
>
> Hi,
>
> You want to include your repo into a kar ?
>
> François
>
>
> Le 13/04/2018 à 16:50, nino martinez wael a écrit :
>> I have this that does what I want.. BUT I think it's a hardcore
>> hack. Is there no way to make a packaged kar containing a repo
>> like below, using the resources parameter seems to be a hack?
>>
>> <plugin>
>> <groupId>org.apache.karaf.tooling</groupId>
>> <artifactId>karaf-maven-plugin</artifactId>
>> <extensions>true</extensions>
>> <version>${karaf.version}</version>
>> <executions>
>> <execution>
>> <id>features-add-to-repo</id>
>> <goals>
>> <goal>features-add-to-repository</goal>
>> </goals>
>> <configuration>
>> <descriptors>
>> <descriptor>mvn:org.apache.karaf.features/standard/4.2.0/xml/features</descriptor>
>> <descriptor>mvn:com.netdesign.ccadmin/ccadmin-karaf-feature/3.0.0-SNAPSHOT/xml/features</descriptor>
>> </descriptors>
>> <features>
>> <feature>ccadmin</feature>
>> </features>
>> <repository>${project.build.directory}/classes/repository</repository>
>> </configuration>
>> </execution>
>> <execution>
>> <id>kar</id>
>> <goals>
>> <goal>kar</goal>
>> </goals>
>> </execution>
>> </executions>
>> </plugin>
>>
>
>
>
>
> --
> Best regards / Med venlig hilsen
> Nino Martinez
|