Closed dgo2dance closed 4 years ago
Hi, duanshuyong0!
Assuming that JAVA_HOME and MAVEN_HOME paths are set as environment variables:
first, cd
into the project root folder using command line.
a) mvn clean compile
(will not create a jar file)
to execute:
mvn exec:java -Dexec.mainClass="org.betaiotazeta.autoshiftplanner.AspApp"
or
b) mvn clean package
To run an application packaged as a jar file it requires the Main-Class manifest header, the application's entry point, e.g. add "Main-Class: org.betaiotazeta.autoshiftplanner.AspApp" to manifest. Then you would also need to specify all the dependencies manually, by using the Class-Path header in the manifest or by specifying -classpath flag when invoking Java to run the application.
or
c) mvn clean compile assembly:single
(for a single jar file with dependencies)
In our case in pom.xml only maven-assembly-plugin has been configured with the mainClass specified!
Jar can then be executed with java -jar filename.jar
.
What command to execute to make the source code jar package
mvn package then java -jar
Tips:No main program list