Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to exclude unit tests from the WAR in with Google App Engine plugin?

I am using the Google Application Engine plugin for Eclipse 3.4, and I have added unit tests in my projects. The unit tests are in a source folder named tests, separated from the source folder src. But, in the war/classes that is generated, the tests classes are present.

Is there anyway not to put test classes in the generated war/classes directory?

Thanks.

like image 829
tofcoder Avatar asked Mar 25 '10 08:03

tofcoder


1 Answers

I usually tend to solve these issues with maven, since it really plays well with eclipse using m2eclipse, for instance.

However, without relying upon the red army of build process managers, here is a possible hint : Go in your project properties, and in "java build path" open the "source" tab. in this tab, you can either have one output folder for all source folders, or one output folder for each source folder. So, check "Allow output folders for source folders", thend efine one output folder for your src/main/java, say .... war/classes, then define one output folder for your src/main/test folder, say test/classes. This way, your classes and test classes won't be in the same output.

EDIT : added some maven infos

I however strongly suggests you to use maven build instead of pure IDE ones, since they reveal to be far more robust. I think my friends at dooapp have some infos about that point. Anyway I know there are infos available to build a GAE application using maven.

like image 50
Riduidel Avatar answered Sep 29 '22 11:09

Riduidel