Debugging JBehave Scripts

I am having trouble debugging jbehave tests. I cannot get maven to run jbehave tests and stop at a breakpoint. I have this in my pump:

<pluginManagement>
 <plugins>
   <plugin>
     <groupId>org.jbehave</groupId>
     <artifactId>jbehave-maven-plugin</artifactId>
     <version>2.0.1</version>
   </plugin>
 </plugins>
</pluginManagement>
<plugins>
 <plugin>
   <groupId>org.jbehave</groupId>
   <artifactId>jbehave-maven-plugin</artifactId>
   <executions>
     <execution>
       <id>run-scenarios-found</id>
       <phase>test</phase>
       <configuration>
         <scenarioIncludes>
           <scenarioInclude>**/scenario/**/*${test}.java</scenarioInclude>
         </scenarioIncludes>
         <scenarioExcludes>
           <scenarioExclude>**/*Steps.java</scenarioExclude>
         </scenarioExcludes>
       </configuration>
       <goals>
         <goal>run-scenarios</goal>
       </goals>
     </execution>
   </executions>
 </plugin>
</plugins>

and I tried things like:

$  mvn -e -o -Dtest=MyTest -Dmaven.surefire.debug="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8787 -Xnoagent -Djava.compiler=NONE" clean test

and

$ export MVN_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8787 -Xnoagent -Djava.compiler=NONE" ; mvn -Dtest=MyTest clean test 

I can try using jsadebugd , but I will probably require impeccable time for automation, so this sounds like a suboptimal solution, and I feel that the JBehave Maven plugin should provide this functionality. It is clear that I have not yet found the desired fragment of the document. Any ideas how I do this?

+3
source share
3 answers

: export MAVEN_OPTS = "- Xdebug -Xrunjdwp: transport = dt_socket, server = y, suspend = y, address = 8787 -Xnoagent -Djava.compiler = NONE"

mvn: mvn install

(maven , )

Eclipse , , 8787 ( ), .

+1

maven, IDE JUnit? ? , CI maven JBehave, IDE .

0

mvn -e -o -Dmaven.surefire.debug = "- Xdebug -Xrunjdwp: transport = dt_socket, server = y, suspend = y, address = 8787 -Xnoagent -Djava.compiler = NONE" -

This line worked perfectly for me. Set up your Jbehave project in eclipse with a debug port (8787) and quickly connect to the debugger while mvn is waiting to connect to your eclipse project.

-1
source

Source: https://habr.com/ru/post/1706129/


All Articles