2

I am trying to open this module in Intellij: https://github.com/eugenp/tutorials/tree/master/javaxval

The steps followed by me:

  1. Go to required directory javaxval/ in my local and

mvn clean install.

  1. Open the pom.xml inside javaxval/ and open it as a project.

But Intellij is not syncing with the libraries mentioned in pom.xml as I can see in libraries section in Project Structure settings. Also, because of that, I can see lot of compilation errors.

Any idea what is the issue I am facing and how can I fix it?

5
  • Try to reimport modules in intellij. Commented Sep 21, 2019 at 18:51
  • I tried to build the project again from Build->Build Project but then it fails with "Error:(10, 18) java: type annotations are not supported in -source 1.5 (use -source 8 or higher to enable type annotations)" Commented Sep 21, 2019 at 18:53
  • Reimport I have tried multiple times but no success. Commented Sep 21, 2019 at 18:54
  • Change compiler setting to 1.8 and try building your app. Commented Sep 21, 2019 at 18:59
  • I did all these steps but still not working. Commented Sep 21, 2019 at 19:16

1 Answer 1

1

This project imports and builds fine in IntelliJ IDEA 2019.2.2 version using the bundled Maven 3.6.1 for importing and JDK 1.8.

If it doesn't import/build for you, perform the diagnostics and check the logs as described in this answer. Make sure the parent pom file is present in the directory tree on your disk.

Sign up to request clarification or add additional context in comments.

8 Comments

I can see the dependencies in external Libraries section on left side but still my code is showing errors: imgur.com/a/7Nlzkj9
Your screenshot shows JDK dependency, not the other dependencies. There should be a lot more.
Yeah. They are not coming. I check the logs u suggested above: pastebin.com/VYK5JSi9. But not sure if its a regular error or something I am missing.
What JDK and Maven versions are used for importing? Does it help if you reset ~/.m2/settings.xml to the defaults or delete it? What IntelliJ IDEA version do you use?
The error in the log: Caused by: com.google.inject.OutOfScopeException: Cannot access Key[type=org.apache.maven.execution.MavenSession, annotation=[none]] outside of a scoping block. Related bug. Solution: update to the latest IntelliJ IDEA version: jetbrains.com/idea/download/index.html.
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.