Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Java Spring Basics Spring Components and Configuring Our App Configuring Gradle for Spring Development

Derek Derek
Derek Derek
8,744 Points

maven2 error

While creating new Gradle project in Intellij Idea 15.0.2,

I get the following error :

"unidexed remote maven repositories found. The following repositories used in your gradle projects were not indexed yet: http://repo1.maven.org/maven2."

When I searched for this problem, I came across some posts stating that it was a known issues which was to be fixed in the previous versions (14. something) but apparently it isn't fixed, or it is not a bug. Some also advised to uncheck "use maven3 to import project" in File -> Settings -> maven -> importing, but can't find that option either.

I tried to ignore this, but I cannot progress further since gradle does not recognize spring application.

How can I fix this error? Thank you.

Chris Ramacciotti
seal-mask
.a{fill-rule:evenodd;}techdegree
Chris Ramacciotti
Treehouse Guest Teacher

Hi Derek! When you say that you're unable to progress, what roadblocks are you encountering? Have you added Spring dependencies to build.gradle and clicked the refresh icon in the Gradle tool window in IntelliJ? It might be the case that dependencies will still download and be added to the classpath, but that you just won't get autocompletion on dependency names in IntelliJ. If this is the case, you should be able to progress. But, this may not be the case.

Derek Derek
Derek Derek
8,744 Points

Chris Ramacciotti , I have refreshed gradle just like you did in the video. However, there are red squiggly underlines on AppConfig.java and on dependencies under giflib in Gradle projects tab on the right side.

Also, in my AppConfig.java file, my import statement for SpringApplication does not seem to work. The word SpringApplicaiton appears in red every time I write the word. I do have "import org.springframework.boot.SpringApplication;" on top of the file.

Moreover, when I do run 'giflib [bootRun]', I get the error below:


FAILURE: Build failed with an exception.

BUILD FAILED

Total time: 1.79 secs Could not find org.springframework.boot:spring-book-starter-web:1.2.6.RELEASE. Searched in the following locations: https://repo1.maven.org/maven2/org/springframework/boot/spring-book-starter-web/1.2.6.RELEASE/spring-book-starter-web-1.2.6.RELEASE.pom https://repo1.maven.org/maven2/org/springframework/boot/spring-book-starter-web/1.2.6.RELEASE/spring-book-starter-web-1.2.6.RELEASE.jar Required by: com.hyunjaecho:giflib:1.0-SNAPSHOT 1:54:02 PM: External task execution finished 'bootRun'.


I hope you can understand the error I am encountering. I hope to learn spring ASAP but this is hindering my experience.. Please help me!

I just figured this out after researching on the web. You need to either:

  1. Click on the repositories link in the error OR
  2. Click on Intellij -> Preferences -> Build,Execution.. -> Build Tools -> Maven -> Repositories

Select the maven repository URL (repo1...) and click on Update on the upper right corner

This worked for me