0

I want to use this library in a small project. I know how to add a jar file to my project but I don't know how to work with maven. I tried the command mvn clean package in cmd but after installing maven but it just errors:

[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

I tried to open cmd in the directory of the project but didn't help. Can anyone help me find the jar file of that library? or give me some instructions on how to work with maven?

yukashima huksay
  • 5,834
  • 7
  • 45
  • 78
  • You need to create a file pom.xml in the root of your project and add the Jar you need as a dependency there – Patrick Hund Aug 22 '17 at 13:57
  • 1
    See the link at the last line of the error message... – Usagi Miyamoto Aug 22 '17 at 13:59
  • Your question is a bit broad. Typically, the project needs to have a file `pom.xml` in its root if you want to build it with Maven. The error you're getting seems to say that no such file has been found. You need to find out why, and maybe edit your question with these details (and yes, you do need to be in the project's own folder when you call this function) – Andrei Aug 22 '17 at 14:03

2 Answers2

2

I tried the command mvn clean package

Try executing the same command from within the project directory(e.g cd /User/you/yourFolder/mp3agic/) :

mvn clean package

Also in your project's pom.xml file, you need to include this dependency for the linked project:

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

Edit: If your project is not based on maven(as mentioned in the comments below), you shall first convert the project into maven project which would create the pom.xml required and then use the above commands on the project. This would be helpful for that -IntelliJ - Convert a Java project/module into a Maven project/module.

Naman
  • 27,789
  • 26
  • 218
  • 353
  • I don't have any "pom.xml". my project directory is: "Z:\my files\projects\programing\java\captionBot" and I'm using intellij if it helps. – yukashima huksay Aug 22 '17 at 14:13
  • 1
    @aran you shall [first convert the project into maven](https://stackoverflow.com/questions/7642456/intellij-convert-a-java-project-module-into-a-maven-project-module) which would create the pom.xml required and then use the above commands on the project. – Naman Aug 22 '17 at 14:53
2

You can download the jar file from here and add it to your classpath.

downlod link is right beside Files.

Eritrean
  • 15,851
  • 3
  • 22
  • 28