<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>br.gov.lexml.parser.pl</groupId>
    <artifactId>lexml-parser-projeto-lei</artifactId>
    <version>1.15.1</version>

    <name>LexML Brazil Legal Document Parser</name>
    <description>Brazillian legal document parsing library.</description>
    <url>https://github.com/lexml/lexml-parser-projeto-lei</url>

    <licenses>
	    <license>
		    <name>GPLv2</name>
            <url>https://www.gnu.org/licenses/old-licenses/gpl-2.0.html</url>
	    </license>
    </licenses>
 
    <developers>
      <developer>
        <id>jrafael</id>
        <name>João Nicola</name>
        <email>jrafael@senado.leg.br</email>
      </developer>
    </developers>

    <distributionManagement>
        <snapshotRepository>
            <id>central</id>
            <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>central</id>
            <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>
    
    <properties>
        <scala.version>2.13</scala.version>
        <scala.lib.version>${scala.version}.12</scala.lib.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
	<akka.version>2.5.32</akka.version>
	<pekko.version>1.0.0</pekko.version>
        <maven.javadoc.failOnError>false</maven.javadoc.failOnError>
    </properties>

    <scm>
        <url>https://github.com/lexml/lexml-parser-projeto-lei</url>
        <developerConnection>scm:git:https://github.com/lexml/lexml-parser-projeto-lei.git</developerConnection>
        <connection>scm:git:https://github.com/lexml/lexml-parser-projeto-lei.git</connection>
        <tag>lexml-parser-projeto-lei-1.15.1</tag>
    </scm>

    <build>
        <sourceDirectory>src/main/scala</sourceDirectory>
        <testSourceDirectory>src/test/scala</testSourceDirectory>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.10.1</version>
                <configuration>
                    <source>11</source>
                    <target>11</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>net.alchim31.maven</groupId>
                <artifactId>scala-maven-plugin</artifactId>
                <version>4.8.1</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>compile</goal>
                            <goal>testCompile</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <!--                    <sourceDir>src/main/scala</sourceDir> -->
                    <fork>true</fork>
                    <scalaVersion>${scala.lib.version}</scalaVersion>
                    <scalaCompatVersion>${scala.lib.version}</scalaCompatVersion>
                    <args>
                        <arg>-deprecation</arg>
                    </args>
                    <jvmArgs>
                        <jvmArg>-Xms1024m</jvmArg>
                        <jvmArg>-Xmx4096m</jvmArg>
                        <jvmArg>-Xss16m</jvmArg>
                    </jvmArgs>
                </configuration>
            </plugin>

        </plugins>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
    </build>

    <dependencies>
	    <!-- <dependency>
            <groupId>com.typesafe.akka</groupId>
            <artifactId>akka-actor_${scala.version}</artifactId>
            <version>${akka.version}</version>
	    </dependency> -->
        <dependency>
            <groupId>org.apache.pekko</groupId>
            <artifactId>pekko-actor_${scala.version}</artifactId>
            <version>${pekko.version}</version>
        </dependency>
	<!-- <dependency>
            <groupId>com.typesafe.akka</groupId>
	    <artifactId>akka-slf4j_${scala.version}</artifactId>
            <version>2.5.32</version>
	</dependency> -->
        <dependency>
            <groupId>org.apache.pekko</groupId>
	    <artifactId>pekko-slf4j_${scala.version}</artifactId>
	    <version>${pekko.version}</version>
        </dependency>

        <dependency>
            <groupId>org.scala-lang</groupId>
            <artifactId>scala-library</artifactId>
            <version>${scala.lib.version}</version>
        </dependency>
        <dependency>
            <groupId>org.scala-lang.modules</groupId>
            <artifactId>scala-xml_${scala.version}</artifactId>
            <version>1.3.0</version>
        </dependency>
        <dependency>
            <groupId>org.scala-lang.modules</groupId>
            <artifactId>scala-parser-combinators_${scala.version}</artifactId>
            <version>1.1.2</version>
        </dependency>

        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.18.0</version>
        </dependency>

        <dependency>
            <groupId>br.gov.lexml</groupId>
            <artifactId>lexml-xml-schemas</artifactId>
            <version>4.0.2</version>
            <exclusions>
				<exclusion>
					<groupId>ch.qos.logback</groupId>
					<artifactId>logback-classic</artifactId>
				</exclusion>
			
				<exclusion>
					<groupId>org.slf4j</groupId>
					<artifactId>slf4j-api</artifactId>
				</exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.ccil.cowan.tagsoup</groupId>
            <artifactId>tagsoup</artifactId>
            <version>1.2.1</version>
        </dependency>

        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-core</artifactId>
            <version>2.17.1</version>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-slf4j-impl</artifactId>
            <version>2.17.1</version>
            <scope>runtime</scope>
        </dependency>
        <dependency> <!--  ready fo Scala 2.13 -->
            <groupId>org.clapper</groupId>
            <artifactId>grizzled-slf4j_${scala.version}</artifactId>
            <version>1.3.4</version>
        </dependency> 
        <dependency> <!--  ready fo Scala 2.13 -->
            <groupId>com.github.scopt</groupId>
            <artifactId>scopt_${scala.version}</artifactId>
            <version>3.7.1</version>
        </dependency>
        <!--  scalasti only has versions up to Scala 2.12! -->
        <!-- <dependency> 
          <groupId>org.clapper</groupId>
        	<artifactId>scalasti_${scala.version}</artifactId>
        <version>3.0.1</version>
        </dependency> -->
		<dependency>
			<groupId>org.antlr</groupId>
			<artifactId>ST4</artifactId>
			<version>4.3.1</version>
		</dependency>
        <dependency>
        	 <groupId>org.json4s</groupId>
			  <artifactId>json4s-native_${scala.version}</artifactId>
  			 <version>3.7.0-M6</version>
  		</dependency>
        
    </dependencies>

    <profiles>
      <profile>
        <id>release</id>
        <activation>
          <activeByDefault>false</activeByDefault>
        </activation>
        <build>
          <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>3.1.1</version>
                <configuration>
                    <detail>true</detail>
                    <tagNameFormat>@{project.version}</tagNameFormat>
                </configuration>
            </plugin>
              <plugin>
                  <groupId>org.sonatype.central</groupId>
                  <artifactId>central-publishing-maven-plugin</artifactId>
                  <version>0.9.0</version>
                  <extensions>true</extensions>
		  <configuration>
			  <publishingServerId>central</publishingServerId>	 
			  <autoPublish>true</autoPublish>
		          <waitUntil>validated</waitUntil>
                  </configuration>
              </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.3.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
              </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
	    <artifactId>maven-jar-plugin</artifactId>
	    <version>3.4.2</version>
            <executions>
                <execution>
                    <id>empty-javadoc-jar</id>
                    <phase>package</phase>
                    <goals>
                        <goal>jar</goal>
                    </goals>
                    <configuration>
                        <classifier>javadoc</classifier>
                        <classesDirectory>${basedir}/javadoc</classesDirectory>
                    </configuration>
                </execution>
             </executions>
           </plugin>
              <plugin>
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-gpg-plugin</artifactId>
                  <version>3.2.7</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>
       <profile>
         <id>onejar</id>
         <activation>
           <activeByDefault>false</activeByDefault>
         </activation>
         <build>
           <plugins>
             <plugin>
                <groupId>com.jolira</groupId>
                <artifactId>onejar-maven-plugin</artifactId>
                <version>1.4.4</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <configuration>
                            <mainClass>br.gov.lexml.parser.pl.fe.FECmdLine</mainClass>
                            <attachToBuild>true</attachToBuild>
                            <filename>${project.build.finalName}-onejar.${project.packaging}</filename>
                            <classifier>one-jar</classifier>
                        </configuration>
                        <goals>
                            <goal>one-jar</goal>
                        </goals>
                    </execution>
                </executions>
              </plugin> 
            </plugins>
         </build>
       </profile>
    </profiles>
</project>
