tags:

views:

186

answers:

2

I use nexus opensource version maven 2.2.1

When I type "mvn help:effective-settings", i got the error below

[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'help'.
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).

Project ID: org.apache.maven.plugins:maven-help-plugin

Reason: Error getting POM for 'org.apache.maven.plugins:maven-help-plugin' from the   repository: Failed to resolve artifact, possibly due to a repository list that is not appropriately equipped for this artifact's metadata.
 org.apache.maven.plugins:maven-help-plugin:pom:2.2-SNAPSHOT

from the specified remote repositories:
 Nexus (http://192.168.56.191:8081/nexus/content/groups/public)

for project org.apache.maven.plugins:maven-help-plugin

When I check the local repository under ~.m2\repository\org\apache\maven\plugins\maven-help-plugin

It has a file maven-metadata-central.xml

<?xml version="1.0" encoding="UTF-8"?>
<metadata>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-help-plugin</artifactId>
  <versioning>
    <latest>2.2-SNAPSHOT</latest>
    <release>2.1.1</release>
    <versions>
      <version>2.0</version>
      <version>2.0.1</version>
      <version>2.0.2</version>
      <version>2.1</version>
      <version>2.1.1</version>
      <version>2.2-SNAPSHOT</version>
    </versions>
   <lastUpdated>20100519065440</lastUpdated>
  </versioning>
</metadata>

And I can't find any jar files under directory, what's wrong with nexus server ? I can't easily find support information from nexus.

Any hints

+1  A: 

It looks like you might have your settings.xml misconfigured. Try setting like like this, and if you still have trouble, ask us on the nexus-user list and we'll go from there.

Brian Fox
Thank Brian, yes, this is the problem, I am new to mavenCombine with lisak's answer, I need add snapsnot in nexus and enable it in settings.xmlNow the problem is fixed
larrycai
+2  A: 

It's definitely as Brian said. You probably have only mirrored repositories without doing the hack with setting up the profile as nexus documentation says with those bogus central URLs. If you run maven in debug mode, you would see things like "Skipping disabled repository central". - disabled refers to the policy that applies for a specific artifact.


Because you want SNAPSHOT artifact which probably has the relevant policy <snapshots> <enabled>true</enabled> and maven central has <snapshots> <enabled>false</enabled> it doesn't work without the hack in the nexus documentation.


Mirror only replaces the URL, it doesn't change the policies of the original repositories, but for a repo manager to work, one usually wants to redirect both release and snapshot artifact requests

Hope it helps to clarify this issue, it's good to know about it

lisak
Thank lisak, yes, they are the problem, I am new to mavenI need add snapsnot in nexus and enable it in settings.xml
larrycai