2012-08-28 74 views
1

我按照在this blog post by Sonatype中編寫Ruby的Maven插件中的信的指示。Maven找不到JRuby mojo描述符

當我嘗試運行mvn install(Maven的3.0.4),構建成功,但maven-plugin-plugin找不到任何魔力的描述:如果我試圖撞擊maven-plugin-plugin版本,任何高於2.4,構建

[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. 

失敗,出現此錯誤消息:

[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 

任何想法爲什麼它不工作?

+0

sonatype鏈接已經死了。 –

回答

4

Codehaus jruby-maven-plugin似乎在5年前就被拋棄了。如果你使用的是Maven3,你可以嘗試使用Maven2,但是我想看看https://github.com/torquebox/jruby-maven-plugins

+1

感謝您的回覆以及使用torquebox提供的插件的建議。我嘗試使用Maven 2.2.1,它工作正常。 –