Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I put all dependent jar packages into one directory and execute them together? #3412

Closed
Danst-bjtu opened this issue Aug 4, 2023 · 1 comment

Comments

@Danst-bjtu
Copy link

Danst-bjtu commented Aug 4, 2023

When the test I want to execute requires the introduction of multiple dependent jar packages, the command line must write - cp multiple times, which is too long. How can I put all dependent jar packages into one directory and execute them together?

java -jar junit-platform-console-standalone-1.9.3.jar -cp test -cp .\commons-3.31.0.jar -cp .\abc-engine-0.1.0.jar -cp .\abc-formula-0.1.0.jar -cp .\antlr-runtime-3.2.jar --scan-classpath --reports-dir=.\

image

When I put all jar packages in one directory, such as testlib, it will appear that the class cannot be found.
java -jar junit-platform-console-standalone-1.9.3.jar -cp test -cp testlib --scan-classpath --reports-dir=.
image

@sbrannen
Copy link
Member

sbrannen commented Aug 5, 2023

Please read the User Guide before posting questions.

This is documented in the Console Launcher section:

You can also run the standalone ConsoleLauncher as shown below (for example, to include all jars in a directory):

$ java -cp classes:testlib/* org.junit.platform.console.ConsoleLauncher <OPTIONS>

@sbrannen sbrannen closed this as not planned Won't fix, can't repro, duplicate, stale Aug 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants