2
votes

I want to reference a jar (ie vim25.jar, VMWare VSphere server management) in the POM of my project. As this file is not referenced in MavenRepository I do the following steps:

  • Download the file from VMWare site
  • Install the file using:

mvn install:install-file -Dfile=./vim25.jar -DgroupId=manuallyInstalledJars -DartifactId=vim25 -Dversion=2.5 -Dpackaging=jar

Everyting works well and I can find the jar in myLocalRepo/manuallyInstalledJars/vim25/2.5/vim25-2.5.jar

  • Beside the jar there is the POM, I open it and extract the dependency references:

[groupId]manuallyInstalledJars[/groupId]

[artifactId]vim25[/artifactId]

[version]2.5[/version]

("<" replaced by "[" because of the editor)

I enclose this with the [dependency] tag and put everything in the POM that uses the jar

  • In Eclipse I get an error (red mark in the text editor) with this comment: "Missing artifact manuallyInstalledJars:vim25:jar:2.5"

Any idea ?

1
Try mvn -X install:install-file ... to get debug output. - Grzegorz Żur

1 Answers

0
votes

Perhaps just post the dependency xml so we can rule that out.

In any case try this in Eclipse (assuming you have m2eclipse plugin installed)

Window-> Show View -> Maven Repositories

Expand Local Repositories

Right click Local Repository -> Rebuild Index.

This sometimes help refresh the maven repo in Eclipse when youve made external changes

After the rebuild, check you can see the JAR in that local repository tree in the maven repositories view. You can also confirm that Eclipse is looking at the same local repository as your external maven installation.

If it's not, check the user settings in the eclipse preferences.

Window -> Preferences -> Maven -> User Settings

You can check it is referencing the correct maven settings xml file