Hi everybody,

maven compiler plugin drives me crazy for the defaut-testCompile...

In a project I am using maven aspectj plugin, my whole source code is
under src/main/aspect and during the compile maven compiler plugin
correclty ignore this directory and compile only src/main/java.....

Now in test-compile phase, compiler plugin discovers the src/test/aspect
and wants to compile that also. This is a feature or bug I don't know
but I know there is possiblity of configuring excludes for the maven
compiler plugins and I did so, but no effect, whatever I do compiler
plugin goes to src/test/aspect and compiles before maven aspectj plugin
the src/test/aspect folder and crash.....

Only hack I can use, is to set -Dmaven.test.skip=true but that is beyond
ugly.....

Does anybody else experienced anything like this and know the solution
for it?

Thx for the answers...

I try this "compileSourceRoots" but it is not working , my guess is that
only exlcudes the things under compileSourceRoots (which has
src/test/aspect)

<plugin>
        
<artifactId>maven-compiler-plugin</artifactId>
                                <configuration>
                                        <source>1.5</source>
                                        <target>1.5</target>
                                        <!--
                                                ensure that the compile
uses the same encoding as the file encoding of the *.java
                                        -->
                                        <compilerArguments>
        
<encoding>utf8</encoding>
                                        </compilerArguments>
                                        <testExcludes>
        
<testExclude>**/aspect/*</testExclude>
                                        </testExcludes>
                                </configuration>                        
                        </plugin>


Telekom Deutschland GmbH 
Aufsichtsrat: Timotheus Hottges (Vorsitzender) 
Geschaftsfuhrung: Niek Jan van Damme (Sprecher), Thomas Berlemann, Thomas 
Dannenfeldt, 
Albert Henn, Dr. Christian P. Illek, Dr. Bruno Jacobfeuerborn 
Handelsregister: Amtsgericht Bonn, HRB 59 19 
Sitz der Gesellschaft: Bonn 
WEEE-Reg.-Nr.: DE60800328

Reply via email to