<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>
  <parent>
    <groupId>com.github.marschall</groupId>
    <artifactId>osgi-remoting-ejb-sample</artifactId>
    <version>0.2.0</version>
  </parent>

  <artifactId>osgi-remoting-ejb-sample-ejb</artifactId>
  <packaging>ejb</packaging>

  <dependencies>
    <dependency>
      <groupId>org.jboss.spec.javax.ejb</groupId>
      <artifactId>jboss-ejb-api_3.1_spec</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>osgi-remoting-ejb-processor6</artifactId>
      <version>${project.version}</version>
      <scope>provided</scope>
    </dependency>
  </dependencies>

  <build>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
      </resource>
    </resources>
    <plugins>
      <plugin>
        <artifactId>maven-ejb-plugin</artifactId>
        <configuration>
          <ejbVersion>3.1</ejbVersion>
          <generateClient>true</generateClient>
          <archive>
            <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
          </archive>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <compilerArguments>
            <Ajavax.ejb.module.name>${project.artifactId}</Ajavax.ejb.module.name>
            <Ajavax.ejb.application.name>osgi-remoting-ejb-sample-ear</Ajavax.ejb.application.name>
            <!-- trigger the generation of JBoss EJB URLs -->
            <Aorg.jboss.distinct.name />
          </compilerArguments>
        </configuration>
      </plugin>
      <plugin>
          <groupId>org.jboss.jandex</groupId>
          <artifactId>jandex-maven-plugin</artifactId>
          <executions>
              <execution>
                  <id>make-index</id>
                  <goals>
                      <goal>jandex</goal>
                  </goals>
              </execution>
          </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <extensions>true</extensions>
        <configuration>
          <supportedProjectTypes>
            <supportedProjectType>ejb</supportedProjectType>
          </supportedProjectTypes>
          <instructions>
            <Export-Package>
              ${project.groupId}.*;version=${project.version};-split-package:=error;-noimport:=true
            </Export-Package>
            <Import-Package>
              javax.ejb;version="[3.1,4)";resolution:=optional,
              *
            </Import-Package>
            <Bundle-ActivationPolicy>
              lazy
            </Bundle-ActivationPolicy>
          </instructions>
        </configuration>
        <executions>
          <execution>
            <id>bundle-manifest</id>
            <phase>process-classes</phase>
            <goals>
              <goal>manifest</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
    <pluginManagement>
      <plugins>
        <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
        <plugin>
          <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.3.7,)</versionRange>
                    <goals>
                      <goal>manifest</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore />
                  </action>
                </pluginExecution>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.jboss.jandex</groupId>
                    <artifactId>jandex-maven-plugin</artifactId>
                    <versionRange>[1.0.1,)</versionRange>
                    <goals>
                      <goal>jandex</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore />
                  </action>
                </pluginExecution>
              </pluginExecutions>
            </lifecycleMappingMetadata>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

</project>
