-
Notifications
You must be signed in to change notification settings - Fork 1
Executing MongoDB Example
Suren Konathala edited this page Aug 2, 2018
·
1 revision
Maven let's us run/execute a single Java class from within a web application or a project on the command line. The command structure is like mvn exec:java -Dexec.mainClass="mainclass"
For example, JAQStack core has an example java class file /jaqstack/core/src/main/java/com/jaqstack/data/MongoExample.java
to demonstrate the connection to a MongoDB server. And to test this class file, do the following:
- Compile the entire project using
mvn clean package
- Run this command
mvn exec:java -Dexec.mainClass="com.jaqstack.data.MongoExample"