Adding maven repo in IntelliJ

On windows, add repo as a mirror on this file C:\Users\{user}\.m2\settings.xml

<settings>
  ...
  <mirrors>
    <mirror>
      <id>other-mirror</id>
      <name>Other Mirror Repository</name>
      <url>https://repo1.maven.org/maven2</url>
      <mirrorOf>central</mirrorOf>
    </mirror>
  </mirrors>
  ...
</settings>

OR

Add the <repositories> tag in the <project>

  <repositories>
    <repository>
      <releases>
        <enabled>false</enabled>
        <updatePolicy>always</updatePolicy>
        <checksumPolicy>warn</checksumPolicy>
      </releases>
      <snapshots>
        <enabled>true</enabled>
        <updatePolicy>never</updatePolicy>
        <checksumPolicy>fail</checksumPolicy>
      </snapshots>
      <name>Nexus Snapshots</name>
      <id>snapshots-repo</id>
      <url>https://repo1.maven.org/maven2</url>
      <layout>default</layout>
    </repository>
  </repositories>

This repository is already used by default and is hardcoded, you don't need to add it manually. If you want to use any other repository, the easiest way would be to define it directly in the pom.xml file or in your settings.xml. In either way IDEA will load these settings automatically.