Closed michaldo closed 3 years ago
Hello, @michaldo
inject-resources-core
is a dependency of inject-resources-junit-jupiter
. inject-resources-junit-jupiter
can't be used without first one.
Page https://mvnrepository.com/artifact/io.hosuaby/inject-resources-junit-jupiter/0.2.0 shows that there in such dependency
inject-resources-core
is a compileOnly dependency of inject-resources-junit-jupiter
and inject-resources-junit-vintage
. If you use InjectResources for tests, you need two explicit imports, like documentation says:
https://hosuaby.github.io/inject-resources/0.2.0/asciidoc/#inject-resources-junit-jupiter
I made this choice because I think it gives user a more fine grained control over dependencies of project.
inject-resources-core
is a standalone project, that can be used in production code. So user is perfectly able to add inject-resources-core
as compile dependecy to use it in production code, and inject-resources-junit-jupiter
as testCompile dependecy for tests.
InjectResources for Spring is quite diferent. Spring is production dependency, so not need to complicate things here. While used imports inject-resources-spring
it imports automatically inject-resources-core
.
For me inject-resources
is testing utility. I don't need it in production code but in test I often need compare something against expected file and inject-resources
is very handy.
When I have to add two dependencies to use single feature I feel it is a defect.
From client perspective inject-resources-junit-jupiter
is couple of annotations. These annotations are driven by inject-resources-core
. Maybe best way is repackage (shade) classes into private package space, for example com.adelean.jupiter.inject.resources.core
and drive annotations by code which separated from core used in production?
Hm. I will think about this proposition. I will weight pros and cons of this architectural change.
Fixed in 0.3.0
It it is natural that when I add dependendcy to inject-resources-junit-jupiter I also want inject-resources-core.
Nobody wants first lib without second one