https://pantsbuild.org/ logo
#general
Title
# general
m

melodic-optician-41260

07/20/2020, 11:25 AM
Hi guys, how can I list everything on the classpath for a given build target?
f

fancy-queen-20734

07/20/2020, 6:34 PM
if you want targets, ./pants dependencies is close. If you want something like the actual jars, you can build a bundle and inspect it, or run
./pants export-classpath
and look at
dist/export-classpath
If you're wondering what a test uses, you can use
./pants server
then navigate to the run for junit and inspect the manifest jar which will have some hash in its name
@melodic-optician-41260 hope ^^ helps
m

melodic-optician-41260

07/21/2020, 1:31 PM
Thank you so much @fancy-queen-20734 I am indeed running tests, but i”m not exactly sure how to use the
./pants server
. I’ve started the server by running
./pants server path/to/target:my-test
and I can navigate it on localhost, but how do I navigate to the run folder for junit?
f

fancy-queen-20734

07/21/2020, 5:13 PM
pants server lists each previous pants run. If you click on a particular one, you can inspect its run. You can look at each individual part of the run by clicking on the triangles. I think there's one called [cmd] underneath [junit] that should list the command junit was run with. In that there's
-cp .....some.jar
, you should be able to click on that and see the jar's manifest--that's a fairly awkward way to investigate it though.
export-classpath is a lot more straightforward
2 Views