________________________________
From: Thorsten Schöning <[email protected]>
Sent: Saturday, September 9, 2017 9:27 AM
To: Martin Gainty
Subject: Re: [AXIS2] Some project builds fail if goal "clean" is not used
Guten Tag Martin Gainty,
am Samstag, 9. September 2017 um 13:36 schrieben Sie:
MG>>maven-compiler-plugin (with incremental) overwrites most recent changed
classes inside target\classes and target\test-classes
MG>>maven-compiler-plugin (full compile) compiles and overwrites ALL classes
(changed or not)
MG>>as you have already discovered default behaviour for mvn clean is to
delete ALL classes in target\classes and target\test-classes
You are getting it wrong: The problem is e.g. "mvn test" without(!)
"clean". In that case there is something which deletes totally
unchanged, formerly successfully compiled classes and only the class
files itself, not the parent directory or any other directory. And
that is bad because some builds depend on formerly
compiled/packaged/whatever results and those are not available anymore
sometimes, because they has been deleted.
MG>which version surefire are you implementing?
MG>what is your surefire tempDir parameter set to?
MG>if you are setting tempDir to either target\classes or target\test-classes
then surefire will surely eliminate that directory
MG>what is reportsDirectory set to
MG>if you are setting reportsDirectory to either target\classes or
target\tests-classes then surefire will overwrite those contents at will
MG>what is testSourceDirectory set to?
MG>what is classesDirectory set to ?
MG>also surefire assumes $maven.project.base.directory/cwd_1 belongs to
surefire and will delete that directory at will
MG>we need to stop spott talk and narrow down your surefire TestCase
implementors which is one of
* TestNG
* JUnit (3.8 or 4.x)
* POJO
MG>an excellent surefire debugging tool is the directive
MG>redirectTestOutputToFile
MG>what i would do
MG>mvn compile
MG>set read-only attribute to the folder(s) you want to keep and run your test
again e.g.
MG>mvn test --projects :axis2-metadata
MG>observe exception thrown by maven-surefire-plugin...what does it say?
Adding "clean" fixes that, because a complete rebuild is issued, but
that shouldn't be needed if I don't change things. Let me quote
myself:
> One example is with axis-metadata, were the following command fails
> after a former successful build:
>
> > mvn test --projects :axis2-metadata
>
> While the following one succeeds:
>
> > mvn clean test --projects :axis2-metadata
>From my understanding, "mvn test ..." only shouldn't fail after a
successful former build, but it does. Instead it should simply execute
tests again, which it is doing, but it fails for some tests because
some of those depend on compiled Java classes which are not available
anymore.
So the question only is if "mvn test ..." should have deleted those
files or not.
Mit freundlichen Grüßen,
Thorsten Schöning
--
Thorsten Schöning E-Mail: [email protected]
AM-SoFT IT-Systeme http://www.AM-SoFT.de/
Webpräsenz AM-SoFT IT-Systeme GmbH - Startseite<http://www.am-soft.de/>
www.am-soft.de
AM-SoFT IT-Systeme „Neue Wege entstehen, indem wir sie gehen!“ AM-SoFT GmbH
IT-Systeme, 1989 in Hameln gegründet, ist EDV-Systemhaus,
Internet-Service-Provider ...
Telefon...........05151- 9468- 55
Fax...............05151- 9468- 88
Mobil..............0178-8 9468- 04
AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]