<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.apache.axis2</groupId>
        <artifactId>axis2</artifactId>
        <version>2.0.1-SNAPSHOT</version>
        <relativePath>../../pom.xml</relativePath>
    </parent>

    <artifactId>axis2-json</artifactId>

    <name>Apache Axis2 - JSON</name>
    <description>Axis2 JSON module</description>
    <url>http://axis.apache.org/axis2/java/core/</url>

    <scm>
        <connection>scm:git:https://gitbox.apache.org/repos/asf/axis-axis2-java-core.git</connection>
        <developerConnection>scm:git:https://gitbox.apache.org/repos/asf/axis-axis2-java-core.git</developerConnection>
        <url>https://gitbox.apache.org/repos/asf?p=axis-axis2-java-core.git;a=summary</url>
        <tag>HEAD</tag>
    </scm>

    <properties>
        <moshi.version>1.15.2</moshi.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.apache.axis2</groupId>
            <artifactId>axis2-kernel</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.codehaus.jettison</groupId>
            <artifactId>jettison</artifactId>
            <version>1.5.5</version>
        </dependency>
         <dependency>
            <groupId>org.apache.axis2</groupId>
            <artifactId>axis2-transport-http</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.xmlunit</groupId>
            <artifactId>xmlunit-legacy</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>axis2-testutils</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>axis2-adb</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.owasp.encoder</groupId>
            <artifactId>encoder</artifactId>
            <version>1.4.0</version>
        </dependency>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
        </dependency>
        <dependency>
            <groupId>com.squareup.moshi</groupId>
            <artifactId>moshi</artifactId>
            <version>${moshi.version}</version>
        </dependency>
        <dependency>
            <groupId>com.squareup.moshi</groupId>
            <artifactId>moshi-adapters</artifactId>
            <version>${moshi.version}</version>
        </dependency>
        <dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
        </dependency>
        <dependency>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>jsr305</artifactId>
            <version>3.0.2</version>
        </dependency>

        <dependency>
            <groupId>org.apache.axis2</groupId>
            <artifactId>axis2-adb-codegen</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.ws.commons.axiom</groupId>
            <artifactId>axiom-truth</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>jakarta.annotation</groupId>
            <artifactId>jakarta.annotation-api</artifactId>
        </dependency>
    </dependencies>

    <build>
        <sourceDirectory>src</sourceDirectory>
        <testSourceDirectory>test</testSourceDirectory>
        <testResources>
            <testResource>
                <directory>test-resources</directory>
            </testResource>
        </testResources>
        <plugins>
            <plugin>
                <artifactId>maven-remote-resources-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>process</goal>
                        </goals>
                        <configuration>
                            <resourceBundles>
                                <resourceBundle>org.apache.axis2:axis2-resource-bundle:${project.version}</resourceBundle>
                            </resourceBundles>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <id>wsdl2java</id>
                        <phase>generate-test-sources</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <target unless="maven.test.skip">
                                <java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
                                    <classpath refid="maven.test.classpath" />
                                    <arg line="-ss -sd -u -or -o '${project.build.directory}/gen' -uri test-wsdl/LibraryService.wsdl" />
                                </java>
                                <delete file="${project.build.directory}/gen/src/org/apache/axis2/json/adb/LibraryServiceSkeleton.java" />
                            </target>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>add-test-source</id>
                        <phase>process-test-resources</phase>
                        <goals>
                            <goal>add-test-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>${project.build.directory}/gen/src</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>${project.groupId}</groupId>
                <artifactId>axis2-repo-maven-plugin</artifactId>
                <version>${project.version}</version>
                <executions>
                    <execution>
                        <id>json-repo</id>
                        <goals>
                            <goal>create-test-repository</goal>
                        </goals>
                        <configuration>
                            <inputDirectory>test-repository/json</inputDirectory>
                            <outputDirectory>${project.build.directory}/repo/json</outputDirectory>
                            <generatedAxis2xml>
                                <messageFormatters>
                                    <messageFormatter>
                                        <contentType>application/json</contentType>
                                        <className>org.apache.axis2.json.JSONMessageFormatter</className>
                                    </messageFormatter>
                                    <messageFormatter>
                                        <contentType>application/json+badgerfish</contentType>
                                        <className>org.apache.axis2.json.JSONBadgerfishMessageFormatter</className>
                                    </messageFormatter>
                                    <messageFormatter>
                                        <contentType>text/javascript</contentType>
                                        <className>org.apache.axis2.json.JSONMessageFormatter</className>
                                    </messageFormatter>
                                </messageFormatters>
                                <messageBuilders>
                                    <messageBuilder>
                                        <contentType>application/json</contentType>
                                        <className>org.apache.axis2.json.JSONOMBuilder</className>
                                    </messageBuilder>
                                    <messageBuilder>
                                        <contentType>application/json+badgerfish</contentType>
                                        <className>org.apache.axis2.json.JSONBadgerfishOMBuilder</className>
                                    </messageBuilder>
                                    <messageBuilder>
                                        <contentType>text/javascript</contentType>
                                        <className>org.apache.axis2.json.JSONOMBuilder</className>
                                    </messageBuilder>
                                </messageBuilders>
                            </generatedAxis2xml>
                        </configuration>
                    </execution>
                    <execution>
                        <id>gson-repo</id>
                        <goals>
                            <goal>create-test-repository</goal>
                        </goals>
                        <configuration>
                            <inputDirectory>test-repository/gson</inputDirectory>
                            <outputDirectory>${project.build.directory}/repo/gson</outputDirectory>
                            <generatedAxis2xml>
                                <messageFormatters>
                                    <messageFormatter>
                                        <contentType>application/json</contentType>
                                        <className>org.apache.axis2.json.gson.JsonFormatter</className>
                                    </messageFormatter>
                                </messageFormatters>
                                <messageBuilders>
                                    <messageBuilder>
                                        <contentType>application/json</contentType>
                                        <className>org.apache.axis2.json.gson.JsonBuilder</className>
                                    </messageBuilder>
                                </messageBuilders>
                                <handlers>
                                    <handler>
                                        <flow>InFlow</flow>
                                        <phase>Transport</phase>
                                        <name>RequestURIOperationDispatcher</name>
                                        <className>org.apache.axis2.dispatchers.RequestURIOperationDispatcher</className>
                                    </handler>
                                    <handler>
                                        <flow>InFlow</flow>
                                        <phase>Transport</phase>
                                        <name>JSONMessageHandler</name>
                                        <className>org.apache.axis2.json.gson.JSONMessageHandler</className>
                                    </handler>
                                </handlers>
                            </generatedAxis2xml>
                            <serviceDescriptions>
                                <serviceDescription>
                                    <directory>${project.build.directory}/gen/resources</directory>
                                </serviceDescription>
                            </serviceDescriptions>
                        </configuration>
                    </execution>
                    <execution>
                        <id>moshi-repo</id>
                        <goals>
                            <goal>create-test-repository</goal>
                        </goals>
                        <configuration>
                            <inputDirectory>test-repository/moshi</inputDirectory>
                            <outputDirectory>${project.build.directory}/repo/moshi</outputDirectory>
                            <generatedAxis2xml>
                                <messageFormatters>
                                    <messageFormatter>
                                        <contentType>application/json</contentType>
                                        <className>org.apache.axis2.json.moshi.JsonFormatter</className>
                                    </messageFormatter>
                                </messageFormatters>
                                <messageBuilders>
                                    <messageBuilder>
                                        <contentType>application/json</contentType>
                                        <className>org.apache.axis2.json.moshi.JsonBuilder</className>
                                    </messageBuilder>
                                </messageBuilders>
                                <handlers>
                                    <handler>
                                        <flow>InFlow</flow>
                                        <phase>Transport</phase>
                                        <name>RequestURIOperationDispatcher</name>
                                        <className>org.apache.axis2.dispatchers.RequestURIOperationDispatcher</className>
                                    </handler>
                                    <handler>
                                        <flow>InFlow</flow>
                                        <phase>Transport</phase>
                                        <name>JSONMessageHandler</name>
                                        <className>org.apache.axis2.json.moshi.JSONMessageHandler</className>
                                    </handler>
                                </handlers>
                            </generatedAxis2xml>
                            <serviceDescriptions>
                                <serviceDescription>
                                    <directory>${project.build.directory}/gen/resources</directory>
                                </serviceDescription>
                            </serviceDescriptions>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
