All Downloads are FREE. Search and download functionalities are using the official Maven repository.

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/xsd/maven-4.0.0.xsd">

  <modelVersion>4.0.0</modelVersion>

  <groupId>${groupId}</groupId>
  <artifactId>${artifactId}</artifactId>
  <version>${version}</version>
  <packaging>bundle</packaging>
  <name>Fabric8 :: Quickstarts :: JBoss Fuse :: CXF REST</name>
  <description>REST example using CXF in Karaf container</description>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <version.maven-bundle-plugin>2.3.7</version.maven-bundle-plugin>

    <!-- configure the versions you want to use here -->
    <fuse.version>6.2.1.redhat-117</fuse.version>
    <fabric8.version>2.2.150</fabric8.version>
    <cxf.plugin.version>${cxf-plugin-version}</cxf.plugin.version>
    <karaf.plugin.version>4.0.2.redhat-621079</karaf.plugin.version>

    <!-- maven plugin versions -->
    <fabric8.maven.plugin.version>3.1.17</fabric8.maven.plugin.version>
    <maven-compiler-plugin.version>3.3</maven-compiler-plugin.version>
    <maven-surefire-plugin.version>2.18.1</maven-surefire-plugin.version>
    <exec-maven-plugin.version>1.4.0</exec-maven-plugin.version>
  </properties>

  <dependencyManagement>
    <dependencies>
      <!-- fabric8 bom must be before fabric8 bom -->
      <dependency>
        <groupId>io.fabric8</groupId>
        <artifactId>fabric8-project-bom-with-platform-deps</artifactId>
        <version>${fabric8.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>org.jboss.fuse.bom</groupId>
        <artifactId>jboss-fuse-parent</artifactId>
        <version>${fuse.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>

    <!-- cxf -->
    <dependency>
      <groupId>org.apache.cxf</groupId>
      <artifactId>cxf-core</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.cxf</groupId>
      <artifactId>cxf-rt-transports-http</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.cxf</groupId>
      <artifactId>cxf-rt-frontend-jaxrs</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.cxf</groupId>
      <artifactId>cxf-rt-rs-service-description</artifactId>
    </dependency>

    <!-- swagger -->
    <dependency>
      <groupId>io.swagger</groupId>
      <artifactId>swagger-jaxrs</artifactId>
      <version>1.5.4</version>
      <optional>true</optional>
      <exclusions>
        <!-- avoid this old dependency which breaks CXF -->
        <exclusion>
          <groupId>javax.ws.rs</groupId>
          <artifactId>jsr311-api</artifactId>
        </exclusion>
      </exclusions>
    </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.jboss.fuse</groupId>
      <artifactId>fuse-karaf-framework</artifactId>
      <version>${fuse.version}</version>
      <type>kar</type>
      <!-- no need to download kar dependencies -->
      <exclusions>
        <exclusion>
          <groupId>*</groupId>
          <artifactId>*</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

  </dependencies>

  <build>

    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
      </resource>
    </resources>
    <defaultGoal>install</defaultGoal>

    <plugins>
      <!-- Compiler plugin enforces Java 1.8 compatibility and activates annotation processors -->
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.3</version>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.18.1</version>
      </plugin>

      <!-- Need to setup the OSGi meta information here -->
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <version>${version.maven-bundle-plugin}</version>
        <extensions>true</extensions>
        <configuration>
          <instructions>
            <Import-Package>
              javax.ws.rs;version="[2,3)",
              javax.ws.rs.core;version="[2,3)",
              javax.ws.rs.ext;version="[2,3)",
              javax.xml.bind.annotation,
              org.osgi.service.blueprint,
              io.swagger.jaxrs.config,
              io.swagger.jaxrs.listing,
              io.swagger.annotations,
              org.apache.cxf.transport.http,
              com.fasterxml.jackson.annotation,
              com.fasterxml.jackson.core,
              com.fasterxml.jackson.databind,
              com.fasterxml.jackson.jaxrs.json,
              *
            </Import-Package>
            <Export-Package>
              ${package}
            </Export-Package>
          </instructions>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-java2wadl-plugin</artifactId>
        <version>${cxf.plugin.version}</version>
        <executions>
          <execution>
            <id>parsejavadoc</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>parsejavadoc</goal>
            </goals>
          </execution>
          <execution>
            <id>process-classes</id>
            <phase>process-classes</phase>
            <goals>
              <goal>java2wadl</goal>
            </goals>
            <configuration>
              <classResourceNames>
                <classResourceName>${package}.CustomerService</classResourceName>
              </classResourceNames>
              <docProvider>org.apache.cxf.maven_plugin.javatowadl.ResourceMapJavaDocProvider</docProvider>
              <attachWadl>false</attachWadl>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <!-- attach feature file to install for karaf assembly -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>1.9.1</version>
        <executions>
          <execution>
            <id>attach-artifacts</id>
            <phase>package</phase>
            <goals>
              <goal>attach-artifact</goal>
            </goals>
            <configuration>
              <artifacts>
                <artifact>
                  <file>${project.build.outputDirectory}/features.xml</file>
                  <classifier>features</classifier>
                  <type>xml</type>
                </artifact>
              </artifacts>
            </configuration>
          </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>default-install</id>
            <goals>
              <goal>install</goal>
            </goals>
            <phase>install</phase>
          </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>
          <archiveTarGz>false</archiveTarGz>
          <!-- do not include build output directory -->
          <includeBuildOutputDirectory>false</includeBuildOutputDirectory>
          <startupRepositories>
            <repo>mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features</repo>
          </startupRepositories>
          <!-- no startupFeatures -->
          <startupFeatures>
            <feature>karaf-framework</feature>
            <feature>jaas</feature>
            <feature>shell</feature>
            <feature>aries-blueprint</feature>

            <feature>cxf-core</feature>
            <feature>cxf-jaxrs</feature>
            <feature>cxf-http-jetty</feature>

            <!-- swagger -->
            <feature>http</feature>
            <feature>cxf-specs</feature>
            <feature>swagger2</feature>
          </startupFeatures>
          <startupBundles>
            <bundle>mvn:${project.groupId}/${project.artifactId}/${project.version}</bundle>
          </startupBundles>
        </configuration>
      </plugin>

      <!-- 3. create docker image -->
      <plugin>
        <groupId>io.fabric8</groupId>
        <artifactId>fabric8-maven-plugin</artifactId>
        <version>${fabric8.maven.plugin.version}</version>
        <executions>
          <execution>
            <id>generate-resource</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>resource</goal>
            </goals>
          </execution>
          <execution>
            <id>build-image</id>
            <phase>install</phase>
            <goals>
              <goal>build</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>fusesource.repo</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <repositories>
        <repository>
          <id>fusesource.m2</id>
          <name>FuseSource Community Release Repository</name>
          <url>https://repo.fusesource.com/nexus/content/groups/public</url>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
          <releases>
            <enabled>true</enabled>
            <updatePolicy>never</updatePolicy>
          </releases>
        </repository>
        <repository>
          <id>fusesource.ea</id>
          <name>FuseSource Community Early Access Release Repository</name>
          <url>https://repo.fusesource.com/nexus/content/groups/ea</url>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
          <releases>
            <enabled>true</enabled>
            <updatePolicy>never</updatePolicy>
          </releases>
        </repository>
        <repository>
          <id>redhat.ga</id>
          <name>Red Hat General Availability Repository</name>
          <url>https://maven.repository.redhat.com/ga</url>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
          <releases>
            <enabled>true</enabled>
            <updatePolicy>never</updatePolicy>
          </releases>
        </repository>
      </repositories>
      <pluginRepositories>
        <pluginRepository>
          <id>fusesource.m2</id>
          <name>FuseSource Community Release Repository</name>
          <url>https://repo.fusesource.com/nexus/content/groups/public</url>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
          <releases>
            <enabled>true</enabled>
            <updatePolicy>never</updatePolicy>
          </releases>
        </pluginRepository>
        <pluginRepository>
          <id>fusesource.ea</id>
          <name>FuseSource Community Early Access Release Repository</name>
          <url>https://repo.fusesource.com/nexus/content/groups/ea</url>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
          <releases>
            <enabled>true</enabled>
            <updatePolicy>never</updatePolicy>
          </releases>
        </pluginRepository>
        <pluginRepository>
          <id>redhat.ga</id>
          <name>Red Hat General Availability Repository</name>
          <url>https://maven.repository.redhat.com/ga</url>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
          <releases>
            <enabled>true</enabled>
            <updatePolicy>never</updatePolicy>
          </releases>
        </pluginRepository>
      </pluginRepositories>
    </profile>
  </profiles>
</project>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy