2017-02-10 4 views
0

Когда я запускаю свой тестовый проект, отчеты генерируются в целевом каталоге/jbehave/view, как ожидалось.Ресурсы JBehave не найдены в отчетах

Моя проблема заключается в том, что таблицы стилей не нашли ... В целевом каталоге/JBehave/вид/стиль у меня есть CSS jbehave.css но отчеты генерируются поиска JBehave-core.css

Я надеваю «т знаю, если у меня есть некоторые версии проблемы или что-то еще ...

Вот зависимостей, которые я использую в моей pom.xml:

<dependencies> 
... 
    <dependency> 
     <groupId>org.jbehave</groupId> 
     <artifactId>jbehave-core</artifactId> 
     <version>${jbehave.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>org.jbehave</groupId> 
     <artifactId>jbehave-spring</artifactId> 
     <version>${jbehave.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>org.jbehave</groupId> 
     <artifactId>jbehave-gherkin</artifactId> 
     <version>${jbehave.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>org.jbehave.site</groupId> 
     <artifactId>jbehave-site-resources</artifactId> 
     <version>3.3</version> 
     <type>zip</type> 
    </dependency> 
... 
</dependencies> 
<build> 
    <plugins> 
     ... 
     <plugin> 
     <groupId>org.jbehave</groupId> 
     <artifactId>jbehave-maven-plugin</artifactId> 
     <version>${jbehave.version}</version> 
     <executions> 
      <execution> 
      <id>unpack-view-resources</id> 
      <phase>process-resources</phase> 
      <goals> 
       <goal>unpack-view-resources</goal> 
      </goals> 
      </execution> 
     </executions> 
     </plugin> 
    </plugins> 
    </build> 

с $ {jbehave.version} = 4.1

Для конфигурации JBehave я использую этот класс:

ответ

0

И, наконец, я заработал.

Проблема возникла из-за помпы.

Вот один работает для меня:

<dependencies> 
    ... 
    <dependency> 
    <groupId>org.jbehave</groupId> 
    <artifactId>jbehave-core</artifactId> 
    <version>${jbehave.version}</version> 
    <scope>test</scope> 
    </dependency> 
    <dependency> 
    <groupId>org.jbehave</groupId> 
    <artifactId>jbehave-spring</artifactId> 
    <version>${jbehave.version}</version> 
    <scope>test</scope> 
    </dependency> 
    <dependency> 
    <groupId>org.jbehave</groupId> 
    <artifactId>jbehave-gherkin</artifactId> 
    <version>${jbehave.version}</version> 
    <scope>test</scope> 
    </dependency> 
    ... 
</dependencies> 


<build> 
    <plugins> 
     ... 
     <plugin> 
     <groupId>org.jbehave</groupId> 
     <artifactId>jbehave-maven-plugin</artifactId> 
     <version>${jbehave.version}</version> 
     <executions> 
      <execution> 
      <id>run-stories-as-embeddables</id> 
      <phase>integration-test</phase> 
      <configuration> 
       <includes> 
       <include>**/*Scenarios.java</include> 
       </includes> 
       <ignoreFailureInStories>true</ignoreFailureInStories> 
       <ignoreFailureInView>false</ignoreFailureInView> 
      </configuration> 
      <goals> 
       <goal>run-stories-as-embeddables</goal> 
      </goals> 
      </execution> 
     </executions> 
     </plugin> 

     <plugin> 
     <groupId>org.apache.maven.plugins</groupId> 
     <artifactId>maven-dependency-plugin</artifactId> 
     <executions> 
      <execution> 
      <id>unpack-jbehave-site-resources</id> 
      <phase>generate-resources</phase> 
      <goals> 
       <goal>unpack</goal> 
      </goals> 
      <configuration> 
       <overwriteReleases>false</overwriteReleases> 
       <overwriteSnapshots>true</overwriteSnapshots> 
       <artifactItems> 
       <artifactItem> 
        <groupId>org.jbehave.site</groupId> 
        <artifactId>jbehave-site-resources</artifactId> 
        <version>3.3</version> 
        <type>zip</type> 
        <outputDirectory>${project.build.directory}/jbehave/view</outputDirectory> 
       </artifactItem> 
       </artifactItems> 
      </configuration> 
      </execution> 
      <execution> 
      <id>unpack-jbehave-reports-resources</id> 
      <phase>generate-resources</phase> 
      <goals> 
       <goal>unpack</goal> 
      </goals> 
      <configuration> 
       <overwriteReleases>false</overwriteReleases> 
       <overwriteSnapshots>true</overwriteSnapshots> 
       <artifactItems> 
       <artifactItem> 
        <groupId>org.jbehave</groupId> 
        <artifactId>jbehave-core</artifactId> 
        <version>${jbehave.version}</version> 
        <outputDirectory>${project.build.directory}/jbehave/view</outputDirectory> 
        <includes>**\/*.css,**\/*.ftl,**\/*.js</includes> 
       </artifactItem> 
       </artifactItems> 
      </configuration> 
      </execution> 
     </executions> 
     </plugin> 
     ... 
    </plugins> 
    </build> 
Смежные вопросы