<?xml version="1.0" encoding="UTF-8"?>
<!--
/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
-->
<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.apache.struts</groupId>
        <artifactId>struts2-parent</artifactId>
        <version>6.10.0</version>
    </parent>
    <artifactId>struts2-core</artifactId>
    <packaging>jar</packaging>
    <name>Struts 2 Core</name>

    <properties>
        <tlib.version>6.0</tlib.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <argLine>@{argLine}</argLine>
                    <properties>
                        <property>
                            <name>maven.testng.output.dir</name>
                            <value>${project.basedir}/target/surefire-reports</value>
                        </property>
                    </properties>
                    <useSystemClassLoader>false</useSystemClassLoader>
                    <additionalClasspathElements>
                        <element>${project.build.testOutputDirectory}/xwork-jar.jar</element>
                        <element>${project.build.testOutputDirectory}/xwork-zip.zip</element>
                        <element>${project.build.testOutputDirectory}/xwork - jar.jar</element>
                        <element>${project.build.testOutputDirectory}/xwork - zip.zip</element>
                    </additionalClasspathElements>
                    <excludes>
                        <exclude>**/XWorkTestCase.java</exclude>
                        <exclude>**/TestBean.java</exclude>
                        <exclude>**/TestBean2.java</exclude>
                        <exclude>**/TestInterceptor.java</exclude>
                        <exclude>**/AnnotatedTestBean.java</exclude>
                        <exclude>**/DefaultFileManagerTest.java</exclude>
                    </excludes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.cj.jshintmojo</groupId>
                <artifactId>jshint-maven-plugin</artifactId>
                <version>1.6.0</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>lint</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <configFile>src/main/resources/jshint.conf.js</configFile>
                    <directories>
                        <directory>src/main/resources/</directory>
                    </directories>
                    <excludes>
                        <exclude>src/main/resources/org/apache/struts2/static/domTT.js</exclude>
                    </excludes>
                    <reporter>jslint</reporter>
                    <reportFile>target/jshint.xml</reportFile>
                    <failOnError>true</failOnError>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>build-maven</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <configuration>
                            <compilerArgs>
                                <arg>-Auri=/struts-tags</arg>
                                <arg>-AtlibVersion=${tlib.version}</arg>
                                <arg>-AjspVersion=2.0</arg>
                                <arg>-AshortName=s</arg>
                                <arg>-AdisplayName=Struts Tags</arg>
                                <arg>-AoutFile=${basedir}/target/classes/META-INF/struts-tags.tld</arg>
                                <arg>-Adescription="To make it easier to access dynamic data;
                                    the Apache Struts framework includes a library of custom tags.
                                    The tags interact with the framework's validation and
                                    internationalization features;
                                    to ensure that input is correct and output is localized.
                                    The Struts Tags can be used with JSP FreeMarker or Velocity."</arg>
                                <arg>-AoutTemplatesDir=${basedir}/src/site/resources/tags</arg>
                            </compilerArgs>
                        </configuration>
                        <executions>
                            <execution>
                                <phase>compile</phase>
                                <goals>
                                    <goal>compile</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>alljars</id>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-source</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <sourcepath>${basedir}/src/main/java;${basedir}/../xwork-core/src/main/java</sourcepath>
                            <encoding>UTF-8</encoding>
                            <groups>
                                <group>
                                    <title>Struts Packages</title>
                                    <packages>org.apache.struts2*</packages>
                                </group>
                                <group>
                                    <title>XWork Packages</title>
                                    <packages>com.opensymphony.xwork2*</packages>
                                </group>
                            </groups>
                            <show>private</show>
                            <links>
                                <link>http://java.sun.com/j2se/1.5.0/docs/api</link>
                                <link>http://java.sun.com/javaee/5/docs/api/</link>
                                <link>http://jakarta.apache.org/commons/logging/apidocs/</link>
                                <link>http://logging.apache.org/log4j/docs/api/</link>
                            </links>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>


    <dependencies>
        <dependency>
            <groupId>org.freemarker</groupId>
            <artifactId>freemarker</artifactId>
        </dependency>

        <dependency>
            <groupId>com.github.ben-manes.caffeine</groupId>
            <artifactId>caffeine</artifactId>
        </dependency>

        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>javax.servlet.jsp</groupId>
            <artifactId>jsp-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>ognl</groupId>
            <artifactId>ognl</artifactId>
        </dependency>

        <!-- Logging -->
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-api</artifactId>
        </dependency>

        <!-- File upload -->
        <dependency>
            <groupId>commons-fileupload</groupId>
            <artifactId>commons-fileupload</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
        </dependency>

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-text</artifactId>
        </dependency>

        <!-- Optional used in com.opensymphony.xwork2.util.ProxyUtil to detect if object is HibernateProxy -->
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>5.6.15.Final</version>
            <optional>true</optional>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context-support</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.awaitility</groupId>
            <artifactId>awaitility</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <optional>true</optional>
        </dependency>

        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-core</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-collections4</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>mockobjects</groupId>
            <artifactId>mockobjects-jdk1.3</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>mockobjects</groupId>
            <artifactId>mockobjects-alt-jdk1.3</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>mockobjects</groupId>
            <artifactId>mockobjects-alt-jdk1.3-j2ee1.3</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>mockobjects</groupId>
            <artifactId>mockobjects-jdk1.3-j2ee1.3</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>jmock</groupId>
            <artifactId>jmock</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>mockobjects</groupId>
            <artifactId>mockobjects-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.easymock</groupId>
            <artifactId>easymock</artifactId>
            <scope>test</scope>
        </dependency>

        <!-- These jars have to be in the compile scope in order to work with apt plugin
             (struts-annotations) and javadoc (the rest to process xwork sources). Marking
             them optional to exclude them from transitive dependency resolution -->

        <dependency>
            <groupId>org.apache.struts</groupId>
            <artifactId>struts-annotations</artifactId>
            <scope>compile</scope>
            <optional>true</optional>
        </dependency>

        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <scope>test</scope>
        </dependency>

        <!-- SLF4J support -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>commons-validator</groupId>
            <artifactId>commons-validator</artifactId>
            <scope>test</scope>
        </dependency>

    </dependencies>
</project>
