Closed davidfra closed 7 years ago
// A little hack to work around issue:
def osgiDsTask = project.generateDeclarativeServicesDescriptors
java.lang.reflect.Field field = osgiDsTask.getClass().getSuperclass().getDeclaredField('input')
field.setAccessible(true)
List osgiDsInputs = field.get(osgiDsTask)
osgiDsInputs.clear()
osgiDsInputs.add(sourceSets.main.output)
field.setAccessible(false)
The plugin processes files from all compile tasks. This includes Test classes. This is because of this code block:
In my test cases I have a dependency to easymock which is declared as a
testCompile
dependency. This dependency is not added to theorg.apache.felix.scrplugin.Project
as the plugin only adds compile dependencies.So I get this exception
This only happens when I call build (including tests), not when calling assemble (not including tests).
In my opinion, the best way would be to exclude test classes from the processing. Or let the user of the plugin configure which classes to add to the scanning.
For example: