Example Create a simple project. Apache Maven JAR Plugin » 3.0.2. The resultant jar is also called 'fat jar'. I have a rather odd question that makes me look like a newbie (which I kind of am). This snippet configures a special resource transformer which sets the Main-Class entry in the MANIFEST.MF of the shaded JAR. License: Apache 2.0: Categories: Maven Plugins: Date (Jun 18, 2016) Files: pom (6 KB) maven-plugin (26 KB) View All: Repositories: Central Liferay Public: Used By: 36 artifacts: Note: There is a new version for this artifact. i give the class name in pom, while running the jar file in command line i got this error 'Could not find or load main class'.
Create a project using maven-archetype-quickstart with following parameters. Add project dependency classpath. If you want to create an executable jar file, you need to configure Maven Archiver accordingly. Apache Maven JAR Plugin » 3.1.0. Hi Sir, I have a maven project and it has two maven modules, the parent maven project has some classes as well as test class. You need to tell it which main class to use. Root cause. These assets are loaded relative to where the JAR is executed and not from within the JAR itself.
When running a file, I have to specify the main class.
Answered. In other words, they must exist outside the JAR. This tutorial will show you how to use the maven-jar-plugin to create a manifest file, and package / add it into the final jar file. Package Version and Sealing Builds a Java Archive (JAR) file from the compiled project … In other words, they must exist outside the JAR. 4.3. If it is not able to find an entry,then it will complain with Unable to execute jar-file: “ no main manifest attribute ”.
Main-Class: com.baeldung.Application Class-Path: core.jar lib/ properties/ The classpath includes core.jar and all the files in the lib and properties directories. Main-Class : com.acme.MainClass Class-Path : dependecy1.jar dependecy2.jar ..... Krug: jar-root |-- .... |-- com/acme/../*.class |-- dependecy1.jar `-- dependecy2.jar Ich benutze das maven-jar-plugin, um die Manifest-Datei und das maven-shade-plugin zu erstellen, um das "uber" jar zu erstellen, aber die Abhängigkeiten werden entpackt und als Klassen zu meinem jar hinzugefügt.
Package Version and Sealing Maven Jar Plugin Main Class is yet another Android game that casts you in the role of a stealthy ninja on the run. It allows the module main class and version to be specified, adds the list of the packages included in the module and verifies that the module descriptor is correct. How to choose main class Follow.