Erikson Murrugarra
Erikson Murrugarra

Reputation: 1539

Spring Cloud Angel.SR4 And Grails 3.0.9 Don't Work

Maybe you could help me with this problem:

I am creating a Grails project version 3.0.10, and want this project to work as a Eureka Client. I am using Spring Boot 1.3.1.RELEASE and I am trying to use Spring Cloud Angel.SR4 Version.

I have a Java project that works fine but when trying to apply the dependencies and run my Grails app it is throwing some problems:

this is my gradle.build file that I am using for my project:

buildscript {
    ext {
        grailsVersion = project.grailsVersion
		// I have added this line
		springBootVersion = '1.3.1.RELEASE'
    }
    repositories {
        mavenLocal()
        maven { url "https://repo.grails.org/grails/core" }
    }
    dependencies {
        classpath "org.grails:grails-gradle-plugin:$grailsVersion"
        classpath "org.grails.plugins:hibernate:4.3.10.5"
		
    }
}

plugins {
    id "io.spring.dependency-management" version "0.4.2.RELEASE"
}

version "0.1"
group "demograilsclient"

apply plugin: "spring-boot"
apply plugin: "war"
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: "org.grails.grails-web"

ext {
    grailsVersion = project.grailsVersion
    gradleWrapperVersion = project.gradleWrapperVersion
}

repositories {
	// I have added those two lines
	mavenCentral()
	jcenter()
	
    mavenLocal()
    maven { url "https://repo.grails.org/grails/core" }
	
	// I have added those two lines
	maven { url "https://repo.spring.io/snapshot" }
	maven { url "https://repo.spring.io/milestone" }
}

dependencyManagement {
    imports {
        mavenBom "org.grails:grails-bom:$grailsVersion"
		// I have added this line
		mavenBom 'org.springframework.cloud:spring-cloud-starter-parent:Angel.SR4'
    }
    applyMavenExclusions false
}

dependencies {
	
	// Spring cloud dependencies
	compile("org.springframework.cloud:spring-cloud-starter-config")
	compile("org.springframework.cloud:spring-cloud-starter-eureka")
	
	// not modified
    compile "org.springframework.boot:spring-boot-starter-logging"
    compile "org.springframework.boot:spring-boot-starter-actuator"
    compile "org.springframework.boot:spring-boot-autoconfigure"
    compile "org.springframework.boot:spring-boot-starter-tomcat"
    compile "org.grails:grails-plugin-url-mappings"
    compile "org.grails:grails-plugin-rest"
    compile "org.grails:grails-plugin-interceptors"
    compile "org.grails:grails-plugin-services"
    compile "org.grails:grails-plugin-datasource"
    compile "org.grails:grails-plugin-databinding"
    compile "org.grails:grails-plugin-async"
    compile "org.grails:grails-web-boot"
    compile "org.grails:grails-logging"

    compile "org.grails.plugins:hibernate"
    compile "org.grails.plugins:cache"
    compile "org.hibernate:hibernate-ehcache"

    runtime "com.h2database:h2"

    testCompile "org.grails:grails-plugin-testing"
    testCompile "org.grails.plugins:geb"

    console "org.grails:grails-console"
}

task wrapper(type: Wrapper) {
    gradleVersion = gradleWrapperVersion
}

And my Application.yml is:

server:
  port: 0
  
info:
  component: Grails App
  
eureka:
  instance:
    lease-renewal-interval-in-seconds: 10
    metadata-map:
      instanceId: ${vcap.application.instance_id:${spring.application.name}:${spring.application.instance_id:${random.value}}}
  client:
    registry-fetch-interval-seconds: 5
    service-url:
      defaultZone: http://localhost:8761/eureka/

---



grails:
    profile: web-api
    codegen:
        defaultPackage: demograilsclient
info:
    app:
        name: '@info.app.name@'
        version: '@info.app.version@'
        grailsVersion: '@info.app.grailsVersion@'
spring:
    groovy:
        template:
            check-template-location: false
 

.....
... contine >>

And the main class used for the grails framework to Boot the app is like this:

package demograilsclient

import grails.boot.GrailsApp
import grails.boot.config.GrailsAutoConfiguration

import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.cloud.netflix.eureka.EnableEurekaClient


@SpringBootApplication
@EnableEurekaClient
class Application extends GrailsAutoConfiguration {
    static void main(String[] args) {
        GrailsApp.run(Application, args)
    }
}

and when I execute:

grails run-app

It throw the following error:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':bootRun'.
> A problem occurred starting process 'command 'C:\program files\Java\jdk1.8.0_6
0\bin\java.exe''

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output.

BUILD FAILED

Total time: 20.374 secs

Maybe you can help me,

Thank you !!

Upvotes: 0

Views: 366

Answers (1)

spencergibb
spencergibb

Reputation: 25177

Angel.* and Spring Boot 1.3.x are not compatible.

Upvotes: 1

Related Questions