________________________________
From: Thorsten Schöning <[email protected]>
Sent: Tuesday, September 5, 2017 5:12 AM
To: [email protected]
Subject: [AXIS2] Some project builds fail if goal "clean" is not used
Hi all,
I'm facing the problem that when I execute goals like "install" or
"test" without "clean" the build of some projects fail, the problem
seems to be with an existing or not "target" dir and it looks like
that because of that the build of some projects "thinks" it doesn't
need to compile classes etc. Which would be fine if it wouldn't delete
the formerly created classes itself without re-creating them! :-)
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
"clean" deletes the whole "target" dir, so a fresh new build is
executed. Without "clean", pre-compiled classes in
"target/test-classes" are deleted, but not re-created for some reason,
resulting in error messages like the following:
> [ERROR] Failed to execute goal
> org.apache.maven.plugins:maven-compiler-plugin:3.5.1:testCompile
> (default-testCompile) on project axis2-metadata: Compilation failure:
> Compilation failure:
> [ERROR] /C:/Users/tschoening/Documents/Eclipse/Java
> Axis2/axis2/modules/metadata/test/org/apache/axis2/jaxws/description/DocLitWrappedImplWithSEI.java:[23,36]
> package org.test.proxy.doclitwrapped does not exist
Classes of "org.test.proxy.doclitwrapped" were available in the last
successful build and have been deleted, but no re-created. the
interesting thing as well is that really only the Java classes
themselfs have been deleted, the corresponding parent dir already
exists:
> C:\Users\tschoening\Documents\Eclipse\Java
> Axis2\axis2\modules\metadata\target\test-classes\org\test\proxy\doclitwrapped
I have that problem with various projects and it was driving me crazy,
because things like "Debug as/Maven test" etc. per project directly
from Eclipse were not working and such. I really need to always
execute "clean" in addition to the other goals to be sure a build
works.
Is that intended or some kind of build issue? Shouldn't "mvn install"
not only delete pre-compiled test classes, but also be able to create
them again?
MG>the built-in maven-compiler-plugin (the default of compile phase) compile
*default* is not full but incremental compile
MG>of special note is the lastModGranularityMs parameter which you can set in
maven-compiler-plugin configuration
/**
* Sets the granularity in milliseconds of the last modification
* date for testing whether a source needs recompilation.
*/
@Parameter( property = "lastModGranularityMs", defaultValue = "0" )
private int staleMillis;
MG>https://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html
Apache Maven Compiler Plugin –
compiler:compile<https://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html>
maven.apache.org
Classpath elements to supply as annotation processor path. If specified, the
compiler will detect annotation processors only in those classpath elements. If
omitted ...
MG>to avoid that heartache when implementing maven-compiler-plugin i always set
useIncrementalCompilation<https://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#useIncrementalCompilation>
= false e.g.
MG><groupId>org.apache.maven.plugins</groupId>
MG><artifactId>maven-compiler-plugin</artifactId>
<configuration>
<useIncrementalCompilation>false</useIncrementalCompilation>
Mit freundlichen Grüßen,
Thorsten Schöning
MG>gruss
MG>Martin
--
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]