Web services to build
Once you know how to use the IDEA Git, we are ready to start making preparation before development projects.
It requires Java Servlet api and Jetty maven plugins, which can be in two links: https://mvnrepository.com/ download.
Jetty maven plugins to use it as a plug-in:
the Java Servlet API Link Maven copy paste the link to the project pom.xml file:
Increase the allocation information
Click here to add configuration information.
Click +
to select Maven
, enter a project name, Command line
enter the jetty:run
click ok to.
Run the program, when the display [INFO] Started Jetty Server
says that the program can be up and running, and this time the port number is 8080, the current path is the path http: // localhost: 8080 /.
Connector Configuration
When our port 8080 is occupied, we can configure the connector to change the port number:
<connectors>
<connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
<port>8081</port>
<maxIdleTime>6000</maxIdleTime>
</connector>
</connectors>
Also in connectors
which we can modify maxIdleTime
to modify the idle time.
Configuration path
<webApp>
<contextPath>/test</contextPath>
</webApp>
After configuring these parameters, re-run the program, you can see at this time of the port number is 8081, and the path is http: // localhost: 8081 / test /.
Similarly, copy the Java Servlet api code into the Maven pom.xml file:
Finally, the above code, commit
the local repository push
to the Gitee can (recommended).