Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialSeamus Sionóid
27,798 PointsRevisiting Giflib - Incorrect/Outdated build.gradle file
There seems to be a problem with the build.gradle file that is provided. I get the following error in my terminal:
Build file 'C:\Users\Windows 8\IdeaProjects\giflib-hibernate\build.gradle' line: 15
A problem occurred evaluating root project 'giflib-hibernate'.
Failed to apply plugin [class 'io.spring.gradle.dependencymanagement.DependencyManagementPlugin'] Could not create task of type 'DependencyManagementReportTask'.
Here's the build.gradle file provided:
group 'com.teamtreehouse' version '1.0-SNAPSHOT'
buildscript { repositories{ mavenCentral() } dependencies { classpath 'org.springframework.boot:spring-boot-gradle-plugin:1.3.3.RELEASE' } }
apply plugin: 'spring-boot'
apply plugin: 'java'
repositories { mavenCentral() }
dependencies { compile 'org.springframework.boot:spring-boot-starter-thymeleaf' compile 'org.hashids:hashids:1.0.1' compile 'org.springframework:spring-orm:4.2.5.RELEASE' compile 'org.hibernate:hibernate-core:5.2.1.Final' compile 'org.apache.tomcat:tomcat-dbcp:8.0.32' compile 'com.h2database:h2:1.4.191' }
2 Answers
Seamus Sionóid
27,798 PointsAfter a bit of fiddling around I got it working myself. Here's the build.gradle file I used:
plugins {
id 'java'
id 'idea'
id 'eclipse'
id 'org.springframework.boot' version '2.0.6.RELEASE'
id "io.spring.dependency-management" version "1.0.6.RELEASE"
}
group 'com.teamtreehouse'
version '1.0-SNAPSHOT'
sourceCompatibility = 1.8
// Specify the location where our dependencies will be found
repositories {
mavenCentral()
}
dependencies {
compile group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: '2.0.6.RELEASE'
compile group: 'org.springframework.boot', name: 'spring-boot-starter-thymeleaf', version: '2.0.6.RELEASE'
compile group: 'org.hashids', name: 'hashids', version: '1.0.1'
compile group: 'org.springframework', name: 'spring-orm', version: '4.2.5.RELEASE'
compile group: 'org.hibernate', name: 'hibernate-core', version: '5.2.1.Final'
compile group: 'org.apache.tomcat', name: 'tomcat-dbcp', version: '8.0.32'
compile group: 'com.h2database', name: 'h2', version: '1.4.191'
}
Michel Stroobants
5,014 PointsAfter pulling from the github repo, just editing the gradle.build file did not work for me. After fooling around I got it to work though! All I did was delete the gradle-directory in the giflib-hibernate-directory and reloaded gradle! Gradle did download again, but it works! I had to do some minor adjustment though in the import statements.
Rhett Herring
Courses Plus Student 11,023 PointsRhett Herring
Courses Plus Student 11,023 PointsThanks!
Michael Newman
39,508 PointsMichael Newman
39,508 PointsThank you so much!