Steps class can't depend on a library with <scope>test</scope> in pom.xml
-------------------------------------------------------------------------

                 Key: JBEHAVE-157
                 URL: http://jira.codehaus.org/browse/JBEHAVE-157
             Project: JBehave
          Issue Type: Bug
          Components: Maven Plugin
    Affects Versions: 2.1.1
         Environment: $ mvn -version
Maven version: 2.0.9
Java version: 1.5.0_16
OS name: "mac os x" version: "10.5.6" arch: "i386" Family: "unix"
            Reporter: Binil Thomas
         Attachments: jbehave-bug-report.tar.gz

In my Steps implementation, I use an external library. In my pom.xml, this is 
dependency is declared with <scope>test</scope>. jBehave maven plugin is not 
able to find this library. Please run the attached project as:

$ mvn clean integration-test -Dlib.scope=compile
...
[INFO] Running scenario binil.scenarios.MyScenario
...
[INFO] BUILD SUCCESSFUL
...

$ mvn clean integration-test -Dlib.scope=test   
...
[INFO] [jbehave:run-scenarios {execution: run-scenarios-listed}]
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to instantiate scenario 'binil.scenarios.MyScenario'

Embedded error: The scenario 'binil.scenarios.MyScenario' could not be 
instantiated with class loader: [org.jbehave.scenario.ScenarioClassLoader 
urls=[/Users/binil/work/jbehave-bug-report/target/test-classes/, 
/Users/binil/work/jbehave-bug-report/target/classes]]
org/apache/log4j/Logger
...
$

This forces me to declare the dependency (in my specific case, jetty and 
dbunit) as <scope>compile</scope> in my pom.xml, which means all users of my 
project needs to get this library as a transitive dependency. I would like to 
avoid that.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to