MWH
MWH

Reputation: 399

how to add an artifact to maven repository

I do not know anything about maven. Recently I downloaded a Android project code and it included pom.xml file. So after searching for hours I manages to properly import it as a maven project. Every thing seems pretty error free but for one item.

Missing artifact org.mapsforge:mapsforge-map:jar:0.3.0

So I looked at my

C:\Users\MWH.m2\repository\org\mapsforge\mapsforge-map\0.3.0

where all of my artifacts are stored. But there is no executable jar file for this mapsforge-map jar. How can I add this jar to this maven project if it is not available in my repository?

Thanks in advance.

Upvotes: 0

Views: 2697

Answers (2)

kryger
kryger

Reputation: 13181

Three special steps:

  1. Download the jar file (from https://code.google.com/p/mapsforge/downloads/list ?)

  2. Copy the jar file to your local Maven repository:

    mvn install:install-file -DgroupId=org.mapsforge -DartifactId=mapsforge-map -Dversion=0.3.0 -Dpackaging=jar -Dfile=mapsforge-map-0.3.0-jar-with-dependencies.jar
    (in the directory you stored the jar file)

  3. Do mvn compile in your project folder to verify the newly-installed dependency is available.

Upvotes: 3

pinaci
pinaci

Reputation: 353

If it is not available in your repository run the "mvn:clean package" command.Maven will automatically download the dependecy for you.

Upvotes: 0

Related Questions