Você está na página 1de 5

How to Run NYB Shop API on Local Server

1. Install Apache Tomcat on local machine. Follow the instruction here


(https://www.ntu.edu.sg/home/ehchua/programming/howto/Tomcat_HowTo.html)

2. Clone the latest developed nybshop-spring project on VS online. User your own
authentication account:
git clone b develop [remote url]

3. Install Intellij IDEA Ultimate. This project requires Intellij IDEA Ultimate. Please get the
license from another team member

4. Open Intellij IDEA Ultimate

5. On the launch screen, Select Import Project

6. Navigate to the cloned project from VSO, then select pom.xml

7. You will be delivered to the project setup. You must check `Import Maven Project
Automatically` otherwise, you will need another sophisticated setup later.
8. Select the Maven Snapshot to be imported. In this initial phase it should be 0.0.1-
SNAPSHOT

9. Then, wait until the IDEA builds the project and download all the dependencies which
are listed on pom.xml

10. Next, this is a very important step, we need to make the res folder as the Resource root
folder. Right click on the res folder > select Mark Directory As > Select Resources Root.
The folder icon should be changed right away.
11. After the resource folder has been set, now we have to set the Run Configurations.
Select the icon on the left of Run icon, it should be empty. Then Select Edit
Configurations

Then, press + to select the type of server where the application will be deployed. In this
case we will use Local Tomcat
12. After the Local Tomcat Server has been selected, now we have to set the server
configuration,

First of all, select the Application Server, in this case we need to select the Apache
Tomcat which have already been installed on the local machine. You may need to
manually select the location of tomcat on your PC, so the IDEA can detect the Tomcat
configurations.

Secondly, you need to put the JMX port. Use the bigger port number such as 1099 or
another else.

Finally, there may be a warning No artifacts marked for deployment, as shown on the
image above, hit Fix and select war explode artifact. Press OK to finalize the
configurations.

13. Now you can run the project. To test the application, navigate to
http://localhost:8080/users/all. It will show the JSON result of data record on table user.
You need to set the database and table first on your MySQL. To edit the mysql
configurations, you can edit it on res/jdbc.properties

Você também pode gostar