<?xml version="1.0" encoding="UTF-8"?>
<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">
  <!-- This module was also published with a richer model, Gradle metadata,  -->
  <!-- which should be used instead. Do not delete the following line which  -->
  <!-- is to indicate to Gradle or any Gradle module metadata file consumer  -->
  <!-- that they should prefer consuming it instead. -->
  <!-- do_not_remove: published-with-gradle-metadata -->
  <modelVersion>4.0.0</modelVersion> 
  <parent>
    <groupId>com.fasterxml.jackson.dataformat</groupId>
    <artifactId>jackson-dataformats-binary</artifactId>
    <version>2.19.2</version>
  </parent>
  <artifactId>jackson-dataformat-protobuf</artifactId>
  <name>Jackson dataformat: Protobuf</name>
  <!-- 04-Mar-2023, tatu: not sure why, but use of "jar" does not work
         with Shade plugin inclusion, somehow
    -->
  <packaging>bundle</packaging>
  <description>Support for reading and writing protobuf-encoded data via Jackson
abstractions.
  </description>
  <url>https://github.com/FasterXML/jackson-dataformats-binary</url>

  <licenses>
    <license>
      <name>The Apache Software License, Version 2.0</name>
      <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <properties>
    <packageVersion.dir>com/fasterxml/jackson/dataformat/protobuf</packageVersion.dir>
    <packageVersion.package>${project.groupId}.protobuf</packageVersion.package>
    <!-- Default OSGi import is fine, export _should_ be, but due to shading play it safe -->
    <osgi.export>${project.groupId}.protobuf.*; version=${project.version}</osgi.export>
    <osgi.private>com.squareup.protoparser.*</osgi.private>
  </properties>

  <dependencies>
    <!-- uses protostuff libs for parsing, generation -->
    <dependency>
      <groupId>com.squareup</groupId>
      <artifactId>protoparser</artifactId>
      <version>4.0.3</version>
    </dependency>

    <!-- Hmmh. Need databind for schema generation, convenience ProtobufMapper.
         And starting with 2.10(.4), there is only explicit mapper:
      -->
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-databind</artifactId>
    </dependency>

    <!-- and for testing, JUnit is needed; as well as annotations -->
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-annotations</artifactId>
      <scope>provided</scope>
    </dependency>
  </dependencies>

  <build>
   <plugins>
     <plugin>
       <!-- Inherited from oss-base. Generate PackageVersion.java.-->
        <groupId>com.google.code.maven-replacer-plugin</groupId>
        <artifactId>replacer</artifactId>
        <executions>
          <execution>
            <id>process-packageVersion</id>
            <phase>generate-sources</phase>
          </execution>
        </executions>
     </plugin>

      <plugin>
        <!--  We will shade proto-parser, to simplify deployment, avoid version conflicts -->
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <artifactSet>
                <includes>
                  <!-- the bundle plugin already did the pulling-in, all we need is the renaming! -->
             <!-- 
                  <include>com.squareup:protoparser</include>
-->             
                  <include>null:null</include>
                </includes>
              </artifactSet>
              <relocations>
                <relocation>
                  <pattern>com.squareup</pattern>
                  <shadedPattern>com.fasterxml.jackson.dataformat.protobuf.protoparser</shadedPattern>
                </relocation>
              </relocations>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <!-- 19-Mar-2019, tatu: Add rudimentary JDK9+ module info. To build with JDK 8
             will have to use `moduleInfoFile` as anything else requires JDK 9+
        -->      
     <plugin>
	   <groupId>org.moditect</groupId>
	   <artifactId>moditect-maven-plugin</artifactId>
     </plugin>
     <!-- 05-Jul-2020, tatu: Add generation of Gradle Module Metadata -->
     <!-- 28-Feb-2025, jjohannes: Apply plugin last as it has to be the last of all 'package phase' plugins -->
     <plugin>
       <groupId>org.gradlex</groupId>
       <artifactId>gradle-module-metadata-maven-plugin</artifactId>
     </plugin>
   </plugins>
  </build>

</project>
