Search code examples
javaeclipsemavenm2e

Can NOT use dependency after installing .jar into local Repositories with Maven3.0.3 in STS


I have a JAR which can't be found in the Maven Repositories.

So that I use the following command to install into my local repositories

install:install-file -Dfile=C:/FIXApplication/lib/quickfixj-all-1.5.2 -DgroupId=org.quickfixj -DartifactId=quickfixj -Dversion=1.5.2 -Dpackaging=jar -DgeneratePom=true

And the result is successful and I can find the folder under the .m2\repository\org\quickfixj\quickfixj

But when I modify the pom.xml to add the dependency. It said: Missing artifact org.quickfixj:quickfixj:jar:1.5.2

Why this happen? Why can't read the local repositories?


Solution

  • Though the command did not error, it is quite likely that the local repository does not have the artifact.

    Your command has this part

    -Dfile=C:/FIXApplication/lib/quickfixj-all-1.5.2
    

    It should have been

    -Dfile=C:/FIXApplication/lib/quickfixj-all-1.5.2.jar
    

    Perhaps you can make this change, try again and see if it works.