【发布时间】:2018-08-02 08:35:01
【问题描述】:
在我的 maven 项目中,我需要使用一些本地 jar 库作为依赖项。
我正在尝试使用这种方法在pom.xml中配置它们:
<repositories>
<repository>
<id>projectName.local</id>
<url>file://${project.basedir}/libs</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.myproject</groupId>
<artifactId>ProjectName</artifactId>
<version>1.0</version>
</dependency>
<!-- other dependencies... -->
</dependencies>
我在项目根目录中定义了一个指向libs 文件夹的本地存储库。然后我把jars 放到了这个文件夹里:
/libs/org/myproject/ProjectName/1.0/ProjectName-1.0.jar
但是,在构建项目时我收到了这个警告:
The POM for org.myproject:ProjectName:jar:1.0 is missing, no dependency information available
这个构建失败的结果:
Failed to execute goal on project my_project: Could not resolve dependencies for project *** : The following artifacts could not be resolved: org.myproject:ProjectName:jar:1.0: Failure to find org.myproject:ProjectName:jar:1.0 in file://C:\Users\David\Documents\NetBeansProjects\my_project/libs was cached in the local repository, resolution will not be reattempted until the update interval of projectName.local has elapsed or updates are forced -> [Help 1]
我错过了什么?
【问题讨论】:
-
开始使用仓库管理器上传jar包就搞定了...