使用"org.apache.maven.plugins"手动更新Maven m2.和"org.codehaus.mojo" [英] Manually update Maven m2 with "org.apache.maven.plugins" and "org.codehaus.mojo"

查看:773
本文介绍了使用"org.apache.maven.plugins"手动更新Maven m2.和"org.codehaus.mojo"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有问题,我需要在脱机模式下使用Maven版本3.3.3. 我将conf文件settings.xml设置为脱机工作,并使用命令mvn --offline ecc ...

I have a problem, I need to use Maven version 3.3.3 in offline mode.  I set the conf file settings.xml to work offline and use the command mvn --offline ecc...

但是当我键入命令时: MVN原型:生成

But when i type the command: mvn archetype:generate

我看到以下错误:

[...]在当前项目中找不到前缀'archetype'的插件 并在插件组中[org.apache.maven.plugins,org.codehaus.mojo] 可从存储库[本地(C:\ Users \ xxx \ .m2 \ repository), 中央( https://repo.maven.apache.org/maven2)] -> [帮助1] org.apache.maven.plugin.prefix.NoPluginFoundForPrefixException:否 在当前项目和 可用的插件组[org.apache.maven.plugins,org.codehaus.mojo] 来自存储库[本地(C:\ Users \ xxx \ .m2 \ repository),中央 ( https://repo.maven.apache.org/maven2)] 在 org.apache.maven.plugin.prefix.internal.DefaultPluginPrefixResolver.resolve(DefaultPluginPrefixResolver.java:93) 在 org.apache.maven.lifecycle.internal.MojoDescriptorCreator.findPluginForPrefix(MojoDescriptorCreator.java:266) 在 org.apache.maven.lifecycle.internal.MojoDescriptorCreator.getMojoDescriptor(MojoDescriptorCreator.java:220) [...]

[...] No plugin found for prefix 'archetype' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (C:\Users\xxx\.m2\repository), central (https://repo.maven.apache.org/maven2)] -> [Help 1] org.apache.maven.plugin.prefix.NoPluginFoundForPrefixException: No plugin found for prefix 'archetype' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (C:\Users\xxx\.m2\repository), central (https://repo.maven.apache.org/maven2)] at org.apache.maven.plugin.prefix.internal.DefaultPluginPrefixResolver.resolve(DefaultPluginPrefixResolver.java:93) at org.apache.maven.lifecycle.internal.MojoDescriptorCreator.findPluginForPrefix(MojoDescriptorCreator.java:266) at org.apache.maven.lifecycle.internal.MojoDescriptorCreator.getMojoDescriptor(MojoDescriptorCreator.java:220) [...]

是否可以使用"org.apache.maven.plugins"和"org.codehaus.mojo"手动更新本地.m2存储库?

Is possible to update manually my local .m2 repository with "org.apache.maven.plugins" and "org.codehaus.mojo"?

预先感谢

推荐答案

错误消息仅表明原型插件不在您的本地存储库中.

The error message just tells that the archetype plugin is not in your local repo.

当然,您可以下载该插件并将其添加到本地存储库中.尤其是对于 archetype 插件,您可能还需要提供将要使用的原型(以及可能可供该插件用来定位原型的原型清单).

Of course you can download that plugin and add it to your local repo. Especially with archetype plugin you likely will also need to provide the archetypes you are going to use (and maybe the inventory of archetypes available for the plugin to locate archetypes).

当您有时确实以某种方式可以访问Internet时,您可能还想考虑运行诸如sonatype nexus或ar​​tifactory之类的本地存储库管理器,以简化脱机使用.

You may also want to consider to run a local repository manager like sonatype nexus or artifactory to ease offline use when you do have access to the internet sometimes and somehow.

我不会以复制org.apache.maven和org.codehaus.mojo提供的完整插件为目标,但是使用存储库管理器,您可能会更轻松地提供一组您通常使用的功能与(或希望与之合作).

I would not target copying the complete set of plugins provided from org.apache.maven and org.codehaus.mojo, but using a repository manager you may experience more ease with providing a decent set of what you "usually" are working with (or expect to work with).

这篇关于使用"org.apache.maven.plugins"手动更新Maven m2.和"org.codehaus.mojo"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆