[JAVA] Check the operation using jetty with Maven.

Introduction

When checking the operation of dynamic files using eclipse, it only works on that terminal. So, use jetty to check the operation. Also, personally, the maven project in eclipse has a different directory structure, which is annoying.

procedure

Edit pom.xml

Add the following plugins.

        <plugin>
          <groupId>org.mortbay.jetty</groupId>
          <artifactId>maven-jetty-plugin</artifactId>
          <version>6.1.10</version>
          <configuration>
            <scanIntervalSecounds>10</scanIntervalSecounds>
            <connectors>
              <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
              <port>8080</port>
              <maxIdleTime>60000</maxIdleTime>
              </connector>
            </connectors>
          </configuration>
        </plugin>

Run jetty.

Do the following in the command line:

mvn jetty:run

Connect to localhost.

Access http: // localhost: 8080.

Finally

Sometimes jetty didn't work. It took a long time to isolate whether pom.xml is bad, the terminal is bad, or the plugin is bad. As a result, it is better to set up a container for build and check it each time, and I think it is good because there is no dependency problem.

Recommended Posts

Check the operation using jetty with Maven.
Check the operation of two roles with a chat application
I tried to check the operation of gRPC server with grpcurl
Check the contents of params with pry
Check the processing contents with [rails] binding.pry
Try using the Wii remote with Java
Build TensorFlow operation check environment with Docker
Check the operation of the interface through threads
Using templates on the classpath with Apache Velocity
Try using Maven
Try using another Servlet container Jetty with Docker
I tried to check the operation of http request (Put) with Talented API Tester
[Final version] Check the operation of the Japanese calendar using ICU to support the new era.
Check the behavior of Java Intrinsic Locks with bpftrace
Check the result of generic parameter inference with JShell
Using Pair with OpenJDK
Weak Reference operation check
Check the dependency of a specific maven artifact in Coursier
Check the status of Java application without using monitoring tool
Specify the character code of the source when building with Maven
[Java] Check the difference between orElse and orElseGet with IntStream
I tried using the CameraX library with Android Java Fragment
[Maven] Disable .Net-based Assembly Analyzer with OWASP Dependency Check [Java]