How to disable unnecessary phases in the default life cycle of Maven 3?
Disable, I mean completely, completely cut the phase out of the life cycle, so that it is not even called.
I might need a custom life cycle, but I could not find an easy way to define it directly in my pom.xml . It seems I need to write a plugin to list the phases that I want.
For example, I would like the phases default-testResources , default-testCompile and default-test never happen and not include my build log from this:
[INFO] ------------------------------------------------------------------------ [INFO] Building HelpDesk Webapp 0.0.1-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ helpdesk --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory d:\proj\HelpDesk\repo\src\main\resources [INFO] [INFO] --- maven-compiler-plugin:3.0:compile (default-compile) @ helpdesk --- [INFO] No sources to compile [INFO] [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ helpdesk --- [INFO] Not copying test resources [INFO] [INFO] --- maven-compiler-plugin:3.0:testCompile (default-testCompile) @ helpdesk --- [INFO] Not compiling test sources [INFO] [INFO] --- maven-surefire-plugin:2.10:test (default-test) @ helpdesk --- [INFO] Tests are skipped. [INFO] [INFO] --- maven-war-plugin:2.3:war (default-war) @ helpdesk --- [INFO] Packaging webapp [INFO] Assembling webapp [helpdesk] in [d:\proj\HelpDesk\repo\target\helpdesk] [INFO] Processing war project [INFO] Copying webapp resources [d:\proj\HelpDesk\repo\src\main\webapp] [INFO] Webapp assembled in [40 msecs] [INFO] Building war: d:\proj\HelpDesk\repo\target\helpdesk.war [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------
in it:
[INFO] ------------------------------------------------------------------------ [INFO] Building HelpDesk Webapp 0.0.1-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ helpdesk --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory d:\proj\HelpDesk\repo\src\main\resources [INFO] [INFO] --- maven-compiler-plugin:3.0:compile (default-compile) @ helpdesk --- [INFO] No sources to compile [INFO] [INFO] --- maven-war-plugin:2.3:war (default-war) @ helpdesk --- [INFO] Packaging webapp [INFO] Assembling webapp [helpdesk] in [d:\proj\HelpDesk\repo\target\helpdesk] [INFO] Processing war project [INFO] Copying webapp resources [d:\proj\HelpDesk\repo\src\main\webapp] [INFO] Webapp assembled in [40 msecs] [INFO] Building war: d:\proj\HelpDesk\repo\target\helpdesk.war [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------
maven maven-3
Alex Mar 06 '13 at 14:02 2013-03-06 14:02
source share