<!--

     Copyright 2005-2014 Red Hat, Inc.

     Red Hat licenses this file to you under the Apache License, version
     2.0 (the "License"); you may not use this file except in compliance
     with the License.  You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
     implied.  See the License for the specific language governing
     permissions and limitations under the License.

-->
<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>

    <parent>
        <groupId>io.fabric8.bom</groupId>
        <artifactId>fabric8-bom</artifactId>
        <version>1.2.0.Beta4</version>
    </parent>

    <groupId>io.fabric8</groupId>
    <artifactId>fabric8-project</artifactId>
    <version>1.2.0.Beta4</version>
    <packaging>pom</packaging>

    <name>Fabric8 :: Parent</name>
    <url>http://fabric8.io/</url>

    <properties>
        <maven-assembly-plugin-version>2.4</maven-assembly-plugin-version>
        <maven-build-helper-plugin-version>1.8</maven-build-helper-plugin-version>
        <maven-bundle-plugin-version>2.5.0</maven-bundle-plugin-version>
        <maven-javadoc-plugin-version>2.9.1</maven-javadoc-plugin-version>
        <maven-notices-plugin-version>1.32</maven-notices-plugin-version>
        <maven-surefire-plugin-version>2.17</maven-surefire-plugin-version>
        <maven-deploy-plugin-version>2.8.1</maven-deploy-plugin-version>
        <maven-shade-plugin-version>2.3</maven-shade-plugin-version>
    </properties>
    
    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <defaultGoal>install</defaultGoal>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.felix</groupId>
                    <artifactId>maven-bundle-plugin</artifactId>
                    <version>${maven-bundle-plugin-version}</version>
                    <extensions>true</extensions>
                    <configuration>
                        <excludeDependencies>${fuse.osgi.exclude.dependencies}</excludeDependencies>
                        <instructions>
                            <Bundle-Name>${fuse.osgi.bundle.name}</Bundle-Name>
                            <Bundle-SymbolicName>${fuse.osgi.symbolic.name}</Bundle-SymbolicName>
                            <Bundle-DocURL>http://fabric8.io/</Bundle-DocURL>
                            <Bundle-Activator>${fuse.osgi.activator}</Bundle-Activator>
                            <Export-Package>${fuse.osgi.export}</Export-Package>
                            <Import-Package>${fuse.osgi.import}</Import-Package>
                            <DynamicImport-Package>${fuse.osgi.dynamic}</DynamicImport-Package>
                            <Private-Package>${fuse.osgi.private.pkg}</Private-Package>
                            <Implementation-Title>Fabric8</Implementation-Title>
                            <Implementation-Version>${project.version}</Implementation-Version>
                            <Include-Resource>${fuse.osgi.resource}</Include-Resource>
                            <_versionpolicy>${fuse.osgi.import.default.version}</_versionpolicy>
                            <_failok>${fuse.osgi.failok}</_failok>
                            <Embed-Dependency>${fuse.osgi.embed.dependency}</Embed-Dependency>
                            <Embed-Transitive>${fuse.osgi.embed.transitive}</Embed-Transitive>
                            <Require-Bundle>${fuse.osgi.require.bundle}</Require-Bundle>
                            <Require-Capability>${fuse.osgi.capabilities.require}</Require-Capability>
                            <Provide-Capability>${fuse.osgi.capabilities.provide}</Provide-Capability>
                            <Fragment-Host>${fuse.osgi.fragment.host}</Fragment-Host>
                        </instructions>
                    </configuration>
                    <executions>
                        <execution>
                            <id>cleanVersions</id>
                            <phase>generate-sources</phase>
                            <goals>
                                <goal>cleanVersions</goal>
                            </goals>
                            <configuration>
                                <versions>
                                    <karaf.osgi.version>${karaf-version}</karaf.osgi.version>
                                </versions>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.felix</groupId>
                    <artifactId>maven-scr-plugin</artifactId>
                    <version>${felix-scr-plugin-version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>${maven-assembly-plugin-version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven-surefire-plugin-version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-shade-plugin</artifactId>
                    <version>${maven-shade-plugin-version}</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>build-helper-maven-plugin</artifactId>
                    <version>${maven-build-helper-plugin-version}</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>exec-maven-plugin</artifactId>
                    <version>${exec-maven-plugin-version}</version>
                </plugin>
                <plugin>
                    <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself. -->
                    <groupId>org.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>
                                            org.apache.felix
                                        </groupId>
                                        <artifactId>
                                            maven-bundle-plugin
                                        </artifactId>
                                        <versionRange>
                                            [2.1.0,)
                                        </versionRange>
                                        <goals>
                                            <goal>cleanVersions</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore />
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.fusesource.mvnplugins</groupId>
                    <artifactId>maven-notices-plugin</artifactId>
                    <version>${maven-notices-plugin-version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.cxf</groupId>
                    <artifactId>cxf-java2ws-plugin</artifactId>
                    <version>${cxf-version}</version>
                    <dependencies>
                        <dependency>
                            <groupId>org.apache.cxf</groupId>
                            <artifactId>cxf-rt-frontend-jaxws</artifactId>
                            <version>${cxf-version}</version>
                        </dependency>
                        <dependency>
                            <groupId>org.apache.cxf</groupId>
                            <artifactId>cxf-rt-frontend-simple</artifactId>
                            <version>${cxf-version}</version>
                        </dependency>
                    </dependencies>
                    <executions>
                        <execution>
                            <id>process-classes</id>
                            <phase>process-classes</phase>
                            <goals>
                                <goal>java2ws</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.cxf</groupId>
                    <artifactId>cxf-java2wadl-plugin</artifactId>
                    <version>${cxf-version}</version>
                    <executions>
                        <execution>
                            <id>process-classes</id>
                            <phase>process-classes</phase>
                            <goals>
                                <goal>java2wadl</goal>
                            </goals>
                        </execution>
                    </executions>
            </plugin>

            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>${maven.compiler.source}</source>
                    <target>${maven.compiler.target}</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <forkMode>once</forkMode>
                    <!-- these settings are mandatory to avoid SureFire giving a bogus system property to the web container -->
                    <useSystemClassLoader>false</useSystemClassLoader>
                    <useManifestOnlyJar>false</useManifestOnlyJar>
                    <failIfNoTests>false</failIfNoTests>
                    <runOrder>alphabetical</runOrder>
                    <systemPropertyVariables>
                        <basedir>${basedir}</basedir>
                        <project.version>${project.version}</project.version>
                    </systemPropertyVariables>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifest>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                            <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <inherited>true</inherited>
                <executions>
                    <execution>
                        <id>cleanVersions</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>cleanVersions</goal>
                        </goals>
                        <configuration>
                            <versions>
                                <fuse.osgi.version>${project.version}</fuse.osgi.version>
                            </versions>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-javadoc-plugin</artifactId>
              <version>${maven-javadoc-plugin-version}</version>
            </plugin>
            <plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-deploy-plugin</artifactId>
               <version>${maven-deploy-plugin-version}</version>
            </plugin>
        </plugins>
    </build>

    <profiles>

        <!-- Do a license check by running : mvn -P license license:check Update the license check by running : mvn -P license license:format -->
        <profile>
            <id>license</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.mycila.maven-license-plugin</groupId>
                        <artifactId>maven-license-plugin</artifactId>
                        <version>1.6.0</version>
                        <configuration>
                            <quiet>false</quiet>
                            <header>src/main/resources/license-header.txt</header>
                            <aggregate>true</aggregate>
                            <includes>
                                <include>src/**</include>
                                <include>**/pom.xml</include>
                            </includes>
                            <excludes>
                                <!-- can remove once http://code.google.com/p/maven-license-plugin/issues/detail?id=72 is resolved -->
                                <exclude>**/*.scaml</exclude>
                                <exclude>**/LICENSE.txt</exclude>
                                <exclude>**/LICENSE</exclude>
                                <exclude>**/.svn/**</exclude>

                                <!-- ignore files produced during a build -->
                                <exclude>**/target/**</exclude>

                                <!-- ignore binary files -->
                                <exclude>**/*.jpg</exclude>
                                <exclude>**/*.png</exclude>
                                <exclude>**/*.gif</exclude>
                                <exclude>**/*.ico</exclude>
                                <exclude>**/*.keystore</exclude>

                            </excludes>
                            <useDefaultExcludes>false</useDefaultExcludes>
                            <mapping>
                                <jj>JAVADOC_STYLE</jj>
                                <proto>DOUBLESLASH_STYLE</proto>
                                <index>SCRIPT_STYLE</index>
                            </mapping>
                        </configuration>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>snapshots</id>
            <properties>
                <snapshot-build>redhat-610-SNAPSHOT</snapshot-build>
                <activemq-version>5.10.0.${snapshot-build}</activemq-version>
                <aries.blueprint.version>1.0.1.${snapshot-build}</aries.blueprint.version>
                <aries.jmx.version>1.0.1.${snapshot-build}</aries.jmx.version>
                <aries.transaction.version>1.0.1.${snapshot-build}</aries.transaction.version>
                <aries.util.version>1.0.1.${snapshot-build}</aries.util.version>
                <aries.proxy.version>1.0.1.${snapshot-build}</aries.proxy.version>
                <camel-version>2.12.0.${snapshot-build}</camel-version>
                <cxf-version>2.7.0.${snapshot-build}</cxf-version>
                <felix-configadmin-version>1.4.0.${snapshot-build}</felix-configadmin-version>
                <felix-eventadmin-version>1.3.0.${snapshot-build}</felix-eventadmin-version>
                <felix-fileinstall-version>3.3.11.${snapshot-build}</felix-fileinstall-version>
                <felix-framework-version>4.0.3.${snapshot-build}</felix-framework-version>
                <felix-framework-security-version>2.0.1.${snapshot-build}</felix-framework-security-version>
                <felix-gogo-version>0.11.0.${snapshot-build}</felix-gogo-version>
                <karaf-version>2.3.0.${snapshot-build}</karaf-version>
                <servicemix.components.version>2013.01.0.${snapshot-build}</servicemix.components.version>
                <servicemix.features.version>4.5.0.${snapshot-build}</servicemix.features.version>
                <servicemix-nmr-version>1.6.0.${snapshot-build}</servicemix-nmr-version>
                <servicemix-specs-version>2.3.0.${snapshot-build}</servicemix-specs-version>
                <servicemix.utils.version>1.6.0.${snapshot-build}</servicemix.utils.version>
            </properties>
        </profile>

        <profile>
            <!-- builds using the FuseSource private release proxy to test builds before we ship them -->
            <id>rp</id>

            <repositories>
                <repository>
                    <id>fusesource.rp</id>
                    <name>FuseSource Community Early Access Release Repository</name>
                    <url>https://repo.fusesource.com/nexus/content/groups/m2-release-proxy</url>
                    <snapshots>
                        <enabled>false</enabled>
                    </snapshots>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                </repository>
            </repositories>
            <pluginRepositories>
                <pluginRepository>
                    <id>fusesource.rp</id>
                    <name>FuseSource Community Early Access Release Repository</name>
                    <url>https://repo.fusesource.com/nexus/content/groups/m2-release-proxy</url>
                    <snapshots>
                        <enabled>false</enabled>
                    </snapshots>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                </pluginRepository>
            </pluginRepositories>
        </profile>
    </profiles>

</project>
