Home >Java >javaTutorial >What is the Maven packaging method and the method of executing jar in Java?
<plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.8.1</version> <configuration> <source>1.8</source> <target>1.8</target> <encoding>UTF-8</encoding> </configuration> </plugin> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins>
java -jar hello-world-0.0.1-SNAPSHOT.jar
java -classpath hello -world-0.0.1-SNAPSHOT.jar com.demo.controller.HelloController
public class HelloController { public static void main(String[] args) { for (int x = 0; x < 100 ; x++) { System.out.println("this is " +i+ " test"); } }
Those who can see the essence of something in one second and those who spend half a lifetime unable to see the essence of something clearly have different fates.
The above is the detailed content of What is the Maven packaging method and the method of executing jar in Java?. For more information, please follow other related articles on the PHP Chinese website!