It seems even when you use maven archetypes like maven-archetype-quickstart or maven-archetype-simple, setting the mainClass
manifest seems to be still something one has to do manually. However, going to the Q&A that provides the necessary POM entry and copy-pasting it seems inefficient. Is there some maven command or some other tool to set it? Or is there some archetype that already contains this entry?
Asked
Active
Viewed 40 times
0

Yushin Washio
- 675
- 8
- 12
-
You could create your own archetype. You can set up a project with the necessary configuration and generate an archetype from it. – J Fabian Meier Apr 29 '18 at 19:16
-
Thanks, I was wondering if that’s even a good idea, since the quickstart archetype notably omits it although it contains a class with a main function. – Yushin Washio Apr 29 '18 at 19:25
-
Does that really makes sense cause usually in each project the main class is different? Isn't it? – khmarbaise Apr 29 '18 at 19:45
-
@khmarbaise I wouldn’t even mind manually editing pom.xml, if it’s just the name of the class. (whenever I want to name the class not "App" as in the archetype) I just don’t like typing in the whole tree for "maven-jar-plugin" plugin. – Yushin Washio Apr 29 '18 at 23:15