<?xml version="1.0" encoding="UTF-8"?>
<!-- Stripes core. Produces the stripes.jar needed in users webapps. -->
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" 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.stripesframework</groupId>
      <artifactId>stripes-parent</artifactId>
      <version>4.0.2</version>
      <relativePath>../pom.xml</relativePath>
   </parent>

   <artifactId>stripes-jsp</artifactId>
   <packaging>jar</packaging>

   <name>Stripes JSP taglib</name>
   <description>Stripes JSP taglib</description>

   <properties>
      <tld.source>src/main/resources/META-INF</tld.source>
      <tld.target>${project.build.outputDirectory}/META-INF</tld.target>
      <tld.uri>https://stripesframework.org/stripes.tld</tld.uri>
      <tld.dynuri>https://stripesframework.org/stripes-dynattr.tld</tld.dynuri>
   </properties>

   <dependencies>
      <dependency>
         <groupId>org.slf4j</groupId>
         <artifactId>slf4j-api</artifactId>
      </dependency>
      <dependency>
         <groupId>org.stripesframework</groupId>
         <artifactId>stripes-web</artifactId>
         <version>${project.version}</version>
      </dependency>
      <dependency>
         <groupId>jakarta.servlet</groupId>
         <artifactId>jakarta.servlet-api</artifactId>
      </dependency>
      <dependency>
         <groupId>jakarta.servlet.jsp</groupId>
         <artifactId>jakarta.servlet.jsp-api</artifactId>
      </dependency>
      <dependency>
         <groupId>jakarta.el</groupId>
         <artifactId>jakarta.el-api</artifactId>
      </dependency>
      <dependency>
         <groupId>org.junit.platform</groupId>
         <artifactId>junit-platform-launcher</artifactId>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.junit.jupiter</groupId>
         <artifactId>junit-jupiter-engine</artifactId>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.assertj</groupId>
         <artifactId>assertj-core</artifactId>
      </dependency>
   </dependencies>

   <build>
      <resources>
         <resource>
            <directory>src/main/resources</directory>
            <includes>
               <include>META-INF/stripes-buffered-layout.tld</include>
            </includes>
         </resource>
      </resources>
      <plugins>
         <plugin>
            <artifactId>maven-antrun-plugin</artifactId>
            <version>1.7</version>
            <executions>
               <execution>
                  <phase>generate-resources</phase>
                  <configuration>
                     <target>
                        <!-- make two copies of the taglib, one with and one without dynamic attributes -->
                        <filter filtersfile="${tld.source}/common-descriptions.properties"/>
                        <filter token="dynattrs" value="false"/>
                        <copy file="${tld.source}/stripes.tld" todir="${tld.target}" filtering="true"/>

                        <filter token="dynattrs" value="true"/>
                        <copy file="${tld.source}/stripes.tld" tofile="${tld.target}/stripes-dynattr.tld" filtering="true"/>
                        <replace file="${tld.target}/stripes-dynattr.tld" token="${tld.uri}" value="${tld.dynuri}"/>
                     </target>
                  </configuration>
                  <goals>
                     <goal>run</goal>
                  </goals>
               </execution>
            </executions>
         </plugin>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>${surefire.version}</version>
            <configuration>
               <failIfNoTests>false</failIfNoTests>
               <includes>
                  <include>**/*.java</include>
               </includes>
            </configuration>
         </plugin>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <configuration>
               <archive>
                  <manifest>
                     <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                     <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                  </manifest>
                  <manifestEntries>
                     <Automatic-Module-Name>org.stripesframework.jsp</Automatic-Module-Name>
                  </manifestEntries>
               </archive>
            </configuration>
         </plugin>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <executions>
               <execution>
                  <id>generate-javadoc</id>
                  <phase>package</phase>
                  <goals>
                     <goal>jar</goal>
                  </goals>
               </execution>
            </executions>
         </plugin>
         <plugin>
            <groupId>net.sourceforge.maven-taglib</groupId>
            <artifactId>maven-taglib-plugin</artifactId>
            <configuration>
               <taglib.src.dir>target/classes/META-INF/</taglib.src.dir>
            </configuration>
            <executions>
               <execution>
                  <goals>
                     <goal>taglibdocjar</goal>
                  </goals>
               </execution>
            </executions>
         </plugin>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <executions>
               <execution>
                  <id>attach-sources</id>
                  <goals>
                     <goal>jar-no-fork</goal>
                  </goals>
               </execution>
            </executions>
         </plugin>
         <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>cobertura-maven-plugin</artifactId>
         </plugin>
      </plugins>
   </build>
</project>
