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 trialanish bashtal
1,039 PointsI'm stocked please help
On adding dependencies it says Cannot resolve com.sparkjava:spark-core:2.5
1 Answer
Alexander Nikiforov
Java Web Development Techdegree Graduate 22,175 PointsThat is strange... that should work.
Could you at least post screenshot of intellijdea with error.
Much nicer would be to push project on GitHub, although for this case just posting build.gradle
and/or screenshot should be enough.
Did you by chance watched 'Introduction to Gradle' Workshop?
https://teamtreehouse.com/library/dependency-management-with-gradle
If you did, did dependencies worked for you in that workshop ?
Another good try to check whether things work, is to actually git clone
Craig's repository, because it works 100%
https://github.com/treehouse-projects/java-spark-course-ideas
And if after cloning and importing, intellijidea should work as well ...
Although that will require more work ...
One more question you should answer : Do other dependencies work for you ?
For example Craig also has this line
testCompile group: 'junit', name: 'junit', version: '4.11'
Does that work ?
Could you remove compile 'com.sparkjava:spark-core:2.3'
line and leave only testCompile
line above?
Here is the build.gradle
file from Craig's repo:
https://github.com/treehouse-projects/java-spark-course-ideas/blob/master/build.gradle
So could you tell me : Does Gradle gives error when you leave only test dependency like that :
group 'com.teamtreehouse.courses'
version '1.0-SNAPSHOT'
apply plugin: 'java'
repositories {
mavenCentral()
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.11'
}
Because if the gradle will give error for file above, then it could be the case that you checked offline work for Gradle...
One person in this link had same problem:
anish bashtal
1,039 Pointsanish bashtal
1,039 PointsYes, the problem was because it was checked offline work for Gradle in Gradle Settings
Thank you very much for your support