title: Jetty: Hide port number in the URL
body: <p>I buy a domain name: <code>test.com</code>.</p>
  
  <p>Then I run jetty by doing:</p>
  
  <pre><code>/opt/jetty# nohup java -jar start.jar
  </code></pre>
  
  <p>When I go on my web site (<code>http://test.com</code>), It's not working, I need to add the port number like: <code>http://test.com:8080</code> and this is very dirty. So, I want to delete or hide this port number. </p>
  
  <p>What I tried is to run jetty with the port number like: </p>
  
  <pre><code>nohup java -jar start.jar -Djetty.http.port=8080
  </code></pre>
  
  <p>Then, in the file jetty-http.xml (in <code>/opt/jetty/etc</code>), I changed the line:</p>
  
  <pre><code>&lt;Set name="port"&gt;&lt;Property name="jetty.http.port" deprecated="jetty.port" default="8080" /&gt;&lt;/Set&gt;
  </code></pre>
  
  <p>I am using:</p>
  
  <ul>
  <li>Vaadin.</li>
  <li>Maven.</li>
  <li>Jetty.</li>
  </ul>
  
  <p>Where should I manage this?</p>
  
  <p><strong>EDIT :</strong></p>
  
  <p>As required, this is the pom.xml </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
      &lt;groupId&gt;com.example&lt;/groupId&gt;
      &lt;artifactId&gt;test&lt;/artifactId&gt;
      &lt;packaging&gt;war&lt;/packaging&gt;
      &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
      &lt;name&gt;test&lt;/name&gt;
  
      &lt;prerequisites&gt;
          &lt;maven&gt;3&lt;/maven&gt;
      &lt;/prerequisites&gt;
  
      &lt;properties&gt;
          &lt;vaadin.version&gt;8.0.4&lt;/vaadin.version&gt;
          &lt;vaadin.plugin.version&gt;8.0.4&lt;/vaadin.plugin.version&gt;
          &lt;jetty.plugin.version&gt;9.3.9.v20160517&lt;/jetty.plugin.version&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
          &lt;maven.compiler.source&gt;1.8&lt;/maven.compiler.source&gt;
          &lt;maven.compiler.target&gt;1.8&lt;/maven.compiler.target&gt;
          &lt;jetty.port&gt;8080&lt;/jetty.port&gt;
          &lt;vaadin.widgetset.mode&gt;local&lt;/vaadin.widgetset.mode&gt;
      &lt;/properties&gt;
  
      &lt;dependencyManagement&gt;
          &lt;dependencies&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;com.vaadin&lt;/groupId&gt;
                  &lt;artifactId&gt;vaadin-bom&lt;/artifactId&gt;
                  &lt;version&gt;${vaadin.version}&lt;/version&gt;
                  &lt;type&gt;pom&lt;/type&gt;
                  &lt;scope&gt;import&lt;/scope&gt;
              &lt;/dependency&gt;
          &lt;/dependencies&gt;
      &lt;/dependencyManagement&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.vaadin&lt;/groupId&gt;
              &lt;artifactId&gt;vaadin-compatibility-server&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.vaadin&lt;/groupId&gt;
              &lt;artifactId&gt;vaadin-compatibility-client-compiled&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.vaadin&lt;/groupId&gt;
              &lt;artifactId&gt;vaadin-server&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.vaadin&lt;/groupId&gt;
              &lt;artifactId&gt;vaadin-client-compiled&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.vaadin&lt;/groupId&gt;
              &lt;artifactId&gt;vaadin-themes&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
              &lt;artifactId&gt;javax.servlet-api&lt;/artifactId&gt;
              &lt;version&gt;3.0.1&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
                  &lt;version&gt;3.0.0&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;failOnMissingWebXml&gt;false&lt;/failOnMissingWebXml&gt;
                      &lt;packagingExcludes&gt;WEB-INF/classes/VAADIN/widgetsets/WEB-INF/**&lt;/packagingExcludes&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;com.vaadin&lt;/groupId&gt;
                  &lt;artifactId&gt;vaadin-maven-plugin&lt;/artifactId&gt;
                  &lt;version&gt;${vaadin.plugin.version}&lt;/version&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;update-theme&lt;/goal&gt;
                              &lt;goal&gt;update-widgetset&lt;/goal&gt;
                              &lt;goal&gt;compile&lt;/goal&gt;
                              &lt;goal&gt;compile-theme&lt;/goal&gt;
                          &lt;/goals&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-clean-plugin&lt;/artifactId&gt;
                  &lt;version&gt;3.0.0&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;filesets&gt;
                          &lt;fileset&gt;
                              &lt;directory&gt;src/main/webapp/VAADIN/themes&lt;/directory&gt;
                              &lt;includes&gt;
                                  &lt;include&gt;**/styles.css&lt;/include&gt;
                                  &lt;include&gt;**/styles.scss.cache&lt;/include&gt;
                              &lt;/includes&gt;
                          &lt;/fileset&gt;
                      &lt;/filesets&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
  
              &lt;plugin&gt;
                  &lt;groupId&gt;org.eclipse.jetty&lt;/groupId&gt;
                  &lt;artifactId&gt;jetty-maven-plugin&lt;/artifactId&gt;
                  &lt;version&gt;${jetty.plugin.version}&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;contextPath&gt;/login&lt;/contextPath&gt;
                      &lt;scanIntervalSeconds&gt;2&lt;/scanIntervalSeconds&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>To prevent question, I tried to delete the 
  <code>&lt;jetty.port&gt;8080&lt;/jetty.port&gt;</code> without sucess. </p>
  
  <p><strong>EDIT</strong> : Based on <a href="https://stackoverflow.com/questions/37693480/maven-jetty-plugin-remove-localhost-server-name-from-url">maven jetty plugin - remove localhost/server name from url</a></p>
  
  <p>I tried to changed the <code>localhost</code>to myapplicationname from <code>/etc/hosts</code>. I restart jetty. And, it's not working</p>