Skip to content
This repository has been archived by the owner on May 21, 2019. It is now read-only.

Configure Source Directory #121

Open
bob12321 opened this issue Jul 23, 2011 · 0 comments
Open

Configure Source Directory #121

bob12321 opened this issue Jul 23, 2011 · 0 comments

Comments

@bob12321
Copy link

Hi All,

I am currently using cuke4duke via Maven, and I have a bit of an atypical setup. I want my unit tests to live in src/test/java and have these built and executed at all times when i hit the maven integration-test phase.

If I activate a separate maven profile (-P cucumber), only then do I want the cuke4duke plugin to be referenced. This is vital, not just preventing the execution of cucumber tests without the profile = but preventing maven from trying to resolve the plugin (it's not in my standard repo, so i have to add the extra flag to include the cukes repo).

To prevent maven trying to compile my cuke steps when I am not in the "cucumber" profile, I am keeping my step definitions in src/cukes/java. This is conditionally brought into the compilation if the profile is activated via the following config:

                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>build-helper-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <phase>generate-sources</phase>
                                <goals>
                                    <goal>add-test-source</goal>
                                </goals>
                                <configuration>
                                    <sources>
                                        <source>src/test/cukes</source>
                                    </sources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

I have managed to make this work for me, and the tests are being executed as expected. However, cuke4duke is failing to find the source directory to attach snippets to my test failures; as such I get the following....

Couldn't get snippet for com/bobsmith/randompackage/RandomSteps.java

Is there a way to specify a source directory to cuke4duke to help with this resolution?

Thoughts?

Bobbie.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant