Skip to content

Instantly share code, notes, and snippets.

@cnmoro
Last active August 1, 2019 19:44
Show Gist options
  • Save cnmoro/0991bdf12fccc1ab848dc8821a2f4953 to your computer and use it in GitHub Desktop.
Save cnmoro/0991bdf12fccc1ab848dc8821a2f4953 to your computer and use it in GitHub Desktop.
Generate .jar in maven project
<dependencies>
<!-- https://mvnrepository.com/artifact/org.mongodb/mongo-java-driver -->
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongo-java-driver</artifactId>
<version>3.10.2</version>
</dependency>
</dependencies>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<name>NOMEDOPROJETO</name>
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>package.Main</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
</plugins>
</build>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment