<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>ru.entaxy.ion.distribution</groupId>
    <artifactId>entaxy-ion-platform-dist</artifactId>
    <version>1.12.0</version>
  </parent>
  <artifactId>entaxy-ion-platform-compact</artifactId>
  <packaging>karaf-assembly</packaging>
  <name>ENTAXY :: DISTRIBUTION :: PLATFORM COMPACT</name>
  <description>ENTAXY :: DISTRIBUTION :: PLATFORM COMPACT</description>
  
  	<dependencies>
		  
        <dependency>
            <groupId>org.apache.karaf.features</groupId>
            <artifactId>framework</artifactId>
            <version>${karaf.version}</version>
            <classifier>features</classifier>
            <type>xml</type>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.karaf.features</groupId>
            <artifactId>standard</artifactId>
            <version>${karaf.version}</version>
            <classifier>features</classifier>
            <type>xml</type>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.karaf.features</groupId>
            <artifactId>spring</artifactId>
            <version>${karaf.version}</version>
            <classifier>features</classifier>
            <type>xml</type>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.karaf.features</groupId>
            <artifactId>enterprise</artifactId>
            <version>${karaf.version}</version>
            <classifier>features</classifier>
            <type>xml</type>
            <scope>compile</scope>
        </dependency>
		  
		<dependency>
			<groupId>ru.entaxy.esb</groupId>
			<artifactId>ui</artifactId>
			<version>${entaxy.ui.version}</version>
			<classifier>features</classifier>
			<type>xml</type>
			<scope>runtime</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.activemq</groupId>
			<artifactId>artemis-features</artifactId>
			<version>${artemis.onboard.version}</version>
			<classifier>features</classifier>
			<type>xml</type>
			<scope>runtime</scope>
		</dependency>
		<dependency>
			<groupId>ru.entaxy.ion.distribution</groupId>
			<artifactId>entaxy-ion-platform-compact-features</artifactId>
			<version>${project.version}</version>
			<type>xml</type>
			<classifier>features</classifier>
			<scope>compile</scope>
		</dependency>
        <dependency>
            <groupId>ru.entaxy.ion.distribution</groupId>
            <artifactId>entaxy-ion-karaf-features</artifactId>
            <version>${project.version}</version>
            <type>xml</type>
            <classifier>features</classifier>
            <scope>compile</scope>
        </dependency>
		<dependency>
			<groupId>ru.entaxy.esb</groupId>
			<artifactId>entaxy-documentation</artifactId>
			<version>${entaxy.documentation.version}</version>
			<classifier>features</classifier>
			<type>xml</type>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>ru.entaxy.esb</groupId>
			<artifactId>camel-documentation</artifactId>
			<version>${camel.documentation.version}</version>
			<classifier>features</classifier>
			<type>xml</type>
			<scope>provided</scope>
		</dependency>
  	</dependencies>
  
	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-antrun-plugin</artifactId>
				<executions>
					<execution>
						<!-- disable merge startup.properties 'cause we generate the full file here -->
						<id>merge_startup</id>
						<phase>NONE</phase>
						<goals>
							<goal>run</goal>
						</goals>
						<configuration>
						</configuration>
					</execution>	
					
					<!-- add Artemis log settings to org.ops4j.pax.logging.cfg -->
					<execution>
				        <id>append_artemis_log_settings</id>
				        <phase>prepare-package</phase>
				        <goals>
					        <goal>run</goal>
				        </goals>
						<configuration>
							<target>
								<copy file="${project.build.directory}/assembly/etc/org.ops4j.pax.logging.cfg" 
									tofile="${project.build.directory}/temp/org.ops4j.pax.logging.cfg/fragment_1.cfg" />
								<copy file="${project.basedir}/src/main/append/etc/org.ops4j.pax.logging.cfg" 
									tofile="${project.build.directory}/temp/org.ops4j.pax.logging.cfg/fragment_2.cfg" />

								<!-- update file in etc -->
								<delete file="${project.build.directory}/assembly/etc/org.ops4j.pax.logging.cfg" /> 
                                <concat destfile="${project.build.directory}/assembly/etc/org.ops4j.pax.logging.cfg"
                                        force="yes">
                                    <fileset dir="${project.build.directory}/temp/org.ops4j.pax.logging.cfg">
                                        <include name="**/*.cfg"></include>
                                    </fileset>
                                </concat>

								<!-- update file in system -->
								<delete file="${project.build.directory}/assembly/system/ru/entaxy/esb/underlying/entaxy-underlying-configuration/${entaxy.underlying.version}/entaxy-underlying-configuration-${entaxy.underlying.version}-org.ops4j.pax.logging.cfg" /> 
								<copy file="${project.build.directory}/assembly/etc/org.ops4j.pax.logging.cfg" 
									tofile="${project.build.directory}/assembly/system/ru/entaxy/esb/underlying/entaxy-underlying-configuration/${entaxy.underlying.version}/entaxy-underlying-configuration-${entaxy.underlying.version}-org.ops4j.pax.logging.cfg" />
							</target>
						</configuration>
					</execution>
						
				</executions>
			</plugin>
		
			<plugin>
				<groupId>org.apache.karaf.tooling</groupId>
				<artifactId>karaf-maven-plugin</artifactId>
				<extensions>true</extensions>

				<configuration>
					<installAllFeaturesByDefault>false</installAllFeaturesByDefault>
					<installedFeatures>
						<!-- @COPY from parent -->								
		                <!-- @backward-compat -->
		                <feature>entaxy-backward-compatibility-modules</feature>

						<feature>entaxy-documentation</feature>
						<feature>camel-documentation</feature>
					</installedFeatures>
					<bootFeatures combine.children="append">
						<!-- will be installed with entaxy-hawtio-artemis-support -->
						<feature>entaxy-ui</feature>
						<feature>artemis/${artemis.onboard.version}</feature>
						<!-- don't know why but it's needed for hawtio plugin -->
						<feature>artemis-stomp/${artemis.onboard.version}</feature>
						<feature>entaxy-hawtio-artemis-support</feature>
		                <feature>entaxy-ion-karaf</feature>
		                <feature>entaxy-platform</feature>								

						<feature>entaxy-ion-platform-compact-features</feature>
					</bootFeatures>
					<startupFeatures>
						<feature>framework</feature>
                        <feature>wrap</feature>
                        <feature>classpath</feature>
                        <feature>shell</feature>
                        <feature>shell-compat</feature>
						
                        <feature>entaxy-underlying-configuration</feature>
                        <feature>scheduler</feature>
                        <feature>eventadmin</feature>
                        <feature>aries-blueprint</feature>

                        <feature>entaxy-ion-karaf-startup</feature>

                        <feature version="${spring.bundles.version}">spring</feature>
                        <feature version="${spring.bundles.version}">spring-jdbc</feature>
                        <feature version="${spring.bundles.version}">spring-tx</feature>								
						<feature>entaxy-ion-karaf-startup-optimization-artemis</feature>
					</startupFeatures>	
					<installAllFeaturesByDefault>false</installAllFeaturesByDefault>
				</configuration>
			</plugin>
		</plugins>
	</build>
  
  
</project>
