javarestjerseydropwizard

Change Dropwizard default ports


I have a Dropwizard based Jersey REST service running on the default ports 8080(service) and 8081(admin), I need to change the default ports to something that is less commonly used, I am not able to find any information to do so , can someone please point me to do so ?


Solution

  • You can update the ports in your yaml configuration file:

    http:
      port: 9000
      adminPort: 9001
    

    See http://www.dropwizard.io/0.9.2/docs/manual/configuration.html#http for more information.

    EDIT

    If you've migrated to Dropwizard 0.7.x, 0.8.x, 0.9.x you can use the following:

    server:
      applicationConnectors:
      - type: http 
        port: 9000
      adminConnectors:
      - type: http
        port: 9001