|
先看错误提示:
[ERROR] Failed to execute goal on project mlcp: Could not resolve dependencies for project com.mlcp:mlcp:jar:0.0.1-SNAPSHOT: Could not find artifact Mxgraph:mlcp:jar:1.0 in ukmaven (http://uk.maven.org/maven2/) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
或者:
[ERROR] Failed to execute goal on project mlcp: Could not resolve dependencies for project com.mlcp:mlcp:jar:0.0.1-SNAPSHOT: Failure to find Mxgraph:mlcp:jar:1.0 in http://uk.maven.org/maven2/ was cached in the local repository,
resolution will not be reattempted until the update interval of ukmaven has elapsed or updates are forced -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
这个原因是这个库在镜像里没有。当然没有啊,这是我本地别的项目的jar包
接着看我maven的配置,就是这个包找不到。
<dependency>
<groupId>Mxgraph</groupId>
<artifactId>mlcp</artifactId>
<version>1.0</version>
</dependency>
最后看代码:
mvn install:install-file -Dfile=C:\Users\Administrator\Desktop\mlcp-1.0.jar -DgroupId=Mxgraph -DartifactId=mlcp -Dversion=1.0 -Dpackaging=jar
解释一下:
-Dfile:你要添加的jar包
-DgroupId -DartifactId -Dversion:和你的maven对应起来
-Dpackaging:你添加的包的类型 |