将maven存储库中的jar文件包含到eclipse项目中?

时间:2012-03-08 18:56:13

标签: eclipse maven

如何将本地maven存储库中的jar包含到eclipse项目中?实际上,我需要将它们包含在eclipse Web服务项目的WebContent / WEB-INF / lib目录中,如果它有任何差异。

1 个答案:

答案 0 :(得分:1)

打开您的pom文件并添加这样的依赖项..假设您要从本地存储库添加的jar是myfaces-10.jar 如果它在路径.m2 \ repository \ org \ apache \ myfaces \ myfaces \ 10 \ myfaces-10.jar ..然后在你的pom.xml中添加一个依赖,就像这样..

<dependencies>
    .
    .
   <dependency>
        <groupId>org.apache.myfaces</groupId>
        <artifactId>myfaces</artifactId>
        <version>10</version>
</dependency>
    .
    .

现在jar将在类路径中可用,您可以在项目中使用它。

确保您的groupId与我的示例中的路径匹配...

希望它有所帮助..