2

I try to add the following dependency in my pom.xml file:

<dependency> <groupId>org.json</groupId> <artifactId>json</artifactId> <version>20180813</version> </dependency> 

However, the <version> tag's content gets highlighted in red and the Dependency org.json:json:20180813 not found error pops up:

enter image description here

enter image description here

Why does this happen and how to fix it?

3
  • The repo server, or your connection to it, could have been down. Try again. --- You are connecting directly, right? Not using some other repo? --- FYI: I copy/pasted your <dependency> block, and it worked fine. Commented Sep 24, 2018 at 19:27
  • @Andreas No other dependency in my pom file has any issues, so I doubt it's the connection problem. "You are connecting directly, right? Not using some other repo" what do you mean? Commented Sep 24, 2018 at 19:33
  • It's your network, the dependency is there in maven central. Many companies of course have private repos as proxies to maven central and won't allow access to maven central directly. Most likely it's no in your proxy repo. Commented Sep 25, 2018 at 11:38

2 Answers 2

4

cloud1's answer helped me out:

Try pressing 'Reimport All Maven Projects' button. It's the first button at Maven Projects tab (blue circle). Looks like this dependency wasn't downloaded from Internet yet.

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

Comments

3

I have made some test, and on my computer with fresh repositorys it is working, on the old one not.

In intellij go to settings (ctrl alt s) -> Build,execution,deployment -> Build Tools -> Maven -> Repositorys

Click on maven -> and update on the right corner.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.