<!--

    DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.

    Copyright (c) 2011-2021 Oracle and/or its affiliates. All rights reserved.

    The contents of this file are subject to the terms of either the GNU
    General Public License Version 2 only ("GPL") or the Common Development
    and Distribution License("CDDL") (collectively, the "License").  You
    may not use this file except in compliance with the License.  You can
    obtain a copy of the License at
    https://oss.oracle.com/licenses/CDDL+GPL-1.1
    or LICENSE.txt.  See the License for the specific
    language governing permissions and limitations under the License.

    When distributing the software, include this License Header Notice in each
    file and include the License file at LICENSE.txt.

    GPL Classpath Exception:
    Oracle designates this particular file as subject to the "Classpath"
    exception as provided by Oracle in the GPL Version 2 section of the License
    file that accompanied this code.

    Modifications:
    If applicable, add the following below the License Header, with the fields
    enclosed by brackets [] replaced by your own identifying information:
    "Portions Copyright [year] [name of copyright owner]"

    Contributor(s):
    If you wish your version of this file to be governed by only the CDDL or
    only the GPL Version 2, indicate your decision by adding "[Contributor]
    elects to include this software in this distribution under the [CDDL or GPL
    Version 2] license."  If you don't indicate a single choice of license, a
    recipient has the option to distribute your version of this file under
    either the CDDL, the GPL Version 2 or to extend the choice of license to
    its licensees as provided above.  However, if you add GPL Version 2 code
    and therefore, elected the GPL Version 2 license, then the option applies
    only if the new code is made subject to such option by the copyright
    holder.

-->

<!-- steps to release give all of them together in one command : mvn release:clean release:prepare release:perform -->
<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.jboss</groupId>
      <artifactId>jboss-parent</artifactId>
      <version>35</version>
    </parent>
    <groupId>com.sun.xml.messaging.saaj</groupId>
    <artifactId>saaj-impl</artifactId>
    <version>2.0.0.SP1</version>
    <description>
        Open source Reference Implementation of JSR-67: SOAP with
        Attachments API for Java (SAAJ MR: 1.4) (Jakarta)
    </description>
    <scm>
        <connection>scm:git:https://github.com/jboss/saaj-impl.git</connection>
        <developerConnection>scm:git:https://github.com/jboss/saaj-impl.git</developerConnection>
        <url>https://github.com/jboss/saaj-impl</url>
        <tag>HEAD</tag>
    </scm>
    <build>
        <testSourceDirectory>src/test</testSourceDirectory>
        <testResources>
            <testResource>
                <directory>src/test/mime/data</directory>
            </testResource>
            <testResource>
                <directory>src/test/resources</directory>
            </testResource>
        </testResources>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.7.0</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>cobertura-maven-plugin</artifactId>
                    <version>2.7</version>
                </plugin>
                <plugin>
                    <groupId>org.glassfish.copyright</groupId>
                    <artifactId>glassfish-copyright-maven-plugin</artifactId>
                    <version>2.3</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>findbugs-maven-plugin</artifactId>
                    <version>2.5.2</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.20</version>
                    <configuration>
                        <forkCount>1</forkCount>
                        <reuseForks>false</reuseForks>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>2.5.3</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>3.0.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>3.3.1</version>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>prepare-endorsed</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <skip>${maven.endorsed.skip}</skip>
                            <outputDirectory>${endorsed.dir}</outputDirectory>
                            <silent>false</silent>
                            <includeArtifactIds>jakarta.xml.ws-api</includeArtifactIds>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <release>9</release>
                    <showDeprecation>true</showDeprecation>
                    <showWarnings>true</showWarnings>
                    <compilerArgs>
                        <arg>-Xlint:all</arg>
                    </compilerArgs>
                </configuration>
                <executions>
                    <execution>
                        <id>base-compile</id>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                        <configuration>
                            <release>8</release>
                            <excludes>
                                <exclude>module-info.java</exclude>
                            </excludes>
                        </configuration>
                    </execution>
                    <execution>
                        <id>default-testCompile</id>
                        <goals>
                            <goal>testCompile</goal>
                        </goals>
                        <configuration>
                            <compilerArgs>
                                <arg>--add-exports</arg>
                                <arg>com.sun.xml.messaging.saaj/com.sun.xml.messaging.saaj.soap.impl=com.sun.xml.messaging.saaj.test</arg>
                            </compilerArgs>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>cobertura-maven-plugin</artifactId>
                <configuration>
                    <formats>
                        <format>xml</format>
                    </formats>
                    <check>
                        <totalLineRate>45</totalLineRate>
                        <packageLineRate>45</packageLineRate>
                        <haltOnFailure>true</haltOnFailure>
                    </check>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.glassfish.copyright</groupId>
                <artifactId>glassfish-copyright-maven-plugin</artifactId>
                <configuration>
                    <templateFile>${project.basedir}/copyright.txt</templateFile>
                    <excludeFile>${project.basedir}/copyright-exclude</excludeFile>
                    <scm>git</scm>
                    <!-- skip files not under SCM-->
                    <scmOnly>true</scmOnly>
                    <!-- turn off warnings -->
                    <warn>true</warn>
                    <!-- for use with repair -->
                    <update>false</update>
                    <!-- check that year is correct -->
                    <ignoreYear>false</ignoreYear>
                </configuration>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>copyright</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>findbugs-maven-plugin</artifactId>
                <configuration>
                    <skip>${findbugs.skip}</skip>
                    <threshold>${findbugs.threshold}</threshold>
                    <findbugsXmlWithMessages>true</findbugsXmlWithMessages>
                    <excludeFilterFile>
                        exclude-common.xml,${findbugs.exclude}
                    </excludeFilterFile>
                    <fork>true</fork>
                    <jvmArgs>-Xms64m -Xmx256m</jvmArgs>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.glassfish.findbugs</groupId>
                        <artifactId>findbugs</artifactId>
                        <version>1.0</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>endorsed-dirs</id>
            <activation>
                <jdk>[1.6,9)</jdk>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <configuration>
                            <compilerArgs>
                                <compilerArg>-Djava.endorsed.dirs=${endorsed.dir}</compilerArg>
                            </compilerArgs>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <argLine>${proxyOpts} -Djava.endorsed.dirs="${endorsed.dir}"</argLine>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <configuration>
                            <additionalJOption>-J-Djava.endorsed.dirs=${endorsed.dir}</additionalJOption>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>jdk9-setup</id>
            <activation>
                <jdk>9</jdk>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <configuration>
                            <release>7</release>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <argLine>${proxyOpts} --add-modules java.xml.soap --upgrade-module-path ${endorsed.dir}</argLine>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <configuration>
                            <additionalJOptions>
                                <additionalJOption>--add-modules</additionalJOption>
                                <additionalJOption>java.xml.soap,java.xml.bind</additionalJOption>
                                <additionalJOption>--upgrade-module-path</additionalJOption>
                                <additionalJOption>${endorsed.dir}</additionalJOption>
                            </additionalJOptions>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>jvnet-release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>3.0.0-M1</version>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <!-- invoke unit tests against JDK like this:
         mvn clean test -DtestInJdk -Djdk.to.test=$jdk/home/path/bin/java
         -->
        <profile>
            <id>sources-profile</id>
            <activation>
                <property>
                    <name>!skipSources</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <configuration>
                            <additionalparam>-Xdoclint:none</additionalparam>
                        </configuration>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>jdk</id>
            <activation>
                <property>
                    <name>testInJdk</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>2.20</version>
                        <configuration>
                            <argLine>${proxyOpts} -Djdk.build=true</argLine>
                            <!-- some random non-existing directory to make sure the built classes are not found, instead the ones from jdk are used -->
                            <classesDirectory>jerreAbfAFgfreu</classesDirectory>
                            <excludes>
                                <!-- tests using RI specific API -->
                                <exclude>**/MimeUtilityTest.java</exclude>
                            </excludes>
                            <classpathDependencyScopeExcludes>compile</classpathDependencyScopeExcludes>
                            <classpathDependencyExcludes>
                                <classpathDependencyExcludes>jakarta.xml.ws:jakarta.xml.ws-api</classpathDependencyExcludes>
                                <classpathDependencyExcludes>org.jvnet.mimepull:mimepull</classpathDependencyExcludes>
                            </classpathDependencyExcludes>
                            <jvm>${jdk.to.test}</jvm>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>jdk-sm</id>
            <activation>
                <property>
                    <name>testInJdkWithSM</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>2.20</version>
                        <configuration>
                            <argLine>${proxyOpts} -Djdk.build=true -Djava.security.manager -Djava.security.policy=./src/test/test.policy</argLine>
                            <!-- some random non-existing directory to make sure the built classes are not found, instead the ones from jdk are used -->
                            <classesDirectory>jerreAbfAFgfreu</classesDirectory>
                            <excludes>
                                <!-- tests using RI specific API -->
                                <exclude>**/MimeUtilityTest.java</exclude>
                            </excludes>
                            <classpathDependencyScopeExcludes>compile</classpathDependencyScopeExcludes>
                            <classpathDependencyExcludes>
                                <classpathDependencyExcludes>jakarta.xml.ws:jakarta.xml.ws-api</classpathDependencyExcludes>
                                <classpathDependencyExcludes>org.jvnet.mimepull:mimepull</classpathDependencyExcludes>
                            </classpathDependencyExcludes>
                            <jvm>${jdk.to.test}</jvm>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <organization>
        <name>Oracle</name>
        <url>http://www.oracle.com/</url>
    </organization>
    <issueManagement>
        <system>IssueTracker</system>
        <url>https://github.com/javaee/metro-saaj/issues</url>
    </issueManagement>
    <mailingLists>
        <mailingList>
            <name>Metro mailing list</name>
            <subscribe>metro+subscribe@javaee.groups.io</subscribe>
            <post>metro@javaee.groups.io</post>
            <archive>https://javaee.groups.io/g/metro/topics</archive>
        </mailingList>
    </mailingLists>
    <licenses>
      <license>
        <name>CDDL + GPLv2 with classpath exception</name>
        <url>https://oss.oracle.com/licenses/CDDL+GPL-1.1</url>
        <distribution>repo</distribution>
        <comments>A business-friendly OSS license</comments>
      </license>
    </licenses>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>jakarta.xml.ws</groupId>
                <artifactId>jakarta.xml.ws-api</artifactId>
                <version>${version.jakarta.xml.ws-api}</version>
            </dependency>
            <dependency>
                <groupId>com.sun.xml.fastinfoset</groupId>
                <artifactId>FastInfoset</artifactId>
                <version>2.0.0</version>
            </dependency>
            <dependency>
                <groupId>org.jvnet.mimepull</groupId>
                <artifactId>mimepull</artifactId>
                <version>1.9.15</version>
            </dependency>
            <dependency>
                <groupId>org.jvnet.staxex</groupId>
                <artifactId>stax-ex</artifactId>
                <version>2.1.0-M1</version>
            </dependency>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>4.13.1</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>javax.servlet</groupId>
                <artifactId>servlet-api</artifactId>
                <version>2.5</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>jakarta.xml.ws</groupId>
            <artifactId>jakarta.xml.ws-api</artifactId>
        </dependency>
        <dependency>
            <groupId>com.sun.xml.fastinfoset</groupId>
            <artifactId>FastInfoset</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jvnet.mimepull</groupId>
            <artifactId>mimepull</artifactId>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
        </dependency>
        <dependency>
            <groupId>jakarta.servlet</groupId>
            <artifactId>jakarta.servlet-api</artifactId>
            <version>${version.jakarta-servlet-api}</version>
        </dependency>

        <dependency>
            <groupId>org.jvnet.staxex</groupId>
            <artifactId>stax-ex</artifactId>
        </dependency>

        <dependency>
            <groupId>jakarta.activation</groupId>
            <artifactId>jakarta.activation-api</artifactId>
            <version>${version.jakarta.activation-api}</version>
        </dependency>
    </dependencies>

    <properties>
        <findbugs.exclude>${project.basedir}/exclude.xml</findbugs.exclude>
        <findbugs.threshold>Low</findbugs.threshold>
        <endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
        <proxyOpts />
        <version.jakarta-servlet-api>5.0.0</version.jakarta-servlet-api>
        <version.jakarta.xml.ws-api>3.0.1</version.jakarta.xml.ws-api>
        <version.jakarta.activation-api>2.0.0</version.jakarta.activation-api>
    </properties>

</project>
