title: How do I set the port using maven?
body: <p>I'm using Maven from the command line on Windows, but I don't need to necessarily change the port from the command line specifically.</p>
  
  <p>Running the command </p>
  
  <pre><code>mvn -Djetty.http.port=8000 exec:java
  </code></pre>
  
  <p>results in the following output:</p>
  
  <pre><code>[INFO] Scanning for projects...
  [WARNING] The project com.google.apis-samples:oauth2-cmdline-sample:jar:1 
  uses prerequisites which is only intended for maven-plugin projects but not 
  for non maven-plugin projects. For such purposes you should use the maven-
  enforcer-plugin. See https://maven.apache.org/enforcer/enforcer-
  rules/requireMavenVersion.html
  [INFO]
  [INFO] ---------------------------------------------------------------------
  ---
  [INFO] Building Example for the OAuth2 API using JSON and OAuth 2.0 1
  [INFO] -------------------------------------------------------------------- 
  ----
  [INFO]
  [INFO] &gt;&gt;&gt; exec-maven-plugin:1.1:java (default-cli) &gt; validate @ oauth2-
  cmdline-sample &gt;&gt;&gt;
  [INFO]
  [INFO] &lt;&lt;&lt; exec-maven-plugin:1.1:java (default-cli) &lt; validate @ oauth2-
  cmdline-sample &lt;&lt;&lt;
  [INFO]
  [INFO]
  [INFO] --- exec-maven-plugin:1.1:java (default-cli) @ oauth2-cmdline-sample       
  ---
  Jun 19, 2017 5:09:53 PM 
  com.google.api.client.util.store.FileDataStoreFactory 
  setPermissionsToOwnerOnly
  WARNING: unable to change permissions for everybody: 
  C:\Users\roxlala\.store\oauth2_sample
  Jun 19, 2017 5:09:53 PM 
  com.google.api.client.util.store.FileDataStoreFactory 
  setPermissionsToOwnerOnly
  WARNING: unable to change permissions for owner: 
  C:\Users\roxlala\.store\oauth2_sample
  2017-06-19 17:09:53.229:INFO::Logging to STDERR via 
  org.mortbay.log.StdErrLog
  2017-06-19 17:09:53.229:INFO::jetty-6.1.26
  2017-06-19 17:09:53.259:INFO::Started SocketConnector@localhost:1871
  Please open the following address in your browser:
    https://accounts.google.com/o/oauth2/auth?client_id=&lt;my-id&gt;.
  googleusercontent.com&amp;redirect_uri=http: 
  //localhost:1871/Callback&amp;response_type=code&amp;scope=https://www.googleapis. 
  com/auth
  /userinfo.profile%20https://www.googleapis.com/auth/userinfo.email
  Attempting to open that address in the default browser now...
  </code></pre>