问题
I have the following dependency declaration in BuildConfig.groovy
:
plugins {
test ':build-test-data:2.2.1'
test ':fixtures:1.3'
}
I've already run refresh-dependencies
on both the terminal, and my IDE (Eclipse) but every time I run the test I get:
grails.plugin.fixtures.exception.FixtureException: build feature is unavailable as build-test-data plugin is not installed
at grails.plugin.fixtures.builder.FixtureBuilder.assertBuildTestDataPluginInstalledIfNeeded(FixtureBuilder.groovy:135)
at grails.plugin.fixtures.builder.FixtureBuilder.beans(FixtureBuilder.groovy:104)
at grails.plugin.fixtures.builder.FixtureBuilder.build(FixtureBuilder.groovy:82)
at grails.plugin.fixtures.Fixture.build(Fixture.groovy:48)
at grails.plugin.fixtures.FixtureLoader.build(FixtureLoader.groovy:54)
I checked the FixtureBuilder code, and found the following line:
Holders.pluginManager.hasGrailsPlugin('build-test-data')
I created a separate test to check what this line returns, but no matter what plugin (declared in BuildConfig.groovy
) I replace 'build-test-data'
with, it always returns false
.
How do I fix this?
回答1:
In BuildConfig
there are four possible options to configure a plugin:
- build
- compile
- runtime
- test
Fixture
and Build
plugins are configured to be use in test
you should to change it to runtime
to use them in BootStrap
when running the app.
来源:https://stackoverflow.com/questions/26112132/grails-fixture-plugin-keeps-saying-build-test-data-plugin-is-not-installed