betaiotazeta / AutoShiftPlanner

Auto Shift Planner is a user-friendly desktop application that can design detailed employees shift schedules and solve them automatically while meeting the maximum satisfaction of constraints.
https://betaiotazeta.github.io/AutoShiftPlanner
GNU General Public License v3.0
51 stars 22 forks source link

What command to execute to make the source code jar package #1

Closed dgo2dance closed 4 years ago

dgo2dance commented 4 years ago

What command to execute to make the source code jar package

mvn package then java -jar

Tips:No main program list

betaiotazeta commented 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.