Home > Blockchain >  Creating a jar from maven project Intellij
Creating a jar from maven project Intellij

Time:12-13

I created a new maven project in IntelliJ and set packaging to jar and when I build it, there is a jar file target folder. But when I run the file I get the error as no main manifest attribute, in QeToolHelper-0.1-SNAPSHOT.jar

I have created jar file using maven-assembly-plugin. I have added these lines in pom.xml for that. Tried few methods described in other similar questions but to no avail.

enter image description here

CodePudding user response:

Have you looked at SpringBoot and associated plugins. It can be used to build a standalone java applications.

With regards to your specific issue, that error is symtomatic of a failure to declare main class in your manifest. The main-class attribute in the manifest tells the jvm what class to load from the built jar. Looks like the settings in your maven config are failing to generate the resources correctly.

CodePudding user response:

I was able to solve this issue by creating jar package from maven. Running the build package created the jar in target directory.

where to find build package.

  • Related