<?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/maven-v4_0_0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<groupId>br.gov.lexml</groupId>
	<artifactId>lexml-xml-schemas</artifactId>
	<packaging>jar</packaging>
	<version>3.2.0</version>
	<name>LexML Brazil XML Schemas</name>
	<description>XML schemas for the LexML Brazil document format.</description>
	<url>https://github.com/lexml/lexml-xml-schemas</url>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<slf4j.version>1.7.36</slf4j.version>
	</properties>

	<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>ossrh</id>
			<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
		</snapshotRepository>
		<repository>
			<id>ossrh</id>
			<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
		</repository>
	</distributionManagement>

	<scm>
		<url>https://github.com/lexml/lexml-xml-schemas</url>
		<connection>scm:git:https://github.com/lexml/lexml-xml-schemas.git</connection>
		<developerConnection>scm:git:https://github.com/lexml/lexml-xml-schemas.git</developerConnection>
		<tag>lexml-xml-schemas-3.2.0</tag>
	</scm>
	
	<build>
		<testResources>
			<testResource>
				<directory>src/main/resources</directory>
			</testResource>		
			<testResource>
				<directory>src/test/resources</directory>
			</testResource>
			<testResource>
				<directory>src/test/xml</directory>
			</testResource>
		</testResources>
		<resources>
			<resource>
				<directory>src/main/resources</directory>
			</resource>
		</resources>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.8.1</version>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-resources-plugin</artifactId>
				<version>3.1.0</version>
				<configuration>
					<encoding>UTF-8</encoding>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<version>3.1.0</version>
				<configuration>
					<archive>
						<manifest>
							<addClasspath>true</addClasspath>
							<mainClass>br.gov.lexml.schema.validator.Main</mainClass>
						</manifest>
					</archive>
				</configuration>
			</plugin>
            <plugin>
                <groupId>org.codehaus.gmaven</groupId>
                <artifactId>groovy-maven-plugin</artifactId>
                <version>2.1</version>
                <executions>
                    <execution>
                        <phase>generate-test-resources</phase>
                        <goals>
                            <goal>execute</goal>
                        </goals>
                        <inherited>false</inherited>
                        <configuration>
                            <source>
                                def srcDir = new File(project.basedir,'src/test/xml').getAbsoluteFile()
                                def dir = new File(project.basedir, 'target/test-classes')
                                dir.mkdirs()
                                def target = new File(dir, 'lista-exemplos.txt')
                                scanner = ant.fileScanner {
                                    fileset(dir: srcDir) {
                                        include(name:"**/*.xml")
                                    }
                                }
                                len = srcDir.path.length()+1
                                paths = new StringBuilder()
                                for(f in scanner) {
                                    paths.append(f.path.substring(len) + '\n')
                                }
                                ant.echo(file:target, message: paths.toString())
                            </source>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
	</plugins>
	</build>
	<dependencies>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.13.1</version>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>ch.qos.logback</groupId>
			<artifactId>logback-classic</artifactId>
			<version>1.2.10</version>
			<type>jar</type>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
			<version>${slf4j.version}</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>2.5.3</version>
                <configuration>
                    <detail>true</detail>
                    <tagNameFormat>@{project.version}</tagNameFormat>
                </configuration>
            </plugin>
              <plugin>
                  <groupId>org.sonatype.plugins</groupId>
                  <artifactId>nexus-staging-maven-plugin</artifactId>
                  <version>1.6.7</version>
                  <extensions>true</extensions>
                  <configuration>
                      <serverId>ossrh</serverId>
                      <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
                      <autoReleaseAfterClose>true</autoReleaseAfterClose>
                  </configuration>
              </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.0.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-javadoc-plugin</artifactId>
		  <executions>
		    <execution>
		      <id>attach-javadocs</id>
		      <goals>
		        <goal>jar</goal>
		      </goals>
		    </execution>
		  </executions>
 	   </plugin>
              <plugin>
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-gpg-plugin</artifactId>
                  <version>3.0.1</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>

</project>
