What is difference between <scope> and <phase> in maven plugin (jbehave example)

StackOverflow https://stackoverflow.com/questions/18809823

  •  28-06-2022
  •  | 
  •  

質問

As in title - here is piece of code.

I can have < scope > as well as < phase >

Jbehave documentation doesn't say much about it (http://jbehave.org/reference/stable/maven-goals.html)

               <execution>
                    <id>run-stories</id>
                    <phase>test</phase>
                    <configuration>
                        <!--<scope>test</scope>-->
                        <includes>
                            <include>**/*Stories*.java</include>
                        </includes>
                    </configuration>
                    <goals>
                        <goal>run-stories-as-embeddables</goal>
                    </goals>
                </execution>
役に立ちましたか?

解決

The <phase/> element/property is a "standard" Maven property that indicates which phase of the Maven lifecycle the execution will occur in.

The <scope/> element/property you're referring to is specific to the JBehave plugin itself. Per the plugin's documentation, it seems that <scope/> is used to control which "set" of your project's Maven dependencies will be included in the JBehave plugin run. Per this answer on the JBehave site, it seems that, typically, JBehave is executed using only the project's main dependencies and code, not the test dependencies and code.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top