Exibe um pom.xml do Maven com as configuraçes para o Maven criar um arquivo FatJar.
Created
February 11, 2019 14:44
-
-
Save lin-br/05ff7eee40928307f6b647e91922189d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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"> | |
<name>NomeDoMeuProjeto</name> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>xyz.tilmais</groupId> | |
<artifactId>NomeDoMeuProjeto</artifactId> | |
<version>0.0.0</version> | |
<packaging>jar</packaging> | |
<properties> | |
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | |
<!--Versão java source e target--> | |
<maven.compiler.source>1.8</maven.compiler.source> | |
<maven.compiler.target>1.8</maven.compiler.target> | |
<!-- java.mainClass: Java main Class --> | |
<java.mainClass>xyz.tilmais.Main</java.mainClass> | |
</properties> | |
<build> | |
<plugins> | |
<!-- FATJAR --> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-assembly-plugin</artifactId> | |
<version>2.4.1</version> | |
<configuration> | |
<archive> | |
<manifest> | |
<addClasspath>true</addClasspath> | |
<classpathPrefix>libs/</classpathPrefix> | |
<mainClass>${java.mainClass}</mainClass> | |
</manifest> | |
</archive> | |
<descriptorRefs> | |
<descriptorRef>jar-with-dependencies</descriptorRef> | |
</descriptorRefs> | |
</configuration> | |
<executions> | |
<execution> | |
<id>make-assembly</id> | |
<phase>package</phase> | |
<goals> | |
<goal>single</goal> | |
</goals> | |
</execution> | |
</executions> | |
</plugin> | |
<!-- JAR EXTERNAL LIBS --> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-jar-plugin</artifactId> | |
<version>2.4</version> | |
<configuration> | |
<archive> | |
<manifest> | |
<addClasspath>true</addClasspath> | |
<classpathPrefix>libs/</classpathPrefix> | |
<mainClass>${java.mainClass}</mainClass> | |
</manifest> | |
</archive> | |
</configuration> | |
</plugin> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-dependency-plugin</artifactId> | |
<version>2.4</version> | |
<executions> | |
<execution> | |
<id>copy</id> | |
<phase>install</phase> | |
<goals> | |
<goal>copy-dependencies</goal> | |
</goals> | |
<configuration> | |
<outputDirectory> | |
${project.build.directory}/libs | |
</outputDirectory> | |
</configuration> | |
</execution> | |
</executions> | |
</plugin> | |
</plugins> | |
</build> | |
</project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment