Reputation: 75615
I want to put some 'test' programs into the test folder in my maven project.
These programs (with main()
functions) are not conventional junit tests. They are just bare apps.
How can I execute them?
I can't execute them with mvn exec:java -Dexec=com....test.ClassName
because these test classes do not get bundled into the jar.
And I can't execute them with mvn test -Dtest=com....test.ClassName
because they are not junit tests.
Upvotes: 0
Views: 81
Reputation: 75615
(original poster)
A co-worker worked out that you specify the classpath scope for the exec plugin:
mvn exec:java -Dexec.classpathScope="test" -Dexec.mainClass=com....test.ClassName
Upvotes: 1
Reputation: 9162
What about antrun plugin? Just configure it to be run in the test phase.
Upvotes: 0