This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: 'java' | |
apply plugin: 'spring-boot' | |
apply plugin: 'idea' | |
buildscript { | |
repositories { | |
mavenCentral() | |
} | |
dependencies { | |
classpath('org.springframework.boot:spring-boot-gradle-plugin:1+') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Grab("org.grails:gorm-hibernate4-spring-boot:1.1.0.RELEASE") | |
@Grab("com.h2database:h2:1.3.173") | |
import grails.persistence.* | |
import org.springframework.http.* | |
import static org.springframework.web.bind.annotation.RequestMethod.* | |
// curl -XPOST http://localhost:8080/person/add -F 'firstName=Tony' | |
// curl -XGET 'http://localhost:8080/person/greet?firstName=Tony' | |
@RestController | |
class GreetingController { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Grab("org.grails:grails-datastore-gorm-hibernate4:3.1.4.RELEASE") | |
@Grab("com.h2database:h2:1.3.173") | |
@Grab("org.grails:grails-spring:2.5.0") | |
@Grab('org.slf4j:slf4j-simple:1.7.12') | |
import grails.orm.bootstrap.* | |
import grails.persistence.* | |
import org.springframework.jdbc.datasource.DriverManagerDataSource | |
import org.h2.Driver | |
def init = new HibernateDatastoreSpringInitializer(Person) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package app; | |
import org.springframework.beans.MutablePropertyValues; | |
import org.springframework.beans.factory.support.BeanDefinitionRegistry; | |
import org.springframework.beans.factory.support.GenericBeanDefinition; | |
import org.springframework.boot.SpringApplication; | |
import org.springframework.http.MediaType; | |
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; | |
import org.springframework.http.server.ServletServerHttpResponse; | |
import org.springframework.web.servlet.ModelAndView; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//add this to your spring security config. | |
grails.plugin.springsecurity.rejectIfNoRule = false | |
grails.plugin.springsecurity.fii.rejectPublicInvocations = false | |
grails.plugin.springsecurity.ipRestrictions = [ | |
'/shutdown':['127.0.0.1'] | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
buildscript { | |
repositories { | |
mavenLocal() | |
maven { url "https://repo.grails.org/grails/core" } | |
} | |
dependencies { | |
classpath "org.grails:grails-gradle-plugin:$grailsVersion" | |
//classpath "org.grails.plugins:hibernate5:${gormVersion-".RELEASE"}" | |
//classpath "com.bertramlabs.plugins:asset-pipeline-gradle:2.14.2" | |
} |
OlderNewer