草庐IT

java - Maven 3 : Failed to execute goal org. apache.maven.plugins :maven-archetype-plugin:2. 2:生成

coder 2024-03-30 原文

我正在尝试使用

测试ma​​ven
mvn archetype:generate -DgroupId=org.sonatype.mavenbook -DartifactId=quickstart -Dversion=1.0-SNAPSHOT -DpackageName=org.sonatype.mavenbook -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=1.0 -DinteractiveMode=false

几分钟后,系统显示如下:

Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/archetype/archetype-catalog/2.2/archetype-catalog-2.2.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/archetype/archetype-catalog/2.2/archetype-catalog-2.2.pom (2 KB at 4.4 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/archetype/archetype-models/2.2/archetype-models-2.2.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/archetype/archetype-models/2.2/archetype-models-2.2.pom (3 KB at 5.8 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/1.5.8/plexus-utils-1.5.8.pom
Downloaded: http://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/1.5.8/plexus-utils-1.5.8.pom (8 KB at 17.0 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus/2.0.2/plexus-2.0.2.pom
Downloading: http://repo.maven.apache.org/maven2/org/apache/ant/ant-parent/1.8.1/ant-parent-1.8.1.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 30:36.874s
[INFO] Finished at: Tue Feb 07 15:59:39 BRST 2012
[INFO] Final Memory: 5M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.2:generate (default-cli) on project standalone-pom: Execution default-cli of goal org.apache.maven.plugins:maven-archetype-plugin:2.2:generate failed: Plugin org.apache.maven.plugins:maven-archetype-plugin:2.2 or one of its dependencies could not be resolved: Failed to collect dependencies for org.apache.maven.plugins:maven-archetype-plugin:jar:2.2 (): Failed to read artifact descriptor for org.codehaus.plexus:plexus-utils:jar:1.5.8: Could not transfer artifact org.codehaus.plexus:plexus:pom:2.0.2 from/to central (http://repo.maven.apache.org/maven2): Read timed out -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[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

我该如何解决这个问题?提前致谢!

最佳答案

我在使用Idea IDE创建项目时也遇到了同样的问题。使用以下方法,您可以创建独立应用程序或 Web 应用程序而不会出现任何错误。

转到终端。输入下面提到的命令并执行。

对于网络应用程序:

mvn archetype:generate -DgroupId={project-packaging} -DartifactId={project-name} -DarchetypeArtifactId=maven-archetype-webapp -DinteractiveMode=false

对于独立应用程序:

mvn archetype:generate -DgroupId={project-packaging} -DartifactId={project-name} -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false

这将通过下载相关的 jar 等来创建项目结构。完成后,项目结构已创建。打开一个 IDE 并将其定向到创建的项目的 Pom.xml 文件。

关于java - Maven 3 : Failed to execute goal org. apache.maven.plugins :maven-archetype-plugin:2. 2:生成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9181683/

有关java - Maven 3 : Failed to execute goal org. apache.maven.plugins :maven-archetype-plugin:2. 2:生成的更多相关文章

  1. 叮咚买菜基于 Apache Doris 统一 OLAP 引擎的应用实践 - 2

    导读:随着叮咚买菜业务的发展,不同的业务场景对数据分析提出了不同的需求,他们希望引入一款实时OLAP数据库,构建一个灵活的多维实时查询和分析的平台,统一数据的接入和查询方案,解决各业务线对数据高效实时查询和精细化运营的需求。经过调研选型,最终引入ApacheDoris作为最终的OLAP分析引擎,Doris作为核心的OLAP引擎支持复杂地分析操作、提供多维的数据视图,在叮咚买菜数十个业务场景中广泛应用。作者|叮咚买菜资深数据工程师韩青叮咚买菜创立于2017年5月,是一家专注美好食物的创业公司。叮咚买菜专注吃的事业,为满足更多人“想吃什么”而努力,通过美好食材的供应、美好滋味的开发以及美食品牌的孵

  2. ruby - 导轨 3 : Creating app with internal plugin system - 2

    我想在Rails中使用插件系统创建一个应用程序。潜在用户应该能够上传(或更好地从存储库安装)一个插件并安装它,使我的应用程序能够做更多的事情。这应该在没有FTP/SSH/对服务器的任何低级别访问的情况下完成。关于如何在Rails3中完成它,是否有任何好的gems或教程? 最佳答案 你看过http://edgeguides.rubyonrails.org/plugins.html了吗??它似乎不是100%兼容Rails3,但它可以帮助您入门。我看过的大多数插件文章都涉及Rails2。 关于

  3. ruby-on-rails - Phusion Passenger 不在 Apache 上工作 - 2

    更新:当输入“passenger-memory-stats”时,我显示:---Passengerprocesses---Processes:0我该如何解决这个问题?为什么即使我在httpd.conf中添加它并重新启动apache,passenger也不会启动?我无法让PhusionPassenger在服务器上运行RubyonRails。我已经按照Phusion网站上的所有说明安装了passenger并修改并创建了ApacheVirtualHost以指向新目录并验证所有.conf文件都已成功加载。还加载了httpd-Mpassenger_module。我还在本地主机上成功运行了Passe

  4. ruby - 在 Maven 集成中运行 Ruby 单元测试 - 2

    有没有人有在Maven中运行用Ruby编写的单元测试的经验。任何输入,如要使用的库/maven插件,将不胜感激!我们已经在使用Maven+hudson+Junit。但是我们正在引入Ruby单元测试,找不到任何同样好的组合。 最佳答案 我建议让Maven使用ExecMavenPlugin启动rake测试(exec:exec目标)并使用ci_reportergem生成单元测试结果的XML文件,Hudson、Bamboo等可以读取该文件,以与JUnit测试相同的格式显示测试结果。如果您不需要使用mvntest运行Ruby测试,您也可以只使

  5. ruby-on-rails - 使用 apache + passenger 3.0.7 运行我的 Rails 应用程序时遇到段错误 - 2

    我的带有apache+passenger的Rails应用程序一开始工作得很好。但是,运行一段时间后,遇到如下错误:Theapplicationspawnerserverexitedunexpectedly:Unexpectedend-of-filedetected.我查看了apache的错误日志,发现了这个错误:../gems/passenger-3.0.7/lib/phusion_passenger/utils.rb:716:[BUG]Segmentationfault似乎乘客有内存问题。有人可以帮忙吗?谢谢。 最佳答案 最可能的

  6. ruby-on-rails - 为什么在部署 Rails 应用程序时需要 Apache 服务器? - 2

    虽然我们可以用webrick或mongrel部署它 最佳答案 大多数Ruby应用程序服务器只会运行一个Ruby进程(Ruby有一个全局解释器锁,这使得多线程变得毫无意义),这意味着它一次只能处理一个请求。至少可以说,这不会给你很好的表现。有两种解决方法:运行多个Ruby应用程序服务器并在它们前面放置一个负载平衡器或反向代理,例如Nginx或Apache在一堆Mongrels或瘦服务器前面(您运行的进程数反射(reflect)了您将能够并行处理的请求数)。或者你运行Passenger,它是一个Apache或Nginx模块,管理一个应用

  7. ruby-on-rails - 有必要把Unicorn放在Nginx(或Apache)后面吗 - 2

    我对这个架构有点困惑。在我正在进行的一个项目中,Unicorn被选为Rails服务器。它放在Nginx网络服务器后面。据我了解,Unicorn是功能齐全的Web服务器,我们不打算在同一服务器实例上托管任何其他Rails应用程序。所以我的问题是:在链中添加附加层有什么好处:client->nginx->unicorn->unicornworker 最佳答案 Unicorn不是为处理“慢客户端”而设计的。您可以在PHILOSOPHY中阅读更多相关信息帮助文件:Mostbenchmarkswe’veseendon’ttellyouthis

  8. ruby-on-rails - 如何在 Windows 中为 Ruby on Rails 配置 Apache 2.2? - 2

    我正尝试着手编写一些RubyonRails应用程序并在Mongrel上取得了成功,但是,我想将我的应用程序部署到Windows上的Apache2.2实例吗?我发现的所有教程似乎都已过时,并且适用于旧版本的Apache/Rails。有人知道为RubyonRails应用程序配置Apache2.2的最新好教程吗? 最佳答案 编辑:至少在Win出现PhusionPassenger之前,Apache+Mongrel是可行的方法。您可以在没有Mongrel的情况下使用Apache+FastCGI,但在实际负载下您会遇到(更多)僵尸进程和(更多)

  9. ruby-on-rails - minitest_plugin.rb :9 getting wrong number of arguments - 2

    ~/Sites/sample_app$railstestRunningviaSpringpreloaderinprocess24338Runoptions:--seed58780Running:..Finishedin0.292172s,6.8453runs/s,6.8453assertions/s./var/lib/gems/2.3.0/gems/railties-5.1.0/lib/rails/test_unit/minitest_plugin.rb:9:in`aggregated_results':wrongnumberofarguments(given1,expected0)(

  10. ruby-on-rails - 在 Apache 下的子目录中配置 Ruby On Rails App - 2

    我在Windows上安装了apache2.2。我正在尝试同时提供颠覆(/svn)和redmine(/redmine)。我的svn使用此配置运行良好:DAVsvnSVNParentPathC:/svn_repository...这很好用——我的svn用户可以点击http://mybox/svn就好了。现在我想为Rails应用程序(RedMine)添加另一个目录:我遵循了thisquestion中的建议设置杂种服务器并让apache代理客户端连接到它。如果我将它设为根目录,它工作正常——但我在将它设为子目录时遇到了问题:ProxyPasshttp://localhost:3000/Prox

随机推荐