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 do I run the examples? #372

Closed
daveyarwood opened this issue Oct 17, 2016 · 3 comments
Closed

How do I run the examples? #372

daveyarwood opened this issue Oct 17, 2016 · 3 comments

Comments

@daveyarwood
Copy link
Contributor

daveyarwood commented Oct 17, 2016

As someone who wants to contribute, but hasn't used mvn much, I am struggling to figure out how to run the examples to test my changes before sending a PR.

I tried using the exec-maven plugin, but I kept getting errors about the example class ("interrupt" in my case) not being found on the classpath. There must be some configuration step I am missing.

This is something that it would be nice to document, and I'll be happy to submit a PR to add documentation, if someone wouldn't mind explaining it to me.

@colini
Copy link

colini commented Nov 28, 2016

Since the examples are in the test tree, you have to specify the test scope when running them with the exec plugin. Once you add the exec plugin to the pom, you can run the example classes with:

mvn exec:java -Dexec.mainClass=guide.suisnail -Dexec.classpathScope=test

That should work for any example class that includes a main() method. Not all of them do.

@daveyarwood
Copy link
Contributor Author

I tried this and it worked! Thanks!

I'm thinking about adding some Development information to the README (or perhaps a CONTRIBUTING.md) to make it easier for contributors to know how to do this.

@daveyarwood
Copy link
Contributor Author

Action needed: CONTRIBUTING.md

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