<?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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.roo</groupId>
        <artifactId>org.springframework.roo.root</artifactId>
        <version>1.3.2.RELEASE</version>
        <relativePath>..</relativePath>
    </parent>
    <artifactId>org.springframework.roo.osgi.bundle</artifactId>
    <packaging>pom</packaging>
    <name>Spring Roo - OSGi Bundle Module Parent</name>
    <description>Provides POM configuration inheritence for standard OSGi modules.</description>
    <!-- No modules should be defined below; this module simply provides POM configuration inheritence - not reactor builds -->
    <modules />
    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>1.1.1</version>
                <executions>
                    <execution>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <executable>git</executable>
                    <arguments>
                        <argument>log</argument>
                        <argument>--pretty=format:Git-Commit-Hash: %H</argument>
                        <argument>-n1</argument>
                    </arguments>
                    <outputFile>${project.build.directory}/build-number.mf</outputFile>
                    <successCodes>
                        <!-- Skip failures due to missing Git or the project not being a Git repo (needed for add-ons which ultimately extend this POM but don't use Git) -->
                        <successCode>0</successCode>
                        <successCode>1</successCode>
                        <successCode>127</successCode>
                        <successCode>128</successCode>
                    </successCodes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <version>2.5.3</version>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                        <_include>${project.build.directory}/build-number.mf</_include>
                        <Export-Package>${project.artifactId}.*;version=${project.version}</Export-Package>
                        <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
                        <Bundle-Vendor>${project.organization.name}</Bundle-Vendor>
                        <Bundle-Copyright>Copyright ${project.organization.name}. All Rights Reserved.</Bundle-Copyright>
                        <Bundle-DocURL>${project.url}</Bundle-DocURL>
                    </instructions>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.4</version>
                <executions>
                    <execution>
                        <id>copy-dependencies</id>
                        <phase>package</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <outputDirectory>${project.build.directory}/../../target/all</outputDirectory>
                    <silent>true</silent>
                    <includeScope>compile</includeScope>
                    <excludeArtifactIds>org.apache.felix.scr.annotations</excludeArtifactIds>
                    <excludeGroupIds>org.osgi</excludeGroupIds>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>1.7</version>
                <executions>
                    <execution>
                        <!-- copies the JARs we have built locally (eg bootstrap JAR) that noone else depends on into the target/all -->
                        <id>copy-jars-for-roo-dev-or-assembly</id>
                        <phase>package</phase>
                        <configuration>
                            <target>
                                <copy todir="${project.build.directory}/../../target/all" preservelastmodified="true">
                                    <fileset dir="${project.build.directory}">
                                        <include name="*.jar" />
                                        <exclude name="*-tests.jar" />
                                        <exclude name="*-sources.jar" />
                                    </fileset>
                                </copy>
                            </target>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        <pluginManagement>
          <!-- 
          Some Maven plugins are recognized as problematic by Eclipse m2e and 
          will produce error markers with a text similar to: 
          
            maven-dependency-plugin (goals "copy-dependencies","unpack") 
            is not supported by m2e. 
            
          In version 1.0 there is no quick fix available for this but it is 
          possible to define a lifecycle mapping for the plugin which removes 
          the error marker http://wiki.eclipse.org/M2E_plugin_execution_not_covered#Common_problems
            
          To configure your Eclipse to use the lifecycle mapping in this file 
          read http://wiki.eclipse.org/M2E_plugin_execution_not_covered#Eclipse_4.2_add_default_mapping
          -->
          <plugins>
            <plugin>
                <groupId>org.eclipse.m2e</groupId>
                <artifactId>lifecycle-mapping</artifactId>
                <version>1.0.0</version>
                <configuration>
    
                    <lifecycleMappingMetadata>
                      <pluginExecutions>
                        <pluginExecution>
                          <pluginExecutionFilter>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-dependency-plugin</artifactId>
                            <goals>
                                <goal>copy-dependencies</goal>
                                <goal>unpack</goal>
                            </goals>
                            <versionRange>[0.0,)</versionRange>
                          </pluginExecutionFilter>
                          <action>
                            <ignore/>
                          </action>
                        </pluginExecution>
                        <pluginExecution>
                          <pluginExecutionFilter>
                            <groupId>org.codehaus.mojo</groupId>
                            <artifactId>exec-maven-plugin</artifactId>
                            <goals>
                                <goal>exec</goal>
                            </goals>
                            <versionRange>[0.0,)</versionRange>
                          </pluginExecutionFilter>
                          <action>
                            <ignore/>
                          </action>
                        </pluginExecution>
                      </pluginExecutions>
                    </lifecycleMappingMetadata>
                    
                </configuration>
            </plugin>
          </plugins>
        </pluginManagement>
    </build>
</project>
