Today, when you're learning maven, you need to execute the jar file that Maven builds correctly, so you need to execute the jar file to see if the results are correct.
The catalog results for the MAVEN project are as follows:
The working directory for Eclipse is under E:\workspace\EX11, as shown in the following illustration:
The jar file built by Maven is in the target directory with the name Helloworld-0.0.1-snapshot and executes the following commands directly under DOS:
E:\workspace\ex11\helloworld\target>java-jar Helloworld-0.0.1-snapshot.jar
There is no master manifest attribute in Helloworld-0.0.1-snapshot.jar
e:\workspace\ex11\helloworld\target>
The result is that there is no main list attribute in the jar, and the last search was made on the Internet. You can use the-CP command as follows:
JAVA-CP Yourjarfilename.jar Fullpackagename. ClassName
Re-execute using-CP with the following command:
E:\WORKSPACE\EX11\HELLOWORLD\TARGET>JAVA-CP Helloworld-0.0.1-snapshot.jar COM.R
icky.maven2.App maven
Hello World maven!
E:\workspace\ex11\helloworld\target>
Hello World came out, the execution jar was successful.
Finally, attach a complete description of-jar in the JDK