Problem:
When I create aJAR
by eclipse
it works quietly, but I'm trying to take advantage of the JAR
that Maven
is creating and I noticed that it does not execute, because my main
class is not in Manifest
.
Use this setting in POM.XML
to inform my class Main
:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>ClasseMain</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
When I use mvn install
I get:
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.app:ClasseMain:jar:0.0.1-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-jar-plugin is missing. @ line 52, column 12
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
So I understood this warning and referring to the code I posted above, but I can not find a solution to the warning disappear. And even informing where class Main
JAR
is not running.
Doubt
If the code I am reporting in POM.XML
is incorrect to inform the class Main
which one is right?
How to disappear with WARNING
appearing whenever I make a mvn install
?