<?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.fcrepo</groupId>
    <artifactId>fcrepo-webapp</artifactId>
    <version>3.8.1</version>
  </parent>

  <artifactId>fcrepo-webapp-fedora</artifactId>
  <packaging>war</packaging>
  <name>Fedora Webapp</name>

  <profiles>
    <profile>
      <id>fedora-home-is-defined</id>
      <activation>
        <property>
          <name>fedora.home</name>
        </property>
      </activation>
      <properties>
        <fedora.home>${fedora.home}</fedora.home>
      </properties>
      <build>
      <plugins>
	      <plugin>
	        <groupId>org.apache.maven.plugins</groupId>
	        <artifactId>maven-remote-resources-plugin</artifactId>
	        <executions>
	          <execution>
	            <id>process-remote-resources</id>
	            <goals>
	              <goal>process</goal>
	            </goals>
		        <configuration>
		          <resourceBundles>
		            <resourceBundle>org.fcrepo:fcrepo-shared-resources:${project.version}</resourceBundle>
		          </resourceBundles>
                  <outputDirectory>${project.build.directory}/shared</outputDirectory>
                  <attachToMain>false</attachToMain>
		        </configuration>
	          </execution>
	          </executions>
	      </plugin>
	      <plugin>
	        <groupId>org.apache.maven.plugins</groupId>
	        <artifactId>maven-resources-plugin</artifactId>
	        <executions>
	          <execution>
	            <id>copy-context</id>
	            <phase>validate</phase>
	            <goals>
	              <goal>copy-resources</goal>
	            </goals>
	            <configuration>
			        <outputDirectory>${project.build.directory}/${project.artifactId}-${project.version}/META-INF</outputDirectory>
				    <resources>
				      <resource>
				        <directory>${project.build.directory}/shared/webapp-context</directory>
				        <filtering>true</filtering>
				        <includes>
				        </includes>
				      </resource>
				    </resources>
	            </configuration>
	          </execution>
	        </executions>
	      </plugin>
      </plugins>
      </build>
    </profile>
  </profiles>
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <configuration>
          <webResources>
            <resource>
              <directory>${basedir}/src/main/resources</directory>
            </resource>
          </webResources>
          <archive>
            <manifestFile>${project.build.directory}/${project.artifactId}-${project.version}/META-INF/MANIFEST.MF</manifestFile>
            <manifest>
              <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
            </manifest>
            <manifestEntries>
              <Version>${project.version}</Version>
              <Build>${timestamp}</Build>
            </manifestEntries>
          </archive>

        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <executions>
          <execution>
            <id>bundle-manifest</id>
            <phase>process-classes</phase>
            <goals>
              <goal>manifest</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <manifestLocation>${project.build.directory}/${project.artifactId}-${project.version}/META-INF/</manifestLocation>
          <supportedProjectTypes>
            <supportedProjectType>jar</supportedProjectType>
            <supportedProjectType>bundle</supportedProjectType>
            <supportedProjectType>war</supportedProjectType>
          </supportedProjectTypes>
          <instructions>
            <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
            <Bundle-Version>${project.version}</Bundle-Version>
            <!-- | assume public classes are in the top package, and private 
              classes are under ".internal" -->
            <Bundle-ClassPath>.,WEB-INF/classes</Bundle-ClassPath>
            <Embed-Directory>WEB-INF/lib</Embed-Directory>
            <Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
            <Embed-Transitive>true</Embed-Transitive>
            <Import-Package>
              javax.servlet,
              javax.servlet.http,
              javax.servlet.resources,
              javax.servlet.jsp,
              javax.servlet.jsp.jstl.core,
              javax.servlet.jsp.jstl.fmt,
              javax.servlet.jsp.jstl.tlv,
              org.apache.taglibs.standard.resources,
              org.apache.taglibs.standard.tag.common.core,
              org.apache.taglibs.standard.tag.rt.core,
              org.apache.taglibs.standard.tei,
              org.apache.taglibs.standard.tlv,
              javax.management;resolution:=optional,
              javax.xml.parsers;resolution:=optional,
              javax.xml.transform;resolution:=optional,
              javax.xml.transform.dom;resolution:=optional,
              javax.xml.transform.stream;resolution:=optional,
              org.w3c.dom;resolution:=optional,
              org.xml.sax;resolution:=optional,
              org.xml.sax.helpers;resolution:=optional
            </Import-Package>
            <!-- | each module can override these defaults in their osgi.bnd 
              file -->
            <_include>-osgi.bnd</_include>
          </instructions>
        </configuration>
        
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-remote-resources-plugin</artifactId>
        <executions>
        </executions>
      </plugin>

    </plugins>
  </build>


  <dependencies>
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>servlet-api</artifactId>
    </dependency>


    <dependency>
      <groupId>org.fcrepo</groupId>
      <artifactId>fcrepo-server</artifactId>
      <version>${project.version}</version>
    </dependency>

    <dependency>
      <groupId>org.springframework.security</groupId>
      <artifactId>spring-security-web</artifactId>
    </dependency>

    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-context</artifactId>
    </dependency>

    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-web</artifactId>
    </dependency>

    <dependency>
      <groupId>org.springframework.security</groupId>
      <artifactId>spring-security-config</artifactId>
    </dependency>

    <dependency>
      <groupId>org.fcrepo</groupId>
      <artifactId>fcrepo-security-jaas</artifactId>
      <version>${project.version}</version>
    </dependency>

    <dependency>
      <groupId>org.fcrepo</groupId>
      <artifactId>fcrepo-security-pdp</artifactId>
      <version>${project.version}</version>
    </dependency>

    <dependency>
      <groupId>org.fcrepo</groupId>
      <artifactId>fcrepo-security-pep</artifactId>
      <version>${project.version}</version>
    </dependency>

    <dependency>
      <groupId>org.fcrepo</groupId>
      <artifactId>fcrepo-security-http</artifactId>
      <version>${project.version}</version>
    </dependency>

    <dependency>
      <groupId>mysql</groupId>
      <artifactId>mysql-connector-java</artifactId>
      <version>5.1.20</version>
    </dependency>

    <dependency>
      <groupId>org.postgresql</groupId>
      <artifactId>postgresql</artifactId>
      <version>9.3-1102-jdbc41</version>
    </dependency>

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>jcl-over-slf4j</artifactId>
      <scope>compile</scope>
    </dependency>

    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
      <scope>compile</scope>
    </dependency>
  </dependencies>

</project>
