Closed GoogleCodeExporter closed 9 years ago
choose your urls carefully, know your classpath. otherwise scan everything!
(ClasspathHelper.forClassLoader(<noarg>))
Original comment by ronm...@gmail.com
on 20 Feb 2013 at 9:11
Unfortunately, I was not able to scan everything with reflections.
What would the code look like? I only managed to scan by providing the first
part of a package (i.e. "com" or "info").
Original comment by sniffert...@gmail.com
on 20 Feb 2013 at 9:19
just new Reflections() with the trunk snapshot version
than the urls are effectively ClasspathHelper.forClassLoader()
Original comment by ronm...@gmail.com
on 20 Feb 2013 at 9:41
I see. I was using 0.9.8 at the moment.
Is there a simple way to do it with 0.9.8 aswell?
Original comment by sniffert...@gmail.com
on 20 Feb 2013 at 9:43
on 0.9.8 use new Reflections(ClasspathHelper.forClassLoader())
Original comment by ronm...@gmail.com
on 20 Feb 2013 at 9:47
Thank you. This seems to work, but unfortunately, my tests won't run anymore,
as the surfire maven plugin seems to load its classes from somewhere else.
I managed to get it running using
.setUrls(ClasspathHelper.forPackage("", ClasspathHelper.classLoaders()))
Not sure why this works.
Do you have an example of a junit test?
Maybe I should aks there questions somewhere else... Where?
Thanks
Original comment by sniffert...@gmail.com
on 20 Feb 2013 at 10:30
see if any of these helps you
http://code.google.com/p/reflections/issues/list?can=1&q=surefire
Original comment by ronm...@gmail.com
on 20 Feb 2013 at 11:06
Original issue reported on code.google.com by
sergio...@gmail.com
on 16 Oct 2012 at 5:07