Skip to content

Instantly share code, notes, and snippets.

@HSGamer
Created June 4, 2024 19:20
Show Gist options
  • Save HSGamer/8c56f5821eb9a86914003f2a783f9580 to your computer and use it in GitHub Desktop.
Save HSGamer/8c56f5821eb9a86914003f2a783f9580 to your computer and use it in GitHub Desktop.
Dependency Folder and Lib Classpath with Maven
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.6.1</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>false</overWriteSnapshots>
<overWriteIfNewer>true</overWriteIfNewer>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
<mainClass>me.hsgamer.edusys.MainJFrame</mainClass> <!-- Change this to your main class -->
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment