I'd like you to comment following modification I'm planning to do for upcoming SWR 2.0.0 release:
Resolver Maven Plugin
POC hosted at https://github.com/kpiwko/resolver-maven-plugin
This plugin must be configured in projects pom.xml. It will inject 5 system properties into the surefire environment, making SWR able to retrieve essencial information about the Maven build which started the project.
This plugin should become an core part of the resolver.
Note: M2E integration would be nice, meanwhile user will have to set 5 system properties by his own in the IDE
Keeping Maven related methods out of user's reach
Having Resolver Maven Plugin, user should not have directly exposed APIs to access Maven configuration stuff.
This means that following will not be available by default:
- repository(...), repositories(...)
All this information will be transparently set by Resolver Maven Plugin.
Enviroments without Resolver Maven Plugin
It is clear that users trying to run SWR for Ant or different tool will have no Resolver Maven Plugin injection available. These users should have access to the above-mentioned methods, so they can configure Maven environment by themselves.
I think the correct way how to solve that is to create two entry points:
The idea here is that after MavenDependencyResolverWithoutIntegration is configured, is will become a plain MavenDependencyResolverWithIntegration. We will likely have to modify what methods an EntryPoint provides.
1/ Get hibernate-search artifact with transitive dependencies from current pom.xml
This will fail if integration not detected suggesting user either to activate the integration or to use MavenDependencyResolverWithoutIntegration.
2/ Get hibernate-search artifact with transitive dependencies without a pom file
It won't trigger any integration stuff. It will use default configuration, e.g. Maven Central enabled and .m2/settings.xml.
3/ Get hibernate-search artifact with transitive dependencies without integration and a pom file
4/ Get hibernate-search artifact with transitive dependencies using Maven configuration specific stuff:
Access to internals
We should define a way how to let user get information from both Maven model and information retrieved from Resolver Maven Plugin. I like the idea of doing it the ShrinkWrap way, e.g. using some as() method and casting object to a information retriever. Note that this won't be available on MavenDependencyResolverWithoutIntegration for an obvious reason.
Now the most confusing part. We should consider renaming of the methods and classes
I haven't found proper naming yet but definitely we need something much much shorther.