- The Wizard
- Building and Running Project
- Setting Up Project Folder Structure in IntelliJ IDEA
A top down shooter by Group A
mvn install
# Running .jar
java -jar target/WizardGame-0.0.1-SNAPSHOT.jar
# Running main class
mvn exec:java -Dexec.mainClass="edu.sdccd.cisc191.wizardGame.Game"MacOS
brew install mavenWindows
First, Make sure you are in the project root directory.
With the included pom.xml from the repo and Maven already installed, run the
following to compile and install all dependencies
mvn installThen execute .jar file to run project
java -jar target/WizardGame-0.0.1-SNAPSHOT.jarTo run specific class. (replace <class> with path to java file starting from
edu.sdccd.cisc191.wizardGame directory, using . as path separator).
# Template
mvn exec:java -Dexec.mainClass="edu.sdccd.cisc191.wizardGame.<class>"
# Running Game class
mvn exec:java -Dexec.mainClass="edu.sdccd.cisc191.wizardGame.Game"
Gameclass can be ran by default using onlymvn exec:javaby modifyingpom.xml. Just uncomment this section from the xml file.<mainClass>can be changed to whatever default class to run.
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<configuration>
<mainClass>edu.sdccd.cisc191.wizardGame.Game</mainClass>
</configuration>
</plugin>To recompile project
mvn compileTo package project into a JAR file
mvn packageTo run test suite
mvn clean test
# -e to run tests with full stack trace on failures
mvn clean test -eTo clean and remove maven build from project
mvn cleanNOTE: If unit tests fail after new changes that prevents from building the
.jar file, although not recommended, simply skip unit testing from build by
running
mvn clean install -Dmaven.test.skipor to just compile and package into a JAR file without reinstalling dependencies
mvn package -Dmaven.test.skipant
ant runMacOS
brew install antWindows
First, Make sure you are in the project root directory.
With the included build.xml from the repo and Ant installed, to compile and
distribute .jar file, run
antThen run WizardGame.jar generated with
ant runFinally, to clean all build and dist run
ant cleanmkdir -p build
alias javarun='javac -Xlint -sourcepath src -d build src/main/**/*.java; find . -name "*.java" -not -path "*/test/*" > source.txt; java -cp build edu.sdccd.cisc191.wizardGame.Game'
javarunFrom root project directory. Create build directory.
mkdir -p buildThen run the following to compile .java into build directory as classpath
javac -Xlint -sourcepath src -d build src/main/**/*.java
find . -name "*.java" -not -path "*/test/*" > source.txtThen copy all resource files into build directory
cp src/main/resources/*.png src/main/resources/*.jpg buildThen run Game class
java -cp build edu.sdccd.cisc191.wizardGame.Gamejavac -Xlint -sourcepath src -d build src/main/**/*.java
find . -name "*.java" -not -path "*/test/*" > source.txt
java -cp build edu.sdccd.cisc191.wizardGame.GameAssign an alias to recompile with just one command
alias javarun='javac -Xlint -sourcepath src -d build src/main/**/*.java; find . -name "*.java" -not -path "*/test/*" > source.txt; java -cp build edu.sdccd.cisc191.wizardGame.Game'Then simply run
javarunrm -r build source.txt



