java - Cucumber 0.4.3 (cuke4duke) 与 java + maven gem 问题

标签 java cucumber jruby

我最近开始为 cucumber 安装一个示例项目,并尝试使用 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 "all the libs in trace"org.Main gem install cuke4duke .... (请参阅跟踪以获取完整命令),但这不起作用。为了安装 gems,我使用了 JRuby 安装程序并执行了相同的命令,效果很好。

用java在windows上运行cucumber怎么这么难。我尝试了几种变体,但不知道下一步该怎么做。

这是我运行 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

在我自己安装 gems 之前,我收到此错误,请注意它说 gems 无法识别命令

PasteBin StackTrace (太长了,无法在一篇文章中同时包含这两种痕迹)

我也尝试过多次卸载 JRuby 和 gems,并允许 maven 安装 gem,但它不起作用。

最佳答案

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

关于java - Cucumber 0.4.3 (cuke4duke) 与 java + maven gem 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5017628/

相关文章:

java - 本地Eclipse中的Apache Nutch 1.9可在Amazon EMR上远程运行

java - 帮助设置 Java 构建环境

java - 序列化@JsonIgnore-d字段

selenium - 如何将Sikuli集成到项目中来运行build.gradle?

spring-boot - Spring Cucumber ActiveProfiles 注释不适用于 CucumberContext

ruby-on-rails - 朱比 :- Unable to install devise on windows using jruby

java - JRuby on Rails : Using custom Java classes in your Rails app

java - 'Unsupported major.minor version 52.0' 是什么意思,我该如何解决?

ruby-on-rails - cucumber Textmate 突出显示

rspec - JRuby: nil != nil: 即使数组相同,RSpec 测试也会失败