<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>

  <groupId>org.thingsboard</groupId>
  <artifactId>protobuf-dynamic</artifactId>
  <packaging>jar</packaging>
  <version>1.0.3TB</version>
  <name>protobuf-dynamic</name>
  <url>https://github.com/os72/protobuf-dynamic</url>
  <description>Protocol Buffers Dynamic Schema</description>

  <parent>
	<groupId>org.sonatype.oss</groupId>
	<artifactId>oss-parent</artifactId>
	<version>9</version>
  </parent>

  <licenses>
	<license>
	  <name>The Apache Software License, Version 2.0</name>
	  <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
	  <distribution>repo</distribution>
	</license>
  </licenses>
  <scm>
      <connection>scm:git:git@github.com:thingsboard/protobuf-dynamic.git</connection>
      <developerConnection>scm:git:git@github.com:thingsboard/protobuf-dynamic.git</developerConnection>
      <url>git@github.com:thingsboard/protobuf-dynamic.git</url>
  </scm>
  <developers>
	<developer>
	  <id>os72</id>
	  <name>Oliver Suciu</name>
	</developer>
    <developer>
      <id>ShvaykaD</id>
      <name>Dmytro Shvaika</name>
      <email>dshvaika@thingsboard.io</email>
    </developer>
  </developers>
  <properties>
	<protobuf.version>3.17.2</protobuf.version>
	<slf4j.version>1.7.7</slf4j.version>
	<lombok.version>1.18.8</lombok.version>
	<junit.version>4.12</junit.version>
	<logback.version>1.2.3</logback.version>
  </properties>

  <dependencies>
	<!-- compile -->
	<dependency>
		<groupId>com.google.protobuf</groupId>
		<artifactId>protobuf-java</artifactId>
		<version>${protobuf.version}</version>
	</dependency>

	<!-- test -->
	<dependency>
		<groupId>junit</groupId>
		<artifactId>junit</artifactId>
		<version>${junit.version}</version>
		<scope>test</scope>
	</dependency>
	<dependency>
	  <groupId>ch.qos.logback</groupId>
	  <artifactId>logback-core</artifactId>
	  <version>${logback.version}</version>
	  <scope>test</scope>
	</dependency>
	<dependency>
	  <groupId>ch.qos.logback</groupId>
	  <artifactId>logback-classic</artifactId>
	  <version>${logback.version}</version>
	  <scope>test</scope>
	</dependency>
	<dependency>
		<groupId>org.slf4j</groupId>
		<artifactId>slf4j-api</artifactId>
		<version>${slf4j.version}</version>
		<scope>test</scope>
	</dependency>
	<dependency>
		<groupId>org.projectlombok</groupId>
		<artifactId>lombok</artifactId>
		<version>${lombok.version}</version>
		<scope>test</scope>
	</dependency>
  </dependencies>

  <build>
	<plugins>
		<plugin>
			<groupId>com.github.os72</groupId>
			<artifactId>protoc-jar-maven-plugin</artifactId>
			<version>3.11.4</version>
			<executions>
				<execution>
					<phase>generate-test-sources</phase>
					<goals>
						<goal>run</goal>
					</goals>
					<configuration>
						<protocVersion>${protobuf.version}</protocVersion>
						<inputDirectories>
							<include>src/test/resources</include>
						</inputDirectories>
						<outputTargets>
							<outputTarget>
								<type>java</type>
								<addSources>none</addSources>
								<outputDirectory>src/test/java</outputDirectory>
							</outputTarget>
							<outputTarget>
								<type>descriptor</type>
								<addSources>none</addSources>
								<outputDirectory>src/test/resources</outputDirectory>
							</outputTarget>
						</outputTargets>
					</configuration>
				</execution>
			</executions>
		</plugin>
		<plugin>
		  <groupId>org.apache.maven.plugins</groupId>
		  <artifactId>maven-compiler-plugin</artifactId>
		  <version>3.8.1</version>
		  <configuration>
			<release>11</release>
		  </configuration>
		</plugin>
		<plugin>
		  <groupId>org.apache.maven.plugins</groupId>
		  <artifactId>maven-jar-plugin</artifactId>
		  <configuration>
			<archive>
			  <manifestEntries>
				<Build-Id>${project.name}-${project.version}-${maven.build.timestamp}</Build-Id>
			  </manifestEntries>
			</archive>
		  </configuration>
		</plugin>
		<plugin>
		  <groupId>org.apache.maven.plugins</groupId>
		  <artifactId>maven-source-plugin</artifactId>
		  <executions>
			<execution>
			  <id>attach-sources</id>
				<goals>
				 <goal>jar</goal>
				</goals>
			</execution>
		  </executions>
		</plugin>
		<plugin>
		  <groupId>org.apache.maven.plugins</groupId>
		  <artifactId>maven-javadoc-plugin</artifactId>
		  <executions>
			<execution>
			  <id>attach-javadoc</id>
				<goals>
				 <goal>jar</goal>
				</goals>
			</execution>
		  </executions>
		</plugin>
	</plugins>
  </build>
  <profiles>
        <profile>
            <id>gpg-sign</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.6</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <configuration>
                                    <!-- Prevent gpg from using pinentry programs. Fixes: gpg: signing 
                                        failed: Inappropriate ioctl for device -->
                                    <gpgArguments>
                                        <arg>--pinentry-mode</arg>
                                        <arg>loopback</arg>
                                    </gpgArguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
  </profiles>
  <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
        </repository>
  </distributionManagement>
</project>
