如果您不想在本地存储库中使用打包的工件并且想要使用备用 url,您可以使用:
<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 只能在线获得。如果您愿意,可以使用这些在线 Javadocs。只需将以下内容添加到您的插件配置中:
<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>
要从 IntelliJ IDEA 的库列表中排除依赖项,您可以执行以下操作:
<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>