<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright (c) 2021, 2024 Contributors to the Eclipse Foundation
    Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.

    This program and the accompanying materials are made available under the
    terms of the Eclipse Public License v. 2.0, which is available at
    http://www.eclipse.org/legal/epl-2.0.

    This Source Code may also be made available under the following Secondary
    Licenses when the conditions for such availability set forth in the
    Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
    version 2 with the GNU Classpath Exception, which is available at
    https://www.gnu.org/software/classpath/license.html.

    SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0

-->

<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>org.eclipse.ee4j</groupId>
        <artifactId>project</artifactId>
        <version>1.0.7</version>
        <relativePath/>
    </parent>

    <groupId>org.glassfish.web</groupId>
    <artifactId>jakarta.servlet.jsp.jstl</artifactId>
    <version>3.0.2-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>Jakarta Standard Tag Library Implementation</name>
    <description>Jakarta Standard Tag Library Implementation</description>
    <url>https://projects.eclipse.org/projects/ee4j.jstl</url>
    <licenses>
        <license>
            <name>EPL 2.0</name>
            <url>http://www.eclipse.org/legal/epl-2.0</url>
            <distribution>repo</distribution>
        </license>
        <license>
            <name>GPL2 w/ CPE</name>
            <url>https://www.gnu.org/software/classpath/license.html</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>yaminikb</id>
            <name>Yamini K B</name>
            <organization>Oracle Corporation</organization>
            <organizationUrl>http://www.oracle.com/</organizationUrl>
        </developer>
    </developers>
    <contributors>
        <contributor>
            <name>Kin Man Chung</name>
        </contributor>
    </contributors>

    <mailingLists>
        <mailingList>
            <name>JSTL dev mailing list</name>
            <post>jstl-dev@eclipse.org</post>
            <subscribe>https://dev.eclipse.org/mailman/listinfo/jstl-dev</subscribe>
            <unsubscribe>https://dev.eclipse.org/mailman/listinfo/jstl-dev</unsubscribe>
            <archive>https://dev.eclipse.org/mhonarc/lists/jstl-dev</archive>
        </mailingList>
    </mailingLists>

    <scm>
        <connection>scm:git:https://github.com/eclipse-ee4j/jstl-api.git</connection>
        <developerConnection>scm:git:ssh://git@github.com/eclipse-ee4j/jstl-api.git</developerConnection>
        <url>https://github.com/eclipse-ee4j/jstl-api</url>
        <tag>HEAD</tag>
    </scm>
    <issueManagement>
        <system>github</system>
        <url>https://github.com/eclipse-ee4j/jstl-api/issues</url>
    </issueManagement>

    <dependencies>
        <dependency>
            <groupId>jakarta.servlet</groupId>
            <artifactId>jakarta.servlet-api</artifactId>
            <version>6.0.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>jakarta.servlet.jsp</groupId>
            <artifactId>jakarta.servlet.jsp-api</artifactId>
            <version>3.1.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>jakarta.el</groupId>
            <artifactId>jakarta.el-api</artifactId>
            <version>5.0.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>jakarta.servlet.jsp.jstl</groupId>
            <artifactId>jakarta.servlet.jsp.jstl-api</artifactId>
            <version>3.0.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>xalan</groupId>
            <artifactId>xalan</artifactId>
            <version>2.7.3</version>
            <scope>compile</scope>
            <exclusions>
                <exclusion>
                    <groupId>xml-apis</groupId>
                    <artifactId>xml-apis</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <version>5.8.2</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <resources>
            <resource>
                <directory>src/main/java</directory>
                <includes>
                    <include>**/*.properties</include>
                    <include>**/*.xml</include>
                </includes>
            </resource>
            <resource>
                <directory>src/main/resources</directory>
            </resource>
            <resource>
                <directory>${project.basedir}/..</directory>
                <includes>
                    <include>LICENSE.md</include>
                    <include>NOTICE.md</include>
                </includes>
                <targetPath>META-INF</targetPath>
            </resource>
            <resource>
                <directory>${project.basedir}</directory>
                <includes>
                    <include>LICENSE.md</include>
                    <include>NOTICE.md</include>
                </includes>
                <targetPath>META-INF</targetPath>
            </resource>
        </resources>
        <plugins>
              <!-- Sets minimal Maven version -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>3.0.0</version>
                <executions>
                    <execution>
                        <id>enforce-maven</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireMavenVersion>
                                    <version>3.6.0</version>
                                </requireMavenVersion>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <!-- Restricts the Java version to 11 -->
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <release>11</release>
                    <compilerArgument>-Xlint:unchecked</compilerArgument>
                </configuration>
            </plugin>

            <!-- Creates the OSGi MANIFEST.MF file -->
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <version>5.1.3</version>
                <configuration>
                    <instructions>
                        <Bundle-SymbolicName>org.glassfish.web.jakarta.servlet.jsp.jstl</Bundle-SymbolicName>
                        <Export-Package>
                            org.apache.taglibs.standard,
                            org.apache.taglibs.standard.extra.spath,
                            org.apache.taglibs.standard.functions,
                            org.apache.taglibs.standard.lang.jstl,
                            org.apache.taglibs.standard.lang.jstl.parser,
                            org.apache.taglibs.standard.lang.support,
                            org.apache.taglibs.standard.resources,
                            org.apache.taglibs.standard.tag.common.core,
                            org.apache.taglibs.standard.tag.common.fmt,
                            org.apache.taglibs.standard.tag.common.sql,
                            org.apache.taglibs.standard.tag.common.xml,
                            org.apache.taglibs.standard.tag.el.core,
                            org.apache.taglibs.standard.tag.el.fmt,
                            org.apache.taglibs.standard.tag.el.sql,
                            org.apache.taglibs.standard.tag.el.xml,
                            org.apache.taglibs.standard.tag.rt.core,
                            org.apache.taglibs.standard.tag.rt.fmt,
                            org.apache.taglibs.standard.tag.rt.sql,
                            org.apache.taglibs.standard.tag.rt.xml,
                            org.apache.taglibs.standard.tei,
                            org.apache.taglibs.standard.tlv,
                            org.glassfish.jstl.integration
                        </Export-Package>
                        <Import-Package>
                            !org.apache.bcel,
                            !org.apache.regexp,
                            !org.apache.xml,
                            !org.apache.xml.dtm,
                            !org.apache.xml.utils,
                            !org.apache.xpath,
                            !org.apache.xpath.jaxp,
                            !org.apache.xpath.objects,
                            !org.apache.xpath.res,
                            !java_cup.runtime,
                            !trax,
                            jakarta.el;version="[5.0,7)",
                            jakarta.servlet.jsp;version="[3.1,5)",
                            jakarta.servlet.jsp.tagext;version="[3.1,5)",
                            org.xml.sax.ext,
                            *
                        </Import-Package>
                    </instructions>
                </configuration>
                <executions>
                    <execution>
                        <id>bundle-manifest</id>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>manifest</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- Adds the manifest file created by the org.apache.felix:maven-bundle-plugin -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.2.0</version>
                <configuration>
                    <archive>
                        <manifestFile>
                            ${project.build.outputDirectory}/META-INF/MANIFEST.MF
                        </manifestFile>
                        <manifestEntries>
                            <Extension-Name>jakarta.servlet.jsp.jstl</Extension-Name>
                            <Specification-Version>2.0</Specification-Version>
                            <Specification-Vendor>${project.organization.name}</Specification-Vendor>
                            <Implementation-Version>${project.version}</Implementation-Version>
                            <Implementation-Vendor>${project.organization.name}</Implementation-Vendor>
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin>

            <!-- Post process the jar we created by including XALAN and moving packages -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.2.4</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <dependencyReducedPomLocation>${project.build.directory}/dependency-reduced-pom.xml</dependencyReducedPomLocation>
                            <artifactSet>
                                <includes>
                                    <include>xalan:xalan</include>
                                </includes>
                            </artifactSet>
                            <filters>
                                <filter>
                                    <artifact>xalan:xalan</artifact>
                                    <excludes>
                                        <exclude>META-INF/**</exclude>
                                    </excludes>
                                </filter>
                            </filters>
                            <relocations>
                                <relocation>
                                    <pattern>org.apache.xpath</pattern>
                                    <shadedPattern>org.eclipse.tags.shaded.org.apache.xpath</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>org.apache.xml</pattern>
                                    <shadedPattern>org.eclipse.tags.shaded.org.apache.xml</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>org.apache.xalan</pattern>
                                    <shadedPattern>org.eclipse.tags.shaded.org.apache.xalan</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>org.apache.regexp</pattern>
                                    <shadedPattern>org.eclipse.tags.shaded.org.apache.regexp</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>org.apache.bcel</pattern>
                                    <shadedPattern>org.eclipse.tags.shaded.org.apache.bcel</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>java_cup.runtime</pattern>
                                    <shadedPattern>org.eclipse.tags.shaded.java_cup.runtime</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>trax</pattern>
                                    <shadedPattern>org.eclipse.tags.shaded.trax</shadedPattern>
                                </relocation>
                            </relocations>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <artifactId>maven-source-plugin</artifactId>
                <configuration>
                    <includePom>true</includePom>
                </configuration>
                <executions>
                    <execution>
                       <id>attach-sources</id>
                       <goals>
                           <goal>jar-no-fork</goal>
                       </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>3.2.0</version>
                <executions>
                    <execution>
                        <id>timestamp-property</id>
                        <goals>
                            <goal>timestamp-property</goal>
                        </goals>
                        <phase>validate</phase>
                        <configuration>
                            <name>current.year</name>
                            <pattern>yyyy</pattern>
                            <locale>en_US</locale>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.3.1</version>
                <configuration>
                    <source>11</source>
                    <additionalJOption>-Xdoclint:none</additionalJOption>
                    <quiet>true</quiet>
                    <bottom><![CDATA[
Copyright &#169; 2019, ${current.year} Eclipse Foundation. All rights reserved.
]]>
                    </bottom>
                    <docfilessubdirs>true</docfilessubdirs>
                    <groups>
                        <group>
                            <title>Jakarta Standard Tag Library Documentation</title>
                            <packages>jakarta.servlet.jsp.jstl*</packages>
                        </group>
                    </groups>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <configuration>
                            <groups>
                                <group>
                                    <title>Jakarta Standard Tag Library Documentation</title>
                                    <packages>org.apache.taglibs</packages>
                                </group>
                            </groups>
                            <doclint>none</doclint>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>

        <pluginManagement>
            <plugins>
                <plugin>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>3.0.0-M7</version>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <profiles>
        <!--
          Generation of TLDDocs typically fails with the following when excuted directly from the impl module:

          [WARNING]
          Could not transfer metadata org.glassfish.web:tagsdoc:1.0-SNAPSHOT/maven-metadata.xml from/to maven-default-http-blocker (http://0.0.0.0/):

          transfer failed for http://0.0.0.0/org/glassfish/web/tagsdoc/1.0-SNAPSHOT/maven-metadata.xml

          [WARNING]
          org.glassfish.web:tagsdoc:1.0-SNAPSHOT/maven-metadata.xmlfailed to transfer from http://0.0.0.0/ during a previous attempt.
          This failure was cached in the local repository and resolution will not be reattempted until the update interval of
          maven-default-http-blocker has elapsed or updates are forced.


          Original error:

          Could not transfer metadata org.glassfish.web:tagsdoc:1.0-SNAPSHOT/maven-metadata.xml from/to maven-default-http-blocker (http://0.0.0.0/):

          transfer failed for http://0.0.0.0/org/glassfish/web/tagsdoc/1.0-SNAPSHOT/maven-metadata.xml
        -->
        <profile>
            <id>tlddocs</id>
            <build>
                <plugins>
                    <!-- Generate the TLD docs -->
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>exec-maven-plugin</artifactId>
                        <version>3.0.0</version>
                        <executions>
                            <execution>
                                <id>generateTldDoc</id>
                                <phase>prepare-package</phase>
                                <goals>
                                    <goal>java</goal>
                                </goals>
                                <configuration>
                                    <includePluginDependencies>true</includePluginDependencies>
                                    <includeProjectDependencies>false</includeProjectDependencies>
                                    <mainClass>com.sun.tlddoc.TLDDoc</mainClass>
                                    <arguments>
                                        <argument>-doctitle</argument>
                                        <argument>Jakarta Tags doc</argument>
                                        <argument>-windowtitle</argument>
                                        <argument>Jakarta Tags Doc</argument>
                                        <argument>-d</argument>
                                        <argument>${project.build.directory}/tlddoc</argument>
                                        <argument>${project.basedir}/src/main/resources/META-INF/sql.tld</argument>
                                        <argument>${project.basedir}/src/main/resources/META-INF/x.tld</argument>
                                        <argument>${project.basedir}/src/main/resources/META-INF/fmt.tld</argument>
                                        <argument>${project.basedir}/src/main/resources/META-INF/c.tld</argument>
                                        <argument>${project.basedir}/src/main/resources/META-INF/fn.tld</argument>
                                    </arguments>
                                </configuration>
                            </execution>
                        </executions>
                        <dependencies>
                            <dependency>
                                <groupId>org.glassfish.web</groupId>
                                <artifactId>tagsdoc</artifactId>
                                <version>1.0-SNAPSHOT</version>
                            </dependency>
                        </dependencies>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
