黄瓜0.4.3(cuke4duke)与java + maven gem问题

时间:2011-02-16 14:28:54

标签: java cucumber jruby

我最近开始为黄瓜安装一个示例项目,并尝试使用maven + java运行它。

我遵循了这个指南

http://www.goodercode.com/wp/using-cucumber-tests-with-maven-and-java/

第一个问题是我运行mvn cuke4duke:cucumber -DinstallGems = true 我从jruby-complete-1.5.6 jar中运行gem命令时遇到了问题

我安装了JRuby1.5.6并将cuke4duke gem自己安装到maven存储库。

现在当我运行上面的命令时,脚本文件“require'rubygem'”中出现错误,它无法再次执行gem命令。

我在xp上运行并尝试使用maven 2.0.9和maven 3.0.2(全新安装)

我已经尝试运行java -classpath“跟踪中的所有库”org.Main gem install cuke4duke ....(请参阅完整命令的跟踪),这不起作用。为了安装gems,我使用了JRuby安装程序并执行了相同的命令,它运行正常。

用java在Windows上运行黄瓜怎么这么难?我尝试了几种变化,只是不知道下一步该做什么。

这是我的堆栈跟踪与运行mvn cuke4duke:cucumber -DinstallGems = true

    Apache Maven 3.0.2 (r1056850; 2011-01-09 00:58:10+0000)
Java version: 1.6.0_21, vendor: Sun Microsystems Inc.
Java home: C:\Program Files\Java\jdk1.6.0_21\jre
Default locale: en_GB, platform encoding: Cp1252
OS name: "windows xp", version: "5.1", arch: "x86", family: "windows"
[INFO] Error stacktraces are turned on.
[DEBUG] Reading global settings from C:\local\apache-maven-3.0.2\bin\..\conf\settings.xml
[DEBUG] Reading user settings from C:\Documents and Settings\Ronald.Noble\.m2\settings.xml
[DEBUG] Using local repository at C:\Documents and Settings\Ronald.Noble\.m2\repository
[DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10 for C:\Documents and Settings\Ronald.Noble\.m2\repository
[INFO] Scanning for projects...
[DEBUG] Extension realms for project com.goodercode:maven-cuke:jar:1.0-SNAPSHOT: (none)
[DEBUG] Looking up lifecyle mappings for packaging jar from ClassRealm[plexus.core, parent: null]
[DEBUG] Resolving plugin prefix cuke4duke from [com.atlassian.maven.plugins, org.apache.maven.plugins, org.codehaus.mojo]
[DEBUG] Resolved plugin prefix cuke4duke to cuke4duke:cuke4duke-maven-plugin from POM com.goodercode:maven-cuke:jar:1.0-SNAPSHOT
[DEBUG] === REACTOR BUILD PLAN ================================================
[DEBUG] Project: com.goodercode:maven-cuke:jar:1.0-SNAPSHOT
[DEBUG] Tasks:   [cuke4duke:cucumber]
[DEBUG] Style:   Regular
[DEBUG] =======================================================================
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building maven-cuke 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[DEBUG] Resolving plugin prefix cuke4duke from [com.atlassian.maven.plugins, org.apache.maven.plugins, org.codehaus.mojo]
[DEBUG] Resolved plugin prefix cuke4duke to cuke4duke:cuke4duke-maven-plugin from POM com.goodercode:maven-cuke:jar:1.0-SNAPSHOT
[DEBUG] Lifecycle default -> [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy]
[DEBUG] Lifecycle clean -> [pre-clean, clean, post-clean]
[DEBUG] Lifecycle site -> [pre-site, site, post-site, site-deploy]
[DEBUG] === PROJECT BUILD PLAN ================================================
[DEBUG] Project:       com.goodercode:maven-cuke:1.0-SNAPSHOT
[DEBUG] Dependencies (collect): []
[DEBUG] Dependencies (resolve): [test]
[DEBUG] Repositories (dependencies): [icdinhouse (http://ukicdjira/repository/inhouse/, releases=true, snapshots=true, managed=false), icdsnapshots (http://ukicdjira/repository/snapshots/, releases=true, snapshots=true, managed=false), mavenSnapshots (http://people.apache.org/maven-snapshot-repository/, releases=true, snapshots=true, managed=false), nexus (http://nexus.openqa.org/content/repositories/releases/, releases=true, snapshots=true, managed=false), nexussnapshots (http://nexus.openqa.org/content/repositories/releases/, releases=true, snapshots=true, managed=false), spring-maven-release (http://maven.springframework.org/release, releases=true, snapshots=true, managed=false), spring-maven-milestone (http://maven.springframework.org/milestone, releases=true, snapshots=true, managed=false), spring-roo-repository (http://spring-roo-repository.springsource.org/release, releases=true, snapshots=true, managed=false), JBoss Repo (https://repository.jboss.org/nexus/content/repositories/releases, releases=true, snapshots=true, managed=false), codehaus (http://repository.codehaus.org, releases=true, snapshots=true, managed=false), cukes (http://cukes.info/maven, releases=true, snapshots=true, managed=false), central (http://repo1.maven.org/maven2, releases=true, snapshots=false, managed=false)]
[DEBUG] Repositories (plugins)     : [cukes (http://cukes.info/maven, releases=true, snapshots=true, managed=false), atlassian-m2-repository (http://repository.atlassian.com/maven2, releases=true, snapshots=true, managed=false), central (http://repo1.maven.org/maven2, releases=true, snapshots=false, managed=false)]
[DEBUG] -----------------------------------------------------------------------
[DEBUG] Goal:          cuke4duke:cuke4duke-maven-plugin:0.4.3:cucumber (default-cli)
[DEBUG] Style:         Regular
[DEBUG] Configuration: <?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <compileClasspathElements default-value="${project.compileClasspathElements}"/>
  <cucumberArgs>
    <cucumberArg>C:\workspace\maven-cuke/target/test-classes --tags ~@wip</cucumberArg>
  </cucumberArgs>
  <extraCucumberArgs>${cucumber.extraArgs}</extraCucumberArgs>
  <failOnError>${cucumber.failOnError}</failOnError>
  <features>${cucumber.features}</features>
  <gemDirectory>${cucumber.gemDirectory}</gemDirectory>
  <gems>
    <gem>install cuke4duke --version 0.4.3</gem>
  </gems>
  <installGems>${cucumber.installGems}</installGems>
  <jvmArgs>
    <jvmArg>-Dcuke4duke.objectFactory=cuke4duke.internal.jvmclass.PicoFactory</jvmArg>
    <jvmArg>${cucumber.debug}</jvmArg>
  </jvmArgs>
  <launchDirectory>${project.basedir}</launchDirectory>
  <localRepository>${localRepository}</localRepository>
  <mavenProject>${project}</mavenProject>
  <pluginArtifacts>${plugin.artifacts}</pluginArtifacts>
  <settings>${settings}</settings>
  <skip>${maven.test.skip}</skip>
  <testClasspathElements>${project.testClasspathElements}</testClasspathElements>
</configuration>
[DEBUG] =======================================================================
[DEBUG] com.goodercode:maven-cuke:jar:1.0-SNAPSHOT
[DEBUG]    cuke4duke:cuke4duke:jar:0.4.3:test
[DEBUG]       org.jruby:jruby-complete:jar:1.5.6:test
[DEBUG]       org.apache.ant:ant:jar:1.8.2:test
[DEBUG]          org.apache.ant:ant-launcher:jar:1.8.2:test
[DEBUG]    org.picocontainer:picocontainer:jar:2.8.3:test
[DEBUG]    junit:junit:jar:4.8.1:test
[INFO] 
[INFO] --- cuke4duke-maven-plugin:0.4.3:cucumber (default-cli) @ maven-cuke ---
[DEBUG] cuke4duke:cuke4duke-maven-plugin:jar:0.4.3:
[DEBUG]    org.apache.maven:maven-project:jar:2.0.9:compile
[DEBUG]       org.apache.maven:maven-settings:jar:2.0.9:compile
[DEBUG]       org.apache.maven:maven-profile:jar:2.0.9:compile
[DEBUG]       org.apache.maven:maven-model:jar:2.0.9:compile
[DEBUG]       org.apache.maven:maven-artifact-manager:jar:2.0.9:compile
[DEBUG]          org.apache.maven:maven-repository-metadata:jar:2.0.9:compile
[DEBUG]       org.apache.maven:maven-plugin-registry:jar:2.0.9:compile
[DEBUG]       org.codehaus.plexus:plexus-utils:jar:1.5.1:compile
[DEBUG]       org.apache.maven:maven-artifact:jar:2.0.9:compile
[DEBUG]       org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1:compile
[DEBUG]          junit:junit:jar:4.8.2:compile (version managed from 3.8.1)
[DEBUG]          classworlds:classworlds:jar:1.1-alpha-2:compile
[DEBUG]    org.apache.maven:maven-plugin-api:jar:2.0.9:compile
[DEBUG]    cuke4duke:cuke4duke:jar:0.4.3:compile
[DEBUG]       org.jruby:jruby-complete:jar:1.5.6:compile
[DEBUG]    org.apache.ant:ant:jar:1.8.2:compile
[DEBUG]       org.apache.ant:ant-launcher:jar:1.8.2:compile
[DEBUG] Created new class realm maven.api
[DEBUG] Importing foreign packages into class realm maven.api
[DEBUG]   Imported: org.apache.maven.wagon.events < plexus.core
[DEBUG]   Imported: org.sonatype.aether.transfer < plexus.core
[DEBUG]   Imported: org.apache.maven.exception < plexus.core
[DEBUG]   Imported: org.sonatype.aether.metadata < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.util.xml.Xpp3Dom < plexus.core
[DEBUG]   Imported: org.sonatype.aether.collection < plexus.core
[DEBUG]   Imported: org.sonatype.aether.version < plexus.core
[DEBUG]   Imported: org.apache.maven.monitor < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.repository < plexus.core
[DEBUG]   Imported: org.apache.maven.repository < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.resource < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.logging < plexus.core
[DEBUG]   Imported: org.apache.maven.profiles < plexus.core
[DEBUG]   Imported: org.sonatype.aether.repository < plexus.core
[DEBUG]   Imported: org.apache.maven.classrealm < plexus.core
[DEBUG]   Imported: org.apache.maven.execution < plexus.core
[DEBUG]   Imported: org.sonatype.aether.artifact < plexus.core
[DEBUG]   Imported: org.sonatype.aether.spi < plexus.core
[DEBUG]   Imported: org.apache.maven.reporting < plexus.core
[DEBUG]   Imported: org.apache.maven.usability < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.container < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.component < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.util.xml.pull.XmlSerializer < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.authentication < plexus.core
[DEBUG]   Imported: org.apache.maven.lifecycle < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.classworlds < plexus.core
[DEBUG]   Imported: org.sonatype.aether.graph < plexus.core
[DEBUG]   Imported: org.sonatype.aether.* < plexus.core
[DEBUG]   Imported: org.apache.maven.settings < plexus.core
[DEBUG]   Imported: org.codehaus.classworlds < plexus.core
[DEBUG]   Imported: org.sonatype.aether.impl < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.* < plexus.core
[DEBUG]   Imported: org.apache.maven.toolchain < plexus.core
[DEBUG]   Imported: org.sonatype.aether.deployment < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.observers < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.util.xml.pull.XmlPullParserException < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.util.xml.pull.XmlPullParser < plexus.core
[DEBUG]   Imported: org.apache.maven.configuration < plexus.core
[DEBUG]   Imported: org.apache.maven.cli < plexus.core
[DEBUG]   Imported: org.sonatype.aether.installation < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.context < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.authorization < plexus.core
[DEBUG]   Imported: org.apache.maven.project < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.lifecycle < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.configuration < plexus.core
[DEBUG]   Imported: org.apache.maven.artifact < plexus.core
[DEBUG]   Imported: org.apache.maven.model < plexus.core
[DEBUG]   Imported: org.apache.maven.* < plexus.core
[DEBUG]   Imported: org.apache.maven.wagon.proxy < plexus.core
[DEBUG]   Imported: org.sonatype.aether.resolution < plexus.core
[DEBUG]   Imported: org.apache.maven.plugin < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.* < plexus.core
[DEBUG]   Imported: org.codehaus.plexus.personality < plexus.core
[DEBUG] Populating class realm maven.api
[DEBUG] Created new class realm plugin>cuke4duke:cuke4duke-maven-plugin:0.4.3
[DEBUG] Importing foreign packages into class realm plugin>cuke4duke:cuke4duke-maven-plugin:0.4.3
[DEBUG]   Imported:  < maven.api
[DEBUG] Populating class realm plugin>cuke4duke:cuke4duke-maven-plugin:0.4.3
[DEBUG]   Included: cuke4duke:cuke4duke-maven-plugin:jar:0.4.3
[DEBUG]   Included: org.codehaus.plexus:plexus-utils:jar:1.5.1
[DEBUG]   Included: junit:junit:jar:4.8.2
[DEBUG]   Included: cuke4duke:cuke4duke:jar:0.4.3
[DEBUG]   Included: org.jruby:jruby-complete:jar:1.5.6
[DEBUG]   Included: org.apache.ant:ant:jar:1.8.2
[DEBUG]   Included: org.apache.ant:ant-launcher:jar:1.8.2
[DEBUG]   Excluded: org.apache.maven:maven-project:jar:2.0.9
[DEBUG]   Excluded: org.apache.maven:maven-settings:jar:2.0.9
[DEBUG]   Excluded: org.apache.maven:maven-profile:jar:2.0.9
[DEBUG]   Excluded: org.apache.maven:maven-model:jar:2.0.9
[DEBUG]   Excluded: org.apache.maven:maven-artifact-manager:jar:2.0.9
[DEBUG]   Excluded: org.apache.maven:maven-repository-metadata:jar:2.0.9
[DEBUG]   Excluded: org.apache.maven:maven-plugin-registry:jar:2.0.9
[DEBUG]   Excluded: org.apache.maven:maven-artifact:jar:2.0.9
[DEBUG]   Excluded: org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1
[DEBUG]   Excluded: classworlds:classworlds:jar:1.1-alpha-2
[DEBUG]   Excluded: org.apache.maven:maven-plugin-api:jar:2.0.9
[DEBUG] Configuring mojo cuke4duke:cuke4duke-maven-plugin:0.4.3:cucumber from plugin realm ClassRealm[plugin>cuke4duke:cuke4duke-maven-plugin:0.4.3, parent: sun.misc.Launcher$AppClassLoader@11b86e7]
[DEBUG] Configuring mojo 'cuke4duke:cuke4duke-maven-plugin:0.4.3:cucumber' with basic configurator -->
[DEBUG]   (f) compileClasspathElements = [C:\workspace\maven-cuke\target\classes]
[DEBUG]   (f) cucumberArgs = [C:\workspace\maven-cuke/target/test-classes --tags ~@wip]
[DEBUG]   (f) gems = [install cuke4duke --version 0.4.3]
[DEBUG]   (f) jvmArgs = [-Dcuke4duke.objectFactory=cuke4duke.internal.jvmclass.PicoFactory, null]
[DEBUG]   (f) launchDirectory = C:\workspace\maven-cuke
[DEBUG]   (f) localRepository =        id: local
      url: file:///C:/Documents%20and%20Settings/Ronald.Noble/.m2/repository/
   layout: none

[DEBUG]   (f) mavenProject = MavenProject: com.goodercode:maven-cuke:1.0-SNAPSHOT @ C:\workspace\maven-cuke\pom.xml
[DEBUG]   (f) pluginArtifacts = [cuke4duke:cuke4duke-maven-plugin:maven-plugin:0.4.3:, org.codehaus.plexus:plexus-utils:jar:1.5.1:compile, junit:junit:jar:4.8.2:compile, cuke4duke:cuke4duke:jar:0.4.3:compile, org.jruby:jruby-complete:jar:1.5.6:compile, org.apache.ant:ant:jar:1.8.2:compile, org.apache.ant:ant-launcher:jar:1.8.2:compile]
[DEBUG]   (f) settings = org.apache.maven.execution.SettingsAdapter@b51404
[DEBUG]   (f) testClasspathElements = [C:\workspace\maven-cuke\target\test-classes, C:\workspace\maven-cuke\target\classes, C:\Documents and Settings\Ronald.Noble\.m2\repository\cuke4duke\cuke4duke\0.4.3\cuke4duke-0.4.3.jar, C:\Documents and Settings\Ronald.Noble\.m2\repository\org\jruby\jruby-complete\1.5.6\jruby-complete-1.5.6.jar, C:\Documents and Settings\Ronald.Noble\.m2\repository\org\apache\ant\ant\1.8.2\ant-1.8.2.jar, C:\Documents and Settings\Ronald.Noble\.m2\repository\org\apache\ant\ant-launcher\1.8.2\ant-launcher-1.8.2.jar, C:\Documents and Settings\Ronald.Noble\.m2\repository\org\picocontainer\picocontainer\2.8.3\picocontainer-2.8.3.jar, C:\Documents and Settings\Ronald.Noble\.m2\repository\junit\junit\4.8.1\junit-4.8.1.jar]
[DEBUG] -- end configuration --
[DEBUG] Adding reference: jruby.classpath
[DEBUG] Executing 'C:\Program Files\Java\jdk1.6.0_21\jre\bin\java.exe' with arguments:
'-Dcuke4duke.objectFactory=cuke4duke.internal.jvmclass.PicoFactory'
'-classpath'
'C:\workspace\maven-cuke\target\test-classes;C:\workspace\maven-cuke\target\classes;C:\Documents and Settings\Ronald.Noble\.m2\repository\cuke4duke\cuke4duke\0.4.3\cuke4duke-0.4.3.jar;C:\Documents and Settings\Ronald.Noble\.m2\repository\org\jruby\jruby-complete\1.5.6\jruby-complete-1.5.6.jar;C:\Documents and Settings\Ronald.Noble\.m2\repository\org\apache\ant\ant\1.8.2\ant-1.8.2.jar;C:\Documents and Settings\Ronald.Noble\.m2\repository\org\apache\ant\ant-launcher\1.8.2\ant-launcher-1.8.2.jar;C:\Documents and Settings\Ronald.Noble\.m2\repository\org\picocontainer\picocontainer\2.8.3\picocontainer-2.8.3.jar;C:\Documents and Settings\Ronald.Noble\.m2\repository\junit\junit\4.8.1\junit-4.8.1.jar;C:\Documents and Settings\Ronald.Noble\.m2\repository\cuke4duke\cuke4duke-maven-plugin\0.4.3\cuke4duke-maven-plugin-0.4.3.jar;C:\Documents and Settings\Ronald.Noble\.m2\repository\org\codehaus\plexus\plexus-utils\1.5.1\plexus-utils-1.5.1.jar;C:\Documents and Settings\Ronald.Noble\.m2\repository\junit\junit\4.8.2\junit-4.8.2.jar'
'org.jruby.Main'
'C:\Documents and Settings\Ronald.Noble\.m2\repository\.jruby\bin\cuke4duke'
'C:\workspace\maven-cuke/target/test-classes'
'--tags'
'~@wip'
'features'

The ' characters around the executable and arguments are
not part of the command.
[DEBUG] Setting environment variable: GEM_HOME=C:\Documents and Settings\Ronald.Noble\.m2\repository\.jruby
[DEBUG] Setting environment variable: GEM_PATH=C:\Documents and Settings\Ronald.Noble\.m2\repository\.jruby
[DEBUG] Execute:Java13CommandLauncher: Executing 'C:\Program Files\Java\jdk1.6.0_21\jre\bin\java.exe' with arguments:
'-Dcuke4duke.objectFactory=cuke4duke.internal.jvmclass.PicoFactory'
'-classpath'
'C:\workspace\maven-cuke\target\test-classes;C:\workspace\maven-cuke\target\classes;C:\Documents and Settings\Ronald.Noble\.m2\repository\cuke4duke\cuke4duke\0.4.3\cuke4duke-0.4.3.jar;C:\Documents and Settings\Ronald.Noble\.m2\repository\org\jruby\jruby-complete\1.5.6\jruby-complete-1.5.6.jar;C:\Documents and Settings\Ronald.Noble\.m2\repository\org\apache\ant\ant\1.8.2\ant-1.8.2.jar;C:\Documents and Settings\Ronald.Noble\.m2\repository\org\apache\ant\ant-launcher\1.8.2\ant-launcher-1.8.2.jar;C:\Documents and Settings\Ronald.Noble\.m2\repository\org\picocontainer\picocontainer\2.8.3\picocontainer-2.8.3.jar;C:\Documents and Settings\Ronald.Noble\.m2\repository\junit\junit\4.8.1\junit-4.8.1.jar;C:\Documents and Settings\Ronald.Noble\.m2\repository\cuke4duke\cuke4duke-maven-plugin\0.4.3\cuke4duke-maven-plugin-0.4.3.jar;C:\Documents and Settings\Ronald.Noble\.m2\repository\org\codehaus\plexus\plexus-utils\1.5.1\plexus-utils-1.5.1.jar;C:\Documents and Settings\Ronald.Noble\.m2\repository\junit\junit\4.8.2\junit-4.8.2.jar'
'org.jruby.Main'
'C:\Documents and Settings\Ronald.Noble\.m2\repository\.jruby\bin\cuke4duke'
'C:\workspace\maven-cuke/target/test-classes'
'--tags'
'~@wip'
'features'

The ' characters around the executable and arguments are
not part of the command.
[INFO] C:\Documents and Settings\Ronald.Noble\.m2\repository\.jruby\bin\cuke4duke:9:in `require': no such file to load -- rubygems (LoadError)
[INFO]  from C:\Documents and Settings\Ronald.Noble\.m2\repository\.jruby\bin\cuke4duke:9
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.515s
[INFO] Finished at: Wed Feb 16 12:19:19 GMT 2011
[INFO] Final Memory: 2M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal cuke4duke:cuke4duke-maven-plugin:0.4.3:cucumber (default-cli) on project maven-cuke: JRuby failed. Java returned: 1 -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal cuke4duke:cuke4duke-maven-plugin:0.4.3:cucumber (default-cli) on project maven-cuke: JRuby failed.
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
    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:319)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:534)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException: JRuby failed.
    at cuke4duke.mojo.CucumberMojo.execute(CucumberMojo.java:87)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:107)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
    ... 19 more
Caused by: Java returned: 1
    at org.apache.tools.ant.taskdefs.Java.execute(Java.java:111)
    at cuke4duke.ant.JRubyTask.execute(JRubyTask.java:22)
    at cuke4duke.ant.CucumberTask.execute(CucumberTask.java:15)
    at cuke4duke.mojo.CucumberMojo.execute(CucumberMojo.java:84)
    ... 21 more
[ERROR] 
[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/MojoExecutionException

在我自己安装宝石之前,我收到了这个错误,请注意它表示宝石无法识别命令

PasteBin StackTrace (在一个帖子中有两条痕迹太长了)

此外,我尝试卸载我的JRuby并卸载宝石几次,并允许maven安装宝石,但它不起作用。

3 个答案:

答案 0 :(得分:1)

解决方案是从源代码编译0.4.2版本。然后使用jruby 1.5.3而不是1.5.6,它似乎在windows xp上完美运行。

答案 1 :(得分:1)

我有好消息要报告那些不幸在XP上遇到同样问题的人。只需将jruby-complete:1.6.0(刚刚发布的最新版本)添加到项目依赖项中,以覆盖1.5.6,这似乎是导致问题的原因。

答案 2 :(得分:1)

cuke4duke项目现在已经不复存在了,请改用Cucumber-JVM: http://cukes.info/install-cucumber-jvm.html