spring-guides / gs-rest-service-cors

Enabling Cross Origin Requests for a RESTful Web Service :: Learn how to create a RESTful web service with Spring that support Cross-Origin Resource Sharing (CORS).

Home Page:https://spring.io/guides/gs/rest-service-cors/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Spring Boot minimal application not running via Windows PowerShell

opened this issue · comments

Is the command to run the minimal Spring Boot application correct in PowerShell environment? Am I missing something? I'm following the guide and it seems it cannot run. Using:

PS C:\Users\mbresciani\Desktop\Spring\Guides\Enabling Cross Origin Requests for a RESTful Web Service> & 'C:\Program Files (x86)\spring-1.1.5.RELEASE\bin\spring.bat' run app.groovy -- --server.port=9000

The immediate answer I see is

'server.port' is not a recognized option

It runs properly in normal command prompt. The gradle bootRun command works even in PowerShell.

Interesting. When I copy and paste this command (adjusting the path to match my environment), it seems to execute properly and set the server port to 9000. However, if I remove the -- part of the command right before the --server.port argument, I get the same error as you are seeing.

Can you try putting that first -- part in quotes like the following:

& 'C:\Program Files (x86)\spring-1.1.5.RELEASE\bin\spring.bat' run app.groovy '--' --server.port=9000

Cool! Works!