I'm using Grails Spring Security plugin version:
compile ":spring-security-core:2.0-RC4"
compile ":spring-security-acl:2.0-RC2"
is it possible to turn off password check somehow for my dev environment?
If what you want is diable security in the development environment, you can do this by adding this line in your development section of your grails configuration (depending on your version of grails, here Config.groovy, for grails 2.x):
environments {
development {
grails.plugin.springsecurity.active = false
}
}
In grails 3, you can do this in application.yml
environments:
development:
grails:
plugin:
springsecurity:
active: false
If I create a new web profile app, and generate-all, it runs fine in my local and deploys without error to JBoss. But when I try to access the app all URLs return 404. I know the app started up successfully, because it created tables in the database.
Here's what I'm doing.
grails 3.1.4> create-app demo
create-domain-class Book
create-domain-class Author
Edit domain classes
generate-all *
change tomcat dependency from compile to provided in build.gradle
change dataSource in application.yml to use my JNDI Oracle connection
Add server: contextPath: /demo to application.yml
run-app -> Works
gradle war
Deploy to JBoss EAP 6.4.0.GA
JBoss says deployment and activation of the app was successful. There are no errors of any sort in any JBoss log file. And dbCreate: update made the DDL changes to my Oracle database, so I know it got that far. But all URLs for the app return 404.
This is a known bug: Issue-9481
It has been added to grails 3.1.5 milestone.
How do we change the default port 8080 to something else in Grails 3.0.9?
Through command line
This answer has a way which works
grails run-app --port=8090
Also, while stopping
grails stop-app --port=8090
The following may or may not work depending on grails version
grails run-app -Dserver.port=8090
Through configuration
Say to change it to 8090, add the following snippet to grails-app/conf/application.yml
server:
port: 8090
under
environments:
development:
so that it looks like
environments:
development:
server:
port: 8090
In Grails3 grails -Dserver.port=9001 run-app doesn't appear to work:
I'm "getting address already bound 8080".
Any idea how to do this - ideally by passing a property to "gradle run"?
You can use
server:
port: 9001
in application.yml.
Or you can pass it via system environment. (e.g. SERVER_PORT=9001 grails run-app).
grails run-app --port=8081
Or in interactive mode:
run-app --port=8081
Don't forget to use the same port when you want to stop the server:
stop-app --port=8081
I believe this feature was broken in 3.0.3 and earlier versions but it definitely works in 3.0.4.
Accepted answer is correct. For some additional info, Grails 3 uses spring-boot and the server properties are configured by the
org.springframework.boot.autoconfigure.web.ServerProperties
class. "port" is just a property on this class which is filled from the application.yml with the prefix "server". So in addition to the port, you can set properties of this class including tomcat configuration properties and etc. To change the contextPath for instance you add
server:
contextPath: /myapp
to you application.yml.
server:
port: 9809
contextPath: '/admin/'
you can use this in your application.yml file
or change the port depends on the environment for example :
environments:
test:
grails:
serverURL: "http://localhost:9809"
I'm using grails 2.0.4. And I want to use port:8090 instead of 8080 for localhost. So need help to change the port to 8090 permanently.
This solution adds to the answers http://stackoverflow.com/a/10956283/122457. In Grails 2.x,
add the following to BuildConfig.groovy:
grails.server.port.http = 8090
See http://forum.springsource.org/archive/index.php/t-97024.html for further details.
There are two options:
Change grails.serverURL in Config.groovy from "http://localhost:8080/${appName}" to "http://localhost:8090/${appName}".
Launch grails with -Dgrails.server.port.http=8090 on the command line. Set the GRAILS_OPTS environment variable to -Dgrails.server.port.http=8090 to have it applied automatically.
If you are using Netbeans IDE then set the following -:
Config: -> BuildConfig.groovy: -> grails.server.port.http = 8090
and restart the server.
Without IDE, type in the command prompt -:
grails -Dserver.port 8090 run-app
or
grails -Dserver.port=8090 run-app
For grails 3 you can put this in your application.yml
server:
port: 9999
command line: grails run-app -port 8090
Run the command (Ctrl+Alt+g)
Up to grails version 2.x : run-app -Dserver.port=8090
For grails version 3.x : run-app --port=8090
If you are using IntelliJ IDE then
From the application menu click Run >> Edit Configurations... >> VM options: -Dgrails.server.port.http=8180
grails run-app -Dserver.port=8090
Or use another port number
In Intellij:
Ctrl+Alt+G (keyboard Generic);
Cmd+Alt+G (keyboard Mac)
and use only:
run-app -Dserver.port=8090
Add/Update the value of port from your application.yml (grails-app/conf/application.yml)
environments:
development:
server:
port: "8090"
Or
server:
port: "8090"
Type following in the command line:
grails -Dserver.port=8090 run-app
You didn't say what IDE you are using. If you are using Netbeans you just right-click on the project name and choose Properties. From the General Settings Category, you can easily change the server port to whatever you like.
You can run grails app using the following command on the terminal. default running port is 8080.
grails run-app -Dserver.port=9090
This will run the app on port 9090.
For Grails 4 required two settings
server:
port: "8085"
grails:
serverURL: http://localhost:8085
Second one will solve redirection issues
Or only for dev:
environments:
development:
server:
port: "8085"
grails:
serverURL: http://localhost:8085