【问题标题】:Maven cannot find JRuby mojo descriptorsMaven 找不到 JRuby mojo 描述符
【发布时间】:2012-08-28 08:56:40
【问题描述】:

我按照this blog post by Sonatype 中的说明在 Ruby 中编写 Maven 插件。

当我尝试运行 mvn install (Maven 3.0.4) 时,构建成功,但 maven-plugin-plugin 找不到任何 mojo 描述符:

[INFO] ------------------------------------------------------------------------
[INFO] Building Example Ruby Mojo - firstruby-maven-plugin 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for org.jruby:jruby:jar:0.9.9 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[INFO]
[INFO] --- maven-plugin-plugin:2.4:descriptor (default-descriptor) @ firstruby-maven-plugin ---
[INFO] Using 3 extractors.
[INFO] Applying extractor for language: java
[INFO] Extractor for language: java found 0 mojo descriptors.
[INFO] Applying extractor for language: jruby
[INFO] Extractor for language: jruby found 0 mojo descriptors.
[INFO] Applying extractor for language: bsh
[INFO] Extractor for language: bsh found 0 mojo descriptors.

如果我尝试将 maven-plugin-plugin 版本提升到高于 2.4 的版本,构建将失败并显示以下错误消息:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-plugin-plugin:2.5:descriptor (default-descriptor) on project firstruby-maven-plugin: The API of the mojo scanner is not compatible with this plugin version. Please check the plugin dependencies configured in the POM and ensure the versions match. org.apache.maven.tools.plugin.scanner.MojoScanner.populatePluginDescriptor(Lorg/apache/maven/tools/plugin/PluginToolsRequest;)V -> [Help 1]

这是tree 的输出,表明目录结构正常:

firstruby-maven-plugin
├── pom.xml
└── src
    └── main
        └── scripts
            └── echo.rb

3 directories, 2 files

知道为什么它不起作用吗?

【问题讨论】:

  • sonatype 链接已失效。

标签: ruby maven jruby mojo sonatype


【解决方案1】:

Codehaus jruby-maven-plugin 似乎在 5 年前就被废弃了。如果您使用的是 Maven3,您可以尝试使用 Maven2,但我会查看 https://github.com/torquebox/jruby-maven-plugins

【讨论】:

  • 感谢您的回复和建议使用torquebox提供的插件。我尝试使用 Maven 2.2.1,效果很好。
猜你喜欢
  • 2012-07-05
  • 1970-01-01
  • 2017-03-01
  • 2013-09-30
  • 1970-01-01
  • 1970-01-01
  • 2011-06-26
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多