如何获取 maven 库的 jar 文件?



我想在一个小项目中使用这个库。我知道如何将jar文件添加到我的项目中,但我不知道如何使用maven。我在cmd中尝试了命令mvn清洁包,但是在安装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:Usersaran). 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 的说明?

您可以从此处下载 jar 文件并将其添加到类路径中。

downlod 链接就在文件旁边。

我尝试了命令 mvn 干净包

尝试从项目目录中执行相同的命令(例如cd/User/you/yourFolder/mp3agic/(:

mvn clean package

同样在项目的 pom.xml 文件中,您需要为链接的项目包含以下依赖项:

<dependency>
<groupId>com.mpatric</groupId>
    <artifactId>mp3agic</artifactId>
    <version>0.9.0</version>
</dependency>

编辑:如果您的项目不是基于maven(如下面的评论中所述(,则应首先将项目转换为maven项目,这将创建所需的pom.xml,然后在项目上使用上述命令。这将有助于 -IntelliJ - 将 Java 项目/模块转换为 Maven 项目/模块。

最新更新