Question

I'm doing project with JBehave and want my reports to be pretty. Here I've read that I can use the unpack-view-resources goal. The problem is following: I use IntelliJ Idea and I used File->Project Structure->Libraries to add the project From Maven. So, I have .jar files but don't have access to pol.xml (I don't see this file at all).

Where I should create it? Or how I have to setup JBehave to have an ability to use pol.xml for view resources unpacking?

Maybe there is another solution for this problem, or download all .css and .js files by myself is the only way in my case?

SOLUTION:

I only had to right mouse click on the project name (the root folder) and choose "Add Framework Support...". Than I have a pom.xml file.

I used this example, so it looks like:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>myGroup</groupId>
    <artifactId>myArtifact</artifactId>
    <version>1.0-SNAPSHOT</version>

    <dependencies>
        <dependency>
            <groupId>org.jbehave</groupId>
            <artifactId>jbehave-core</artifactId>
            <version>3.8</version>
            <classifier>resources</classifier>
            <type>zip</type>
        </dependency>
        <dependency>
            <groupId>org.jbehave.site</groupId>
            <artifactId>jbehave-site-resources</artifactId>
            <version>3.1.1</version>
            <type>zip</type>
        </dependency>
        <dependency>
            <groupId>org.jbehave</groupId>
            <artifactId>jbehave-core</artifactId>
            <version>3.8</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.jbehave</groupId>
                <artifactId>jbehave-maven-plugin</artifactId>
                <version>3.8</version>
                <executions>
                    <execution>
                        <id>unpack-view-resources</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>unpack-view-resources</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>

Than I use Maven panel (on the right of the IntelliJ window, as Engineer Dollery said) called "Maven Projects" and see there my project. I expand it, there I see Lifecycle and expand it too, than I choose "install" and click "run" (green arrow on the top of the panel) and I have all needed files unpacked.

Was it helpful?

Solution

First, You shouldn't be adding libraries to the project manually -- that's what maven is for, so start by deleting the one's you've added. The maven panel, usually on the right of the intellij window should have a tree that can expand to show Lifecycle and Plugins -- it is here that you should find the maven goal you describe. If not, you can run any maven goal through editing run configurations from the toolbar, adding a new maven run config and stating your goals there.

Good luck and let us know how it goes.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top