我是这个 maven 的新手,我在本地存储库中遇到了很大的问题。
我想添加一个第三方 jar,处理这个问题是我有类似的东西:
<dependency>
<groupId>com.thirdParty</groupId>
<artifactId>thirdParty</artifactId>
<version>4.0.2</version>
<scope>system</scope>
<systemPath>${basedir}/lib/thirdParty_4_0_2/thirdParty.jar</systemPath>
</dependency>
它的工作很棒,但我收到了一些警告,我想删除这些警告。
[WARNING] Some problems were encountered while building the effective model for com.thirdParty.connector:thirdParty:mule-module:1.0
[WARNING] 'dependencies.dependency.systemPath' for com.thirdParty:thirdParty:jar should not point at files within the project directory, ${basedir}/lib/thirdParty_java_client_4_0_2/thirdParty.jar will be unresolvable by dependent projects @ line 239, column 20
因此,我听说我可以拥有一个 Maven 本地存储库并在那里添加我所有的第三方 jar,然后在我的 XML 中添加一个存储库,然后调用它们,而不是这样做。
所以我有类似的东西:
<repository>
<id>local-maven-repository</id>
<name>local-maven-repository</name>
<releases>
<enabled>true</enabled>
<checksumPolicy>ignore</checksumPolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<url>file://${project.basedir}/../../local-maven-repository</url>
</repository>
在 local-maven-repository 里面我有类似的东西:
local-maven-repository
|-- com
| |-- thirdparty
| |-- sdk
| | -- 4.0.0
| | thirdParty-4.0.0.jar
| | thirdParty-4.0.0.pom
我收到了这个错误。
[ERROR] Failed to execute goal on project thirdParty: Could not resolve dependencies for project com.thirdParty.connector:thirdParty:mule-module:1.0: Failure to find com.thirdParty:thirdParty:jar:4.0.2 in file:///Users/moises.vega/Developer/Telstra/telstra-thunder/connectors/thirdParty/../../local-maven-repository was cached in the local repository, resolution will not be reattempted until the update interval of local-maven-repository has elapsed or updates are forced -> [Help 1]
有人能指出我解决这个问题的正确方向吗?
谢谢。