kamal
kamal

Reputation: 9785

How should I install missing artifacts in a maven project

I am getting the following error, upon running mvn clean install

Missing:
----------
1) org.apache.maven.shared:maven-invoker:jar:2.0.6

  Try downloading the file manually from the project website.

  Then, install it using the command: 
      mvn install:install-file -DgroupId=org.apache.maven.shared -DartifactId=maven-invoker -Dversion=2.0.6 -Dpackaging=jar -Dfile=/path/to/file

  Alternatively, if you host your own repository you can deploy the file there: 
      mvn deploy:deploy-file -DgroupId=org.apache.maven.shared -DartifactId=maven-invoker -Dversion=2.0.6 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

  Path to dependency: 
    1) org.apache.maven.plugins:maven-archetype-plugin:maven-plugin:2.0-alpha-4
    2) org.apache.maven.shared:maven-invoker:jar:2.0.6

2) org.apache.maven.archetype:archetype-common:jar:2.0-alpha-4

  Try downloading the file manually from the project website.

  Then, install it using the command: 
      mvn install:install-file -DgroupId=org.apache.maven.archetype -DartifactId=archetype-common -Dversion=2.0-alpha-4 -Dpackaging=jar -Dfile=/path/to/file

  Alternatively, if you host your own repository you can deploy the file there: 
      mvn deploy:deploy-file -DgroupId=org.apache.maven.archetype -DartifactId=archetype-common -Dversion=2.0-alpha-4 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

  Path to dependency: 
    1) org.apache.maven.plugins:maven-archetype-plugin:maven-plugin:2.0-alpha-4
    2) org.apache.maven.archetype:archetype-common:jar:2.0-alpha-4

----------
2 required artifacts are missing.

for artifact: 
  org.apache.maven.plugins:maven-archetype-plugin:maven-plugin:2.0-alpha-4

from the specified remote repositories:
  nexus (http://nexus.browsermob.com/content/groups/public/)



[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2 seconds
[INFO] Finished at: Wed Mar 23 14:16:32 EDT 2011
[INFO] Final Memory: 11M/81M
[INFO] ------------------------------------------------------------------------

Upvotes: 0

Views: 9989

Answers (3)

Burhan ARAS
Burhan ARAS

Reputation: 2517

Just paste "http://nexus.browsermob.com/content/groups/public/" to your web browser and see the list of libraries there. You will see that the libraries are absent from there or they are with different version numbers.(this is highly possible.)

Soultion is:

Have fun.

Upvotes: 0

joelittlejohn
joelittlejohn

Reputation: 11822

It looks like the repository you're using (http://nexus.browsermob.com/content/groups/public/) doesn't include some of the common maven plugins.

You have a couple of options:

  1. Configure the nexus.browsermob.com repo so that it proxies artifacts from maven central
  2. Add the maven central repository into your local settings file

If you want to go for option 2, add this into the <repositories> section of you settings file (which is typically found in your home folder in .m2/settings.xml):

<repository>
    <releases>
        <enabled>true</enabled>
    </releases>
    <snapshots>
        <enabled>true</enabled>
    </snapshots>
    <id>central</id>
    <url>http://repo1.maven.org/maven2</url>
</repository>

and this into the <pluginRepositories> section:

<pluginRepository>
    <releases>
        <enabled>true</enabled>
    </releases>
    <snapshots>
        <enabled>true</enabled>
    </snapshots>
    <id>central</id>
    <url>http://repo1.maven.org/maven2</url>
</pluginRepository>

Upvotes: 1

Tomasz Nurkiewicz
Tomasz Nurkiewicz

Reputation: 340693

These artifacts are available in main maven repository: maven-invoker:2.0.6 and archetype-common:2.0-alpha-4 and they should be resolved automatically.

Your problem is this Nexus repository: http://nexus.browsermob.com. I don't have access to it, but it must be configured to proxy maven central repository. If you are an employee of BrowserMob, ask person responsible for Nexus server. If not - just remove this repository from pom.xml or settings.xml globally. Chances are you will be able to build the project successfully.

Upvotes: 1

Related Questions