【发布时间】:2018-01-30 20:36:48
【问题描述】:
我想在一个小项目中使用this 库。我知道如何将 jar 文件添加到我的项目中,但我不知道如何使用 maven。我在 cmd 中尝试了命令 mvn clean package 但在安装 maven 之后它只是错误:
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.070 s
[INFO] Finished at: 2017-08-22T18:23:04+04:30
[INFO] Final Memory: 5M/123M
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (C:\Users\aran). Please verify you invoked Maven from the correct directory. -> [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/MissingProjectException
我试图在项目目录中打开 cmd 但没有帮助。 谁能帮我找到那个库的jar文件?或者给我一些关于如何使用 maven 的说明?
【问题讨论】:
-
您需要在项目的根目录中创建一个文件 pom.xml 并在其中添加您需要的 Jar 作为依赖项
-
查看报错信息最后一行的链接...
-
你的问题有点笼统。通常,如果您想使用 Maven 构建项目,则项目需要在其根目录中有一个文件
pom.xml。你得到的错误似乎是说没有找到这样的文件。您需要找出原因,并可能使用这些详细信息编辑您的问题(是的,当您调用此函数时,您确实需要位于项目自己的文件夹中)
标签: java git maven jar package