Customize Your Libraries

Classes and sources

If you do not want to use the packaged artifacts in your local repository and would want to use an alternate url, you can use:

<project>
  [...]
  <build>
    [...]
    <plugins>
      [...]
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-idea-plugin</artifactId>
        <version>2.2.1</version>
        <configuration>
          <libraries>
            <library>
              <name>junit</name>
              <sources>file://C:/junit/src/main/java</sources>
              <classes>file://C:/junit/target/classes</classes>
            </library>
          </libraries>
        </configuration>
      </plugin>
      [...]
    </plugins>
    [...]
  </build>
  [...]
</project>

Javadocs

Sometimes the Javadocs for an artifact are only available online. You can use these online Javadocs if you like. Just add the following to your plugin configuration:

<project>
  [...]
  <build>
    [...]
    <plugins>
      [...]
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-idea-plugin</artifactId>
        <version>2.2.1</version>
        <configuration>
          <libraries>
            <library>
              <name>servlet-api</name>
              <javadocs>http://java.sun.com/javaee/5/docs/api/</javadocs>
            </library>
          </libraries>
        </configuration>
      </plugin>
      [...]
    </plugins>
    [...]
  </build>
  [...]
</project>

Exclude

To exclude a dependency from appearing in IntelliJ IDEA's list of libraries, you can do:

<project>
  [...]
  <build>
    [...]
    <plugins>
      [...]
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-idea-plugin</artifactId>
        <version>2.2.1</version>
        <configuration>
          <libraries>
            <library>
              <name>junit</name>
              <exclude>true</exclude>
            </library>
          </libraries>
        </configuration>
      </plugin>
      [...]
    </plugins>
    [...]
  </build>
  [...]
</project>