<build>
<finalName>xvmain</finalName>
<plugins>
<!-- <plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-jar-plugin</artifactId><version>3.3.0</version><configuration><archive><manifest><mainClass>validation.XMain</mainClass></manifest></archive></configuration></plugin> -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.6.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<archive>
<manifest>
<mainClass>
validation.XMain
</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>bl</descriptorRef>
</descriptorRefs>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
can run the package as:
java -jar xv.jar