Will
Will

Reputation: 75615

Running a Java program from the maven test folder which is not a test

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?

Upvotes: 0

Views: 81

Answers (2)

Will
Will

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

WeMakeSoftware
WeMakeSoftware

Reputation: 9162

What about antrun plugin? Just configure it to be run in the test phase.

Upvotes: 0

Related Questions