exemplo
Used in:
components
- OverviewOverview
- VersionsVersions
- DependentsDependents
- DependenciesDependencies
<dependency>
<groupId>com.github.kyriosdata</groupId>
<artifactId>exemplo</artifactId>
<version>1.0.0</version>
</dependency><?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">
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.kyriosdata</groupId>
<artifactId>exemplo</artifactId>
<packaging>jar</packaging>
<version>1.0.0</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.mainClass>com.github.kyriosdata.exemplo.ProgramaCalendario</project.mainClass>
</properties>
<name>${project.groupId}:${project.artifactId}</name>
<description>
Projeto de referência (exemplo) inicial de desenvolvimento em Java com uso de JUnit.
</description>
<url>https://github.com/kyriosdata/exemplo</url>
<organization>
<name>Instituto de Informática (UFG) - Fábrica de Software</name>
<url>http://www.inf.ufg.br</url>
</organization>
<inceptionYear>2016</inceptionYear>
<licenses>
<license>
<name>Creative Commons Attribution 4.0 International (CC BY 4.0)</name>
<comments>A atribuição deve conter, explicitamente, a seguinte linha:
Copyright (c) 2016. Fábrica de Software - Instituto de Informática (UFG)
</comments>
<url>https://creativecommons.org/licenses/by/4.0/</url>
</license>
</licenses>
<developers>
<developer>
<id>kyriosdata</id>
<name>Fábio Nogueira de Lucena</name>
<email>fabio@inf.ufg.br</email>
<organization>Instituto de Informática (UFG)</organization>
<organizationUrl>http://www.inf.ufg.br</organizationUrl>
</developer>
</developers>
<scm>
<connection>scm:git:https://github.com/kyriosdata/exemplo.git</connection>
<developerConnection>scm:git:https://github.com/kyriosdata/exemplo.git</developerConnection>
<url>https://github.com/kyriosdata/exemplo</url>
</scm>
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.2.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.11.0</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.11.0</version>
</dependency>
</dependencies>
<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>
<build>
<!-- Define o nome do arquivo a ser gerado (.jar é acrescentada) -->
<finalName>Exemplo</finalName>
<plugins>
<!-- snyk -->
<!-- mvn snyk:test ou snyk:monitor -->
<!-- snyk.token definito em settings.xml (Snyk API Token) -->
<plugin>
<groupId>io.snyk</groupId>
<artifactId>snyk-maven-plugin</artifactId>
<version>1.1.1</version>
<executions>
<execution>
<id>snyk-test</id>
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
</execution>
<execution>
<id>snyk-monitor</id>
<phase>install</phase>
<goals>
<goal>monitor</goal>
</goals>
</execution>
</executions>
<configuration>
<apiToken>${snyk.token}</apiToken>
<failOnSeverity>low</failOnSeverity>
<org>kyriosdata</org>
</configuration>
</plugin>
<!-- surefire -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.21.0</version>
<dependencies>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-surefire-provider</artifactId>
<version>1.2.0</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.2.0</version>
</dependency>
</dependencies>
</plugin>
<!-- SPOTBUGS -->
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<version>3.1.5</version>
</plugin>
<!-- javadoc:javadoc -->
<!-- target/site/apidocs/index.html -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.0.1</version>
<configuration>
<show>public</show>
<additionalOptions>
<additionalOption>-html5</additionalOption>
</additionalOptions>
</configuration>
</plugin>
<!-- JavaNCSS -->
<!-- Verifica limite de complexidade ciclomática -->
<!-- Verifica número de sentenças (código fonte) -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>javancss-maven-plugin</artifactId>
<version>2.1</version>
<configuration>
<failOnViolation>true</failOnViolation>
<ccnLimit>111</ccnLimit>
<ncssLimit>90</ncssLimit>
</configuration>
</plugin>
<!-- sonar -->
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>3.3.0.603</version>
</plugin>
<!-- FindBugs Static Analysis -->
<!-- mvn compile; mvn findbugs:findbugs; mvn findbugs:gui -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>3.0.1</version>
<configuration>
<effort>Max</effort>
<threshold>Low</threshold>
<failOnError>true</failOnError>
<includeFilterFile>${session.executionRootDirectory}/findbugs-security-include.xml
</includeFilterFile>
<excludeFilterFile>${session.executionRootDirectory}/findbugs-security-exclude.xml
</excludeFilterFile>
<plugins>
<plugin>
<groupId>com.h3xstream.findsecbugs</groupId>
<artifactId>findsecbugs-plugin</artifactId>
<version>LATEST</version> <!-- Auto-update to the latest stable -->
</plugin>
</plugins>
</configuration>
</plugin>
<!-- mvn org.pitest:pitest-maven:muatationCoverage -->
<!-- Relatório em: target/pit-reports/YYYYMMDDHHMM -->
<plugin>
<groupId>org.pitest</groupId>
<artifactId>pitest-maven</artifactId>
<version>1.1.10</version>
<configuration>
<targetClasses>
<param>com.github.kyriosdata.exemplo.Calendario</param>
</targetClasses>
<targetTests>
<param>com.github.kyriosdata.exemplo.*</param>
</targetTests>
</configuration>
</plugin>
<!-- maven-compiler-plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<!-- mvn verify -->
<!-- Gera dependency-check-report.html in 'target' -->
<plugin>
<groupId>org.owasp</groupId>
<artifactId>dependency-check-maven</artifactId>
<version>3.2.1</version>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- PMD -->
<!-- mvn pmd:pmd -->
<!-- mvn pmd:check -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>3.10.0</version>
<configuration>
<linkXref>true</linkXref>
<sourceEncoding>utf-8</sourceEncoding>
<minimumTokens>10</minimumTokens>
<excludes>
<exclude>**/*Bean.java</exclude>
<exclude>**/generated/*.java</exclude>
</excludes>
<excludeRoots>
<excludeRoot>target/generated-sources/stubs</excludeRoot>
</excludeRoots>
<rulesets>
<ruleset>/category/java/bestpractices.xml</ruleset>
<ruleset>/category/java/codestyle.xml</ruleset>
<ruleset>/category/java/design.xml</ruleset>
<ruleset>/category/java/documentation.xml</ruleset>
<ruleset>/category/java/errorprone.xml</ruleset>
<ruleset>/category/java/multithreading.xml</ruleset>
<ruleset>/category/java/performance.xml</ruleset>
<ruleset>/category/java/security.xml</ruleset>
</rulesets>
</configuration>
</plugin>
</plugins>
</build>
<!-- mvn site (gera relatório em Project Report -->
<!-- reporting está relacionado à fase 'site' -->
<reporting>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>javancss-maven-plugin</artifactId>
<version>2.1</version>
<configuration>
<failOnViolation>true</failOnViolation>
<ccnLimit>111</ccnLimit>
<ncssLimit>90</ncssLimit>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>3.10.0</version>
<configuration>
<linkXref>true</linkXref>
<sourceEncoding>utf-8</sourceEncoding>
<minimumTokens>100</minimumTokens>
<excludes>
<exclude>**/*Bean.java</exclude>
<exclude>**/generated/*.java</exclude>
</excludes>
<excludeRoots>
<excludeRoot>target/generated-sources/stubs</excludeRoot>
</excludeRoots>
<rulesets>
<ruleset>/category/java/bestpractices.xml</ruleset>
<ruleset>/category/java/codestyle.xml</ruleset>
<ruleset>/category/java/design.xml</ruleset>
<ruleset>/category/java/documentation.xml</ruleset>
<ruleset>/category/java/errorprone.xml</ruleset>
<ruleset>/category/java/multithreading.xml</ruleset>
<ruleset>/category/java/performance.xml</ruleset>
<ruleset>/category/java/security.xml</ruleset>
</rulesets>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jdepend-maven-plugin</artifactId>
<version>2.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
<version>2.3</version>
</plugin>
<!-- mvn checkstyle:checkstyle -->
<!-- mvn checkstyle:check -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.0.0</version>
<reportSets>
<reportSet>
<reports>
<report>checkstyle</report>
</reports>
</reportSet>
</reportSets>
</plugin>
<!-- SPOTBUGS -->
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<version>3.1.5</version>
</plugin>
</plugins>
</reporting>
<profiles>
<!-- executavel-dir -->
<!-- executável usa diretório 'jars' -->
<profile>
<id>executavel-dir</id>
<build>
<plugins>
<!-- PASSO (1/2) PARA GERAÇÃO DE JAR FILE EXECUTÁVEL -->
<!-- Exige dir 'jars' e Exemplo.jar no mesmo diretório -->
<!-- Dependências são copiadas para diretório 'jars' -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.10</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<includeScope>runtime</includeScope>
<outputDirectory>${project.build.directory}/jars/</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<!-- PASSO (2/2) PARA GERAÇÃO DE JAR FILE EXECUTÁVEL -->
<!-- Configura arquivo MANIFEST.MF -->
<!-- Class-Path: formado pelos arquivos em 'jars' -->
<!-- Main-Class: classe a ser executada (método main)) -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
<configuration>
<archive>
<!-- Evita inclusão dir 'maven' em META-INF -->
<addMavenDescriptor>false</addMavenDescriptor>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>jars/</classpathPrefix>
<mainClass>${project.mainClass}</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<!-- executavel-unico -->
<!-- Jar file gerado é suficiente -->
<profile>
<id>executavel-unico</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<finalName>Exemplo-unico</finalName>
<archive>
<manifest>
<mainClass>${project.mainClass}</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<!-- cobertura -->
<!-- Gera relatório de cobertura -->
<profile>
<id>cobertura</id>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.1</version>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>default-report</id>
<phase>prepare-package</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<!-- PROFILE: release -->
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<!-- OMITE INFORMACAO DE DEBUGGING -->
<compilerArgs>
<arg>-g:none</arg>
</compilerArgs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>package-sources</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.4</version>
<executions>
<execution>
<id>package-javadoc</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<!-- deploy (Maven Central) -->
<profile>
<id>deploy</id>
<build>
<plugins>
<!-- Gerar documentação (javadoc) -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.0.1</version>
<configuration>
<show>public</show>
<additionalOptions>
<additionalOption>-html5</additionalOption>
</additionalOptions>
</configuration>
<executions>
<execution>
<id>package-javadoc</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Agrega sources em jar -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>package-sources</id>
<phase>package</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Acesso para deploy no OSSRH Nexus Repository Manager -->
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.8</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
<!-- Assinar arquivos -->
<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>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>