Path: csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!newsfeed.straub-nv.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Cecil Westerhof Newsgroups: comp.lang.java.programmer Subject: Re: Working with maven Date: Fri, 24 Jul 2015 16:34:33 +0200 Organization: Decebal Computing Lines: 42 Message-ID: <877fppoc92.fsf@Equus.decebal.nl> References: <87mvyonz6a.fsf@Equus.decebal.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: mx02.eternal-september.org; posting-host="528adfd6ad074c92fdc6a7f8fb9e23d8"; logging-data="25272"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+JLsCQ9ZLH0KhlfRrKXHdd689XM3ws6P8=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:5Ruj3/cR1lrEhr5d/MVjFRj59XU= sha1:4IaoR/Zd7A/YuPpz3lE/FYbjXSo= X-Homepage: http://www.decebal.nl/ Xref: csiph.com comp.lang.java.programmer:32114 On Wednesday 22 Jul 2015 14:40 CEST, Cecil Westerhof wrote: > I started working on a project where maven is used. > > It is a project with several sub-directories. > In the root I can just run: mvn install. > A side effect is that the tests are run. > To run only the tests, I would expect I just need to run: mvn test. > But then no tests are run and I get: BUILD ERROR. > When going to a sub-directory ‘mvn test’ does work. (For that > directory.) > What could be the problem? As I understood it, it is because the pom uses an old structure with several projects in it. This is still with Maven 2.2.1. (A company decision, not my decision.) But we found a way around it. When using: mvn surefire:test everything is tested. The pom-file is going to be reorganised and until then I can live with this. > Also when I only want to run a certain test set, I go to the > directory ‘firstSet’ and run: mvn test -Dtest=SoloTest. I would like > tor run only this test set without the need to go into the > directory, but stay in the projects root directory. is this > possible? I can use: mvn -pl project test to test a complete project from the root directory. And when I use: mvn -pl project test -Dtest=SoloTest only this test set is run. -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof