code: public void lock()
      {
          log.info("Elasticsearch has started and the maven process has been blocked. Press CTRL+C to stop the process.");
  
          synchronized (lock)
          {
              try
              {
                  lock.wait();
              }
              catch (InterruptedException exception)
              {
                  log.warn("RunElasticsearchNodeMojo interrupted");
              }
          }
      }
docs: Causes the current thread to wait indefinitely. This method does not return.