archetype-resources.pom.xml Maven / Gradle / Ivy
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <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/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>${groupId}</groupId> <artifactId>${artifactId}</artifactId> <version>${version}</version> <packaging>bundle</packaging> <name>Fabric8 :: Quickstarts :: Karaf :: Camel Log</name> <description>A simple Camel route in Karaf container</description> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <version.maven-bundle-plugin>2.3.7</version.maven-bundle-plugin> <!-- versions for use in mvn plugins as we cannot inherit them from a BOM --> <fabric8.version>2.2.53</fabric8.version> <docker.maven.plugin.version>0.13.6</docker.maven.plugin.version> <camel.version>2.16.0</camel.version> <karaf.version>2.4.3</karaf.version> <karaf.plugin.version>4.0.2</karaf.plugin.version> <docker.from>fabric8/s2i-karaf:1.1.1</docker.from> <fabric8.dockerPrefix>docker.io/</fabric8.dockerPrefix> <fabric8.dockerUser>fabric8/</fabric8.dockerUser> <docker.image>${fabric8.dockerPrefix}${fabric8.dockerUser}quickstart-karaf-camellog:${project.version}</docker.image> <docker.assemblyDescriptor>${basedir}/src/main/fabric8/assembly.xml</docker.assemblyDescriptor> <docker.port.container.jolokia>8778</docker.port.container.jolokia> <docker.port.container.http>8181</docker.port.container.http> <fabric8.env.AB_JOLOKIA_AUTH_OPENSHIFT>true</fabric8.env.AB_JOLOKIA_AUTH_OPENSHIFT> <fabric8.label.component>${project.artifactId}</fabric8.label.component> <fabric8.label.container>karaf</fabric8.label.container> <fabric8.label.group>quickstarts</fabric8.label.group> <fabric8.iconRef>camel</fabric8.iconRef> </properties> <dependencyManagement> <dependencies> <dependency> <groupId>io.fabric8</groupId> <artifactId>fabric8-project</artifactId> <version>${fabric8.version}</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> <dependencies> <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-core</artifactId> <version>${camel.version}</version> <scope>runtime</scope> </dependency> <!-- For this example, we will be using the OSGi Blueprint XML syntax for Apache Camel. --> <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-blueprint</artifactId> <version>${camel.version}</version> <scope>runtime</scope> </dependency> <!-- Karaf microcontainer dependencies --> <dependency> <!-- scope is compile so all features (there is only one) are installed into startup.properties, and the feature repo itself is not added in etc/org.apache.karaf.features.cfg file --> <groupId>org.apache.karaf.features</groupId> <artifactId>static</artifactId> <version>${karaf.plugin.version}</version> <type>kar</type> </dependency> <dependency> <groupId>org.apache.karaf.assemblies.features</groupId> <artifactId>standard</artifactId> <version>${karaf.version}</version> <classifier>features</classifier> <type>xml</type> </dependency> <dependency> <groupId>org.apache.camel.karaf</groupId> <artifactId>apache-camel</artifactId> <classifier>features</classifier> <type>xml</type> </dependency> </dependencies> <build> <finalName>${project.artifactId}</finalName> <resources> <resource> <directory>src/main/resources</directory> <filtering>true</filtering> </resource> </resources> <plugins> <!-- Compiler plugin enforces Java 1.7 compatibility and activates annotation processors --> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>3.3</version> <configuration> <source>1.7</source> <target>1.7</target> </configuration> </plugin> <plugin> <artifactId>maven-resources-plugin</artifactId> <version>2.7</version> <executions> <execution> <id>filter-extra-resources</id> <goals> <goal>copy-resources</goal> </goals> <phase>process-resources</phase> <configuration> <outputDirectory>${project.build.directory}/fabric8</outputDirectory> <resources> <resource> <directory>src/main/fabric8</directory> <filtering>true</filtering> </resource> </resources> </configuration> </execution> </executions> </plugin> <plugin> <groupId>org.apache.felix</groupId> <artifactId>maven-bundle-plugin</artifactId> <version>${version.maven-bundle-plugin}</version> <extensions>true</extensions> </plugin> <plugin> <groupId>io.fabric8</groupId> <artifactId>fabric8-maven-plugin</artifactId> <version>${fabric8.version}</version> <executions> <execution> <id>json</id> <phase>generate-resources</phase> <goals> <goal>json</goal> </goals> </execution> <execution> <id>attach</id> <phase>package</phase> <goals> <goal>attach</goal> </goals> </execution> </executions> </plugin> <!-- plugin goals have to be executed in order --> <!-- 1. install the bundle --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-install-plugin</artifactId> <version>2.5.2</version> <executions> <execution> <id>install-bundle</id> <goals> <goal>install</goal> </goals> </execution> </executions> </plugin> <!-- 2. create karaf assembly --> <!-- karaf-maven-plugin creates custom microservice distribution --> <plugin> <groupId>org.apache.karaf.tooling</groupId> <artifactId>karaf-maven-plugin</artifactId> <version>${karaf.plugin.version}</version> <extensions>true</extensions> <executions> <execution> <id>karaf-assembly</id> <goals> <goal>assembly</goal> </goals> <phase>install</phase> </execution> <execution> <id>karaf-archive</id> <goals> <goal>archive</goal> </goals> <phase>install</phase> </execution> </executions> <configuration> <!-- we are using karaf 2.4.x --> <karafVersion>v24</karafVersion> <useReferenceUrls>true</useReferenceUrls> <!-- do not include build output directory --> <includeBuildOutputDirectory>false</includeBuildOutputDirectory> <!-- no startupFeatures --> <startupFeatures> <feature>karaf-framework</feature> <feature>jaas</feature> <feature>aries-blueprint</feature> <feature>camel-blueprint</feature> </startupFeatures> <startupBundles> <bundle>mvn:${project.groupId}/${project.artifactId}/${project.version}</bundle> </startupBundles> <libraries> <library> mvn:org.apache.karaf.jaas/org.apache.karaf.jaas.boot/${karaf.version};type:=boot;export:=true;delegate:=true </library> </libraries> </configuration> </plugin> <!-- 3. create docker image --> <plugin> <groupId>org.jolokia</groupId> <artifactId>docker-maven-plugin</artifactId> <version>${docker.maven.plugin.version}</version> <configuration> <images> <image> <name>${docker.image}</name> <build> <from>${docker.from}</from> <env> <DEPLOY_DIR>/opt/jboss/deploy</DEPLOY_DIR> </env> <assembly> <basedir>/opt/jboss/deploy/</basedir> <user>jboss:jboss:jboss</user> <inline xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2" xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd"> <id>${project.artifactId}</id> <files> <!-- copy karaf archive --> <file> <source>${project.build.directory}/${project.artifactId}-${project.version}.tar.gz</source> <outputDirectory>/</outputDirectory> </file> </files> </inline> </assembly> <cmd> <shell>/opt/karaf/bin/deploy-and-run.sh</shell> </cmd> </build> </image> </images> </configuration> </plugin> </plugins> </build> <!-- Default sample commands: mvn -Pf8-build ... build Docker images and create OpenShift deployment configs mvn -Pf8-deploy ... f8-build + push to Docker registry + applying deployment config to OpenShift mvn -Pf8-local-deploy ... deployment for a single node setup without pushing to a registry For individual goal usage please consult the fabric8 documentation --> <profiles> <profile> <id>f8-build</id> <build> <defaultGoal>clean install docker:build fabric8:json</defaultGoal> </build> </profile> <profile> <id>f8-deploy</id> <properties> <fabric8.imagePullPolicySnapshot>Always</fabric8.imagePullPolicySnapshot> <fabric8.recreate>true</fabric8.recreate> </properties> <build> <defaultGoal>clean install docker:build docker:push fabric8:json fabric8:apply</defaultGoal> </build> </profile> <profile> <id>f8-local-deploy</id> <properties> <fabric8.recreate>true</fabric8.recreate> </properties> <build> <defaultGoal>clean install docker:build fabric8:json fabric8:apply</defaultGoal> </build> </profile> </profiles> </project>
© 2015 - 2025 Weber Informatics LLC | Privacy Policy