0 0

配置maven使用nexus报这个错误该怎么解决?10

       先说下开发环境:

       1.apache-maven-3.1.1

        2.nexus-2.6.4-02-bundle

        3.jdk1.7.0_45

 

        最近开始使用maven构建项目(因为它实在太好用了),不过maven每次构建项目都要依赖中央仓库,这很不合理,所以使用了Nexus搭建了本地仓库,不过本地仓库搭建完成以后运行第一个命令mvn help:system就报了错,利用mvn -e help:system查看报错信息看了半天也没有头绪,下面就是这个报错信息:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-help-plugin:2.2:system (default-cli) on project standalone-pom: Execution default-cli of goal org.apache.maven.plugins:maven-help-plugin:2.2:system failed: Plugin org.apache.maven.plugins:maven-help-plugin:2.2 or one of its dependencies could not be resolved: Failed to collect dependencies at org.apache.maven.plugins:maven-help-plugin:jar:2.2 -> org.apache.maven.plugin-tools:maven-plugin-tools-api:jar:2.4.3: Failed to read artifact descriptor for org.apache.maven.plugin-tools:maven-plugin-tools-api:jar:2.4.3: Failure to find org.apache.maven:maven-parent:pom:8 in http://127.0.0.1:8081/nexus/content/groups/public was cached in the local repository, resolution will not be reattempted until the update interval of roger-nexus has elapsed or updates are forced -> [Help 1]org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-help-plugin:2.2:system (default-cli) on project standalone-pom: Execution default-cli of goal org.apache.maven.plugins:maven-help-plugin:2.2:system failed: Plugin org.apache.maven.plugins:maven-help-plugin:2.2 or one of its dependencies could not be resolved: Failed to collect dependencies at org.apache.maven.plugins:maven-help-plugin:jar:2.2 -> org.apache.maven.plugin-tools:maven-plugin-tools-api:jar:2.4.3
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:224)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:152)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:555)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-cli of goal org.apache.maven.plugins:maven-help-plugin:2.2:system failed: Pluginorg.apache.maven.plugins:maven-help-plugin:2.2 or one of its dependencies couldnot be resolved: Failed to collect dependencies at org.apache.maven.plugins:maven-help-plugin:jar:2.2 -> org.apache.maven.plugin-tools:maven-plugin-tools-api:jar:2.4.3
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:87)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 more
Caused by: org.apache.maven.plugin.PluginResolutionException: Plugin org.apache.maven.plugins:maven-help-plugin:2.2 or one of its dependencies could not be resolved: Failed to collect dependencies at org.apache.maven.plugins:maven-help-plugin:jar:2.2 -> org.apache.maven.plugin-tools:maven-plugin-tools-api:jar:2.4.3
at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:204)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.createPluginRealm(DefaultMavenPluginManager.java:357)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.setupPluginRealm(DefaultMavenPluginManager.java:325)
at org.apache.maven.plugin.DefaultBuildPluginManager.getPluginRealm(DefaultBuildPluginManager.java:180)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:83)
... 20 more
Caused by: org.eclipse.aether.collection.DependencyCollectionException: Failed to collect dependencies at org.apache.maven.plugins:maven-help-plugin:jar:2.2 ->org.apache.maven.plugin-tools:maven-plugin-tools-api:jar:2.4.3
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:292)
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.collectDependencies(DefaultRepositorySystem.java:317)
at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:192)
... 24 more
Caused by: org.eclipse.aether.resolution.ArtifactDescriptorException: Failed toread artifact descriptor for org.apache.maven.plugin-tools:maven-plugin-tools-ap
i:jar:2.4.3
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:370)
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:217)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.process(DefaultDependencyCollector.java:461)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:261)
... 26 more
Caused by: org.apache.maven.model.resolution.UnresolvableModelException: Failure to find org.apache.maven:maven-parent:pom:8 in http://127.0.0.1:8081/nexus/content/groups/public was cached in the local repository, resolution will not be reattempted until the update interval of roger-nexus has elapsed or updates are for
ced
at org.apache.maven.repository.internal.DefaultModelResolver.resolveModel(DefaultModelResolver.java:126)
at org.apache.maven.model.building.DefaultModelBuilder.readParentExternally(DefaultModelBuilder.java:817)
at org.apache.maven.model.building.DefaultModelBuilder.readParent(DefaultModelBuilder.java:669)
at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:307)
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:361)
... 29 more
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Failure to find org.apache.maven:maven-parent:pom:8 in http://127.0.0.1:8081/nexus/content/groups/public was cached in the local repository, resolution will not be reattempted until the update interval of roger-nexus has elapsed or updates are forced
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:459)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:262)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:239)
at org.apache.maven.repository.internal.DefaultModelResolver.resolveModel(DefaultModelResolver.java:122)
... 33 more
Caused by: org.eclipse.aether.transfer.ArtifactNotFoundException: Failure to find org.apache.maven:maven-parent:pom:8 in http://127.0.0.1:8081/nexus/content/groups/public was cached in the local repository, resolution will not be reattempted until the update interval of roger-nexus has elapsed or updates are forced
at org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.newException(DefaultUpdateCheckManager.java:232)
at org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.checkArtifact(DefaultUpdateCheckManager.java:206)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.gatherDownloads(DefaultArtifactResolver.java:599)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:518)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:436)
... 36 more
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException

        我搜索了一部分报错信息,参考了Stack Overflow上的一些问题,猜测有可能是有些网站被墙所以无法下载一些.pom文件,不过当我将我的setting.xml中关于nexus的配置注释掉以后mvn help:system完全可以正常运行,所以应该是setting.xml的设置有问题:

<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" 
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
  <localRepository>D:/DeveloperKit/maven_repos</localRepository>
  <pluginGroups>
  </pluginGroups>

  <proxies>
  </proxies>

  <servers>
    <server>
      <id>roger-nexus</id>
      <username>admin</username>
      <password>admin123</password>
    </server>
  </servers>

  <mirrors>
     <mirror>
      <id>roger-nexus</id>
      <mirrorOf>*</mirrorOf>
      <name>Mirror of roger</name>
      <url>http://127.0.0.1:8081/nexus/content/groups/public</url>
    </mirror>
  </mirrors>

  <profiles>
    <profile>
      <id>jdk-1.7</id>
      <activation>
        <jdk>1.7</jdk>
      </activation>
      <repositories>
        <repository>
          <id>jdk17</id>
          <name>Repository for JDK 1.7 builds</name>
          <url>http://127.0.0.1:8081/nexus/content/groups/public/</url>
          <layout>default</layout>
          <snapshotPolicy>always</snapshotPolicy>
        </repository>
      </repositories>
    </profile>
  </profiles>

  <activeProfiles>
    <activeProfile>jdk-1.7</activeProfile>
  </activeProfiles>
</settings>

所以希望能有人帮我看看这个配置文件到底有什么问题

2014年1月02日 12:53

1个答案 按时间排序 按投票排序

0 0

先执行 mvn help:system -U 再看log,现在的log没有实际信息

2014年1月02日 13:56

相关推荐

    Maven与Nexus配置.pdf

    标题《Maven与Nexus配置.pdf》指向的是关于如何配置和使用Maven与Nexus的指南。Maven是一个项目管理和自动构建工具,它主要服务于基于Java的项目,帮助处理项目构建、文档生成、报告、依赖管理和项目信息等。Nexus是...

    maven 私服 nexus3 安装包

    总结,Nexus3 是一个强大且灵活的 Maven 私服解决方案,虽然在使用过程中可能会遇到各种问题,但通过了解其工作原理和配置细节,我们完全可以克服这些困难,充分利用它来优化软件开发流程。在日常开发中,不断学习和...

    git-maven-nexus-hudson使用手册

    ### Git、Maven、Nexus与Hudson使用手册解析 #### Git远程仓库的搭建与管理 **Git**作为一款分布式版本控制系统,在软件开发领域扮演着举足轻重的角色。其强大的功能不仅限于版本控制,还支持分支管理、冲突解决等...

    maven和nexus文档

    结合描述中的“maven问题处理”和“maven项目报错”,可能涉及的常见问题包括依赖找不到、版本冲突、POM配置错误等,这些问题通常通过调整POM配置、清理本地仓库或更新Nexus仓库来解决。而“nexus_说明”可能涵盖了...

    jenkins+maven+nexus+mantisBug

    【标题】"jenkins+maven+nexus+mantisBug"揭示了四个关键的IT技术领域,它们在软件开发的持续集成和缺陷管理流程中扮演着重要角色。这些技术分别是Jenkins、Maven、Nexus和MantisBug。 **Jenkins** 是一款开源的...

    ECLIPSE实现MAVEN项目自动部署NEXUS中

    为了能够通过 Maven 将项目部署到 Nexus,我们需要修改 Maven 的配置文件 `settings.xml`。在 `&lt;servers&gt;` 部分添加如下配置: ```xml &lt;id&gt;nexus-3rd &lt;username&gt;your_username &lt;password&gt;your_password ``...

    maven私服nexus最新版本2.10

    在实际项目中,开发者通常需要配置Maven的settings.xml文件,将Nexus设置为镜像(mirror)或者添加Nexus的仓库URL。此外,还需要定期备份Nexus的数据,以防止意外丢失。Nexus还提供了丰富的REST API,允许自动化脚本...

    maven-nexus2.14.5补丁包.rar

    Maven Nexus 2.14.5是一个较旧但仍然广泛使用的版本。这个补丁包可能包含了一些安全更新、性能优化或者其他功能增强。安装和应用这个补丁包通常涉及以下几个步骤: 1. 下载:首先,你需要下载这个“maven-nexus...

    手动搭建maven私服-安装配置nexus 3.4教程

    手动搭建maven私服是指使用nexus 3.4安装配置一个maven私服,实现公司或个人项目的构件管理。下面将详细介绍手动搭建maven私服的过程。 一、安装nexus 3.4 首先下载nexus 3.4安装包,并将其解压到指定目录下。解压...

    最新maven私服工具nexus.zip

    5. **配置Maven**:在Maven的`settings.xml`中配置Nexus的仓库地址,以便Maven自动通过Nexus获取依赖。 ### 四、使用Nexus管理私有仓库 1. **创建仓库**:在Nexus Web界面中,可以根据需求创建不同类型(代理、...

    nexus-maven

    描述中提到,“里面包含了一个nexus和一个详细的教程,自己用版本,有问题”,这表明该压缩包中不仅包括了Nexus的安装包(nexus-2.4-bundle.zip),还提供了一份详尽的教程,用于指导用户进行安装和配置。...

    使用Maven+Nexus+Jenkins+Svn+Tomcat+Sonar搭建持续集成环境

    配置Nexus包括安装服务、创建仓库和配置Maven指向Nexus仓库。 Subversion(Svn)是一个版本控制系统,用于跟踪和控制项目源代码的变化。团队成员可以在Svn仓库中进行代码提交,通过版本控制保证代码的一致性和可...

    Maven本地仓库搭建工具nexus-2.11.4-01-bundle

    为了解决这个问题,我们可以使用Nexus作为本地仓库,它可以缓存远程仓库的依赖,提高开发效率并降低网络问题带来的影响。 Nexus是由Sonatype公司开发的一款强大的Maven仓库管理器,它不仅能够作为本地仓库,还可以...

    maven私服nexus-2.4.0-09

    【 Maven 私服 Nexus ...通过以上介绍,我们了解了 Maven 私服 Nexus 2.4.0-09 的主要功能和特性,以及如何在实际开发环境中配置和使用。它作为企业内部的 Maven 仓库管理工具,极大地提升了开发效率和代码质量管理。

    nexus+maven.zip

    在使用Nexus作为Maven私服时,开发者需要在Maven的`settings.xml`文件中配置Nexus的URL,这样Maven在构建时会首先尝试从Nexus仓库拉取依赖。此外,Nexus还支持通过Web界面进行管理,例如创建不同的仓库组、存储库,...

    maven项目配置文件详细步骤

    - `&lt;mirrors&gt;` 节点用于配置Maven使用的镜像服务器。 - 示例代码如下: ```xml &lt;id&gt;nexus-aliyun &lt;name&gt;Nexus aliyun &lt;url&gt;https://maven.aliyun.com/repository/public&lt;/url&gt; * ``` - 这里配置了...

    Windows下maven镜像服务器搭建nexus

    Nexus是一个功能强大的仓库管理工具,能够管理软件开发过程中使用到的所有构件,包括Maven、npm、NuGet等。Nexus作为Maven的镜像服务器,可以让公司或组织内部的开发人员在断网的情况下继续进行构建和打包工作。此外...

    maven打包出错解决办法,亲测绝对可以!

    3. **配置Maven指向私服**:在`settings.xml`文件中添加`servers`和`mirrors`配置,指明Nexus的地址。这样,Maven会首先尝试从私服下载依赖,找不到时再从公共仓库下载。 4. **部署私有库**:使用Maven的`deploy`...

    nexus+maven

    解压后,可以通过配置环境变量`M2_HOME`和`PATH`来安装和使用这个版本的Maven。 总结来说,Nexus和Maven的结合使用可以帮助开发团队更高效、更稳定地管理项目的构建过程和依赖,提高开发效率,同时确保组件的安全性...

    Linux下利用nexus搭建maven私服

    4. **配置Maven** - 在本地Maven的`settings.xml`文件中,配置新的Repository Group和Hosted Repository。将它们添加到`mirrors`和`servers`标签中,确保Maven优先从私有仓库获取依赖。 5. **部署构件** - 使用...

Global site tag (gtag.js) - Google Analytics