Reputation: 6703
I have a large multi module maven project and am using the compiler, surefire and failsafe plugins. All of my unit tests run with surefire, and my integration tests with failsafe. Why running mvn verify
on the whole project, it appears to do the following:
This is a really slow process and I feel like it would be faster if it did the following:
Effectively doing something like:
However I can't figure out how to set this up. Is this possible? Or is my hypothesis that this might be faster off? Thanks for the help.
Upvotes: 1
Views: 1202
Reputation: 240890
You can't do that, consider following structure
A (pom)
|
|
|
|
------B (jar)
| \---C (dependency)
|
|------C (jar)
here B depends on C, now you for example you have following classes in B & C respectively
B
class B{
C c;
public void sayHello(){
c.sayHello();
}
}
C
class C {
public void sayHello(){}
}
now you change C class to
class C {
public void sayHello(String name){}
}
and if you do compile on all phase it will start from A - C - B (dependency graph), C compiled fine (compile just compiles source and copies classes to target/classes), now you are running compile on B it will compile fine because it will take B's older version from local maven cache (where it still has method without any param)
now install happens on C first and on B it will go SUCCESSFUL
next attempts of the same thing will fail, because B will now find different method signature
What would be effective here is incremental build, however maven doesn't quite support incremental build in true sense, see here is the open request for that
if you want just test executions saperate from build life cycle you can do it using separate build profile
Upvotes: 1