3

How to add repository/repositories to "Indexed Maven Repositories" in IntelliJ IDEA 13? enter image description here

Vy Do
  • 46,709
  • 59
  • 215
  • 313

2 Answers2

2

Create a simple Maven project by IntelliJ IDEA:

enter image description here

enter image description here

enter image description here

Choose "Enable Auto-Import"

enter image description here

Then, add these to pom.xml:

<repositories>
    <repository>
        <id>codehausSnapshots</id>
        <name>Codehaus Snapshots</name>
        <releases>
            <enabled>false</enabled>
            <updatePolicy>always</updatePolicy>
            <checksumPolicy>warn</checksumPolicy>
        </releases>
        <snapshots>
            <enabled>true</enabled>
            <updatePolicy>never</updatePolicy>
            <checksumPolicy>fail</checksumPolicy>
        </snapshots>
        <url>http://snapshots.maven.codehaus.org/maven2</url>
        <layout>default</layout>
    </repository>
</repositories>



Come back to Settings (Ctrl + Alt + S), "Indexed Maven Repositories" section updated:

enter image description here

Vy Do
  • 46,709
  • 59
  • 215
  • 313
-2

Add this repisitory to settings.xml in maven:

<project> 
  <repositories> 
        <repository>
            <id>my-internal-site</id> 
            <url>http://myserver/repo</url> 
         </repository> 
     </repositories> 
 </project>
walkeros
  • 4,736
  • 4
  • 35
  • 47
  • tag should not be used in settings.xml, use it in pom's project instead. In settings.xml to set a repo you should put it inside tag https://maven.apache.org/guides/mini/guide-multiple-repositories.html – demian Jun 27 '19 at 16:29