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