Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I set a local hosting port for my gradle project with Intellij?

How do I set a local hosting port for my gradle project with Intellij?

I'm trying to run a Gradle project with bootstrap in the intelliJ IDE. Upon running it i get the fallowing error:

APPLICATION FAILED TO START
***************************

Description:

The Tomcat connector configured to listen on port 8080 failed to start. The port may already be in use or the connector may be misconfigured.

Action:

Verify the connector's configuration, identify and stop any process that's listening on port 8080, or configure this application to listen on another port.

I have looked into what would be listening on that port and how to kill it seemed like more trouble than it's worth. This is what I tried.:

This is what I tried.

I'm looking for how to change the port that my project uses. I'm using IntelliJ 2017.1 and Gradle 3.4.1. most solutions I've seen employ a BuildConfig.groovy file but I don't believe my project has any such file.

Any way to get around the hosting problem would be great but right now I'm thinking changing the default port is the best way.

like image 723
LittleRaven Avatar asked Oct 21 '25 14:10

LittleRaven


1 Answers

Based on your comment, you are running a Spring Boot application and you want to change the server port. You are running a server, even if you want to run the application locally for testing. Spring Boot comes with a embedded Tomcat or Jetty.

You can change the port by changing the application property server.port. You can pass it on command-line:

--server.port=8090

or set it in application.properties:

server.port=8090

or application.yml

server:
    port: 8090

See the documentation for more information.

like image 182
MartinTeeVarga Avatar answered Oct 23 '25 07:10

MartinTeeVarga



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!