1

I have a lot of student's code to test, and their code is structured like this:

Project_Dir -> src -> edu -> collegeName-> courseName -> assignmentName -> (their classes here)

and for tests:

Project_Dir -> src -> edu -> collegeName-> courseName -> assignmentName -> tests -> (their tests here)

You'll notice that this does not follow the typical convention of:

${basedir}/src/main/java

and

${basedir}/src/test

When I try to test their code with maven test, it can't find any of their code (sourcecode or tests)

Is there some commandline argument I can use to tell maven to look in the correct place for their source code and tests? Or is there some way of dropping in a modified POM file to tell maven the same thing?

Memnarch1113
  • 99
  • 1
  • 8
  • https://maven.apache.org/guides/mini/guide-using-one-source-directory.html – Naman Mar 06 '17 at 02:52
  • 1
    You should follow the default naming conventions and folder layout which should be teached to the students. Otherwise you will coming up with things like this which makes your life harded than necessary... – khmarbaise Mar 06 '17 at 09:22

1 Answers1

0

What if you want to choose a couple of test file to run from the command line. Try

mvn '-Dtest=yourpackage.*' test

And this question already have a answer here.

Community
  • 1
  • 1
Se ven
  • 377
  • 2
  • 11