application.yml 配置
--- grails: profile: web codegen: defaultPackage: aderttj spring: transactionManagement: proxies: false info: app: name: '@info.app.name@' version: '@info.app.version@' grailsVersion: '@info.app.grailsVersion@' spring: groovy: template: check-template-location: false # Spring Actuator Endpoints are Disabled by Default endpoints: enabled: false jmx: enabled: true --- grails: mime: disable: accept: header: userAgents: - Gecko - WebKit - Presto - Trident types: all: '*/*' atom: application/atom+xml css: text/css csv: text/csv form: application/x-www-form-urlencoded html: - text/html - application/xhtml+xml js: text/javascript json: - application/json - text/json multipartForm: multipart/form-data pdf: application/pdf rss: application/rss+xml text: text/plain hal: - application/hal+json - application/hal+xml xml: - text/xml - application/xml urlmapping: cache: maxsize: 1000 controllers: defaultScope: singleton converters: encoding: UTF-8 views: default: codec: html gsp: encoding: UTF-8 htmlcodec: xml codecs: expression: html scriptlets: html taglib: none staticparts: none endpoints: jmx: unique-names: true --- hibernate: cache: queries: false use_second_level_cache: true use_query_cache: true region.factory_class: org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory jdbc: use_get_generated_keys: true dataSource: pooled: true jmxExport: true driverClassName: oracle.jdbc.driver.OracleDriver dialect: org.hibernate.dialect.Oracle10gDialect username: c##orcl password: orcl environments: development: imagePath: D:/upload/Images/ dataSource: dbCreate: update url: jdbc:oracle:thin:@localhost:1521:orcl test: dataSource: dbCreate: update url: jdbc:h2:mem:testDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE production: dataSource: dbCreate: none url: jdbc:h2:./prodDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE properties: jmxEnabled: true initialSize: 5 maxActive: 50 minIdle: 5 maxIdle: 25 maxWait: 10000 maxAge: 600000 timeBetweenEvictionRunsMillis: 5000 minEvictableIdleTimeMillis: 60000 validationQuery: SELECT 1 validationQueryTimeout: 3 validationInterval: 15000 testOnBorrow: true testWhileIdle: true testOnReturn: false jdbcInterceptors: ConnectionState defaultTransactionIsolation: 2 #server: # port: 8080
server:
port:8090
可以改变端口号
build.gradle 配置
dependencies { compile "org.springframework.boot:spring-boot-starter-logging" compile "org.springframework.boot:spring-boot-autoconfigure" compile "org.grails:grails-core" compile "org.springframework.boot:spring-boot-starter-actuator" compile "org.springframework.boot:spring-boot-starter-tomcat" compile "org.grails:grails-dependencies" compile "org.grails:grails-web-boot" compile "org.grails.plugins:cache" compile "org.grails.plugins:scaffolding" compile "org.grails.plugins:hibernate5" compile "org.hibernate:hibernate-core:5.1.1.Final" compile "org.hibernate:hibernate-ehcache:5.1.1.Final" console "org.grails:grails-console" profile "org.grails.profiles:web" provided "org.codehaus.groovy:groovy-ant" runtime "com.bertramlabs.plugins:asset-pipeline-grails:2.11.1" runtime "com.h2database:h2" testCompile "org.grails:grails-plugin-testing" testCompile "org.grails.plugins:geb" testRuntime "org.seleniumhq.selenium:selenium-htmlunit-driver:2.47.1" testRuntime "net.sourceforge.htmlunit:htmlunit:2.18" compile 'org.grails.plugins:spring-security-core:3.1.1' compile 'org.grails.plugins:spring-security-rest:2.0.0.M2' compile fileTree(dir:'libs',include:'*.jar') runtime 'com.oracle:ojdbc6:11.2.0.3' }