Maven dependency tree for parent pom with multiple profiles - maven

I am having a nested multi module maven project as below.
The parent pom specifies the profiles to build various component.
Now I need to get the list of all dependencies of all component which I believe that I can get from dependency tree of eclipse ide. But it is not getting displayed. Is there any other way to get the list or I am trying a wrong thing.

Use the maven dependency plugin along with a profile in the normal way.
mvn dependency:tree -Pjava8
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] parent [pom]
[INFO] project-mod-1 [pom]
[INFO] java8 [jar]
[INFO] java7 [jar]
[INFO]
[INFO] --------------------------< com.greg:parent >---------------------------
[INFO] Building parent 1.0-SNAPSHOT [1/4]
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) # parent ---
[INFO] com.greg:parent:pom:1.0-SNAPSHOT
[INFO]
[INFO] -----------------------< com.greg:project-mod-1 >-----------------------
[INFO] Building project-mod-1 1.0-SNAPSHOT [2/4]
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) # project-mod-1 ---
[INFO] com.greg:project-mod-1:pom:1.0-SNAPSHOT
[INFO]
[INFO] ---------------------------< com.greg:java8 >---------------------------
[INFO] Building java8 1.0-SNAPSHOT [3/4]
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) # java8 ---
[INFO] com.greg:java8:jar:1.0-SNAPSHOT
[INFO] \- junit:junit:jar:4.11:test
[INFO] \- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO]
[INFO] ---------------------------< com.greg:java7 >---------------------------
[INFO] Building java7 1.0-SNAPSHOT [4/4]
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) # java7 ---
[INFO] com.greg:java7:jar:1.0-SNAPSHOT
[INFO] \- junit:junit:jar:4.11:test
[INFO] \- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for parent 1.0-SNAPSHOT:
[INFO]
[INFO] parent ............................................. SUCCESS [ 2.262 s]
[INFO] project-mod-1 ...................................... SUCCESS [ 0.015 s]
[INFO] java8 .............................................. SUCCESS [ 0.111 s]
[INFO] java7 .............................................. SUCCESS [ 0.250 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.169 s
[INFO] Finished at: 2019-03-20T08:18:24Z
[INFO] ------------------------------------------------------------------------

Related

Maven doesn't build -runner.jar

I have generated a new project with the archetype and I have run the following maven
./mvnw -Dskiptests clean package
It should build two jar files xxx.jar and xx-runner.jar but it only build one (xxx.jar).
I have configured JAVA_HOME and GRAALVM_HOME pointing to the GraalVM that I have downloaded.
I have installed the Native Image.
My OS is UBUNTU
Maven should build the two JAR files but I don't why. Could someone help me.
[INFO] Scanning for projects...
[INFO]
[INFO] ----------------< es.olivar.jaen:atomic-fruit-service >-----------------
[INFO] Building atomic-fruit-service 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # atomic-fruit-service ---
[INFO] Deleting /home/sobremesa/Documents/Develop/java/quarkus/poc/atomic-fruit-service/target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # atomic-fruit-service ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO]
[INFO] --- quarkus-maven-plugin:2.11.3.Final:generate-code (default) # atomic-fruit-service ---
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) # atomic-fruit-service ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /home/sobremesa/Documents/Develop/java/quarkus/poc/atomic-fruit-service/target/classes
[INFO]
[INFO] --- quarkus-maven-plugin:2.11.3.Final:generate-code-tests (default) # atomic-fruit-service ---
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # atomic-fruit-service ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/sobremesa/Documents/Develop/java/quarkus/poc/atomic-fruit-service/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) # atomic-fruit-service ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to /home/sobremesa/Documents/Develop/java/quarkus/poc/atomic-fruit-service/target/test-classes
[INFO]
[INFO] --- maven-surefire-plugin:3.0.0-M7:test (default-test) # atomic-fruit-service ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) # atomic-fruit-service ---
[INFO] Building jar: /home/sobremesa/Documents/Develop/java/quarkus/poc/atomic-fruit-service/target/atomic-fruit-service-1.0-SNAPSHOT.jar
[INFO]
[INFO] --- quarkus-maven-plugin:2.11.3.Final:build (default) # atomic-fruit-service ---
[INFO] [io.quarkus.deployment.QuarkusAugmentor] Quarkus augmentation completed in 1475ms
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.615 s
[INFO] Finished at: 2022-08-29T23:38:29+02:00
Thank very much indeed.
The output jar is target/quarkus-app/quarkus-run.jar

Maven module has different versions of the same library

Good day!
I have maven multimodule project. Contains war,jar and ear modules. When I try to start local Tomcat (web module exploded), got the following error:
Possible root causes include a too low setting for -Xss and illegal
cyclic inheritance dependencies. The class hierarchy being processed
was
[org.bouncycastle.asn1.ASN1EncodableVector->org.bouncycastle.asn1.DEREncodableVector->org.bouncycastle.asn1.ASN1EncodableVector]
I have read this question Avoid cyclic reference inheritance in grails
and found two version of jar: org.bouncycastle:bcprov-jdk15on:jar and org.bouncycastle:bcprov-jdk14:jar
but still cannot understand how to solve the issue..
Thank you in advance!
tor for org.codehaus.mojo:gwt-maven-plugin:jar:${gwt.version}
[INFO]
[INFO] --- maven-dependency-plugin:2.4:tree (default-cli) # desktop-app ---
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building arm-data-entry 1.0.30-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] Failed to retrieve plugin descriptor for org.codehaus.mojo:gwt-maven-plugin:${gwt.version}: Plugin org.codehau
s.mojo:gwt-maven-plugin:${gwt.version} or one of its dependencies could not be resolved: Failed to read artifact descrip
tor for org.codehaus.mojo:gwt-maven-plugin:jar:${gwt.version}
[INFO]
[INFO] --- maven-dependency-plugin:2.4:tree (default-cli) # arm-data-entry ---
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building sea-print 1.0.30-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] Failed to retrieve plugin descriptor for org.codehaus.mojo:gwt-maven-plugin:${gwt.version}: Plugin org.codehau
s.mojo:gwt-maven-plugin:${gwt.version} or one of its dependencies could not be resolved: Failed to read artifact descrip
tor for org.codehaus.mojo:gwt-maven-plugin:jar:${gwt.version}
[INFO]
[INFO] --- maven-dependency-plugin:2.4:tree (default-cli) # sea-print ---
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building setup-docs 1.0.30-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] Failed to retrieve plugin descriptor for org.codehaus.mojo:gwt-maven-plugin:${gwt.version}: Plugin org.codehau
s.mojo:gwt-maven-plugin:${gwt.version} or one of its dependencies could not be resolved: Failed to read artifact descrip
tor for org.codehaus.mojo:gwt-maven-plugin:jar:${gwt.version}
[INFO]
[INFO] --- maven-dependency-plugin:2.4:tree (default-cli) # setup-docs ---
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building pdf-cuter 1.0.30-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] Failed to retrieve plugin descriptor for org.codehaus.mojo:gwt-maven-plugin:${gwt.version}: Plugin org.codehau
s.mojo:gwt-maven-plugin:${gwt.version} or one of its dependencies could not be resolved: Failed to read artifact descrip
tor for org.codehaus.mojo:gwt-maven-plugin:jar:${gwt.version}
[INFO]
[INFO] --- maven-dependency-plugin:2.4:tree (default-cli) # pdf-cuter ---
[INFO] ru.my-company.ea.old:pdf-cuter:jar:1.0.30-SNAPSHOT
[INFO] \- org.icepdf.os:icepdf-core:jar:6.1.2:compile
[INFO] +- org.bouncycastle:bcprov-jdk15on:jar:1.54:compile
[INFO] +- org.bouncycastle:bcprov-ext-jdk15on:jar:1.54:compile
[INFO] \- org.bouncycastle:bcpkix-jdk15on:jar:1.54:compile
[INFO] \- (org.bouncycastle:bcprov-jdk15on:jar:1.54:compile - omitted for duplicate)
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building sea-web 1.0.30-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.4:tree (default-cli) # sea-web ---
[INFO] ru.my-company.ea.old:sea-web:war:1.0.30-SNAPSHOT
[INFO] +- ru.my-company.ea.old:pdf-cuter:jar:1.0.30-SNAPSHOT:compile
[INFO] | \- org.icepdf.os:icepdf-core:jar:6.1.2:compile
[INFO] | +- org.bouncycastle:bcprov-jdk15on:jar:1.54:compile
[INFO] | +- org.bouncycastle:bcprov-ext-jdk15on:jar:1.54:compile
[INFO] | \- org.bouncycastle:bcpkix-jdk15on:jar:1.54:compile
[INFO] | \- (org.bouncycastle:bcprov-jdk15on:jar:1.54:compile - omitted for duplicate)
[INFO] \- net.sf.jasperreports:jasperreports:jar:4.7.1:compile
[INFO] \- com.lowagie:itext:jar:2.1.7:compile
[INFO] \- org.bouncycastle:bctsp-jdk14:jar:1.38:compile
[INFO] +- org.bouncycastle:bcprov-jdk14:jar:1.38:compile
[INFO] \- org.bouncycastle:bcmail-jdk14:jar:1.38:compile
[INFO] \- (org.bouncycastle:bcprov-jdk14:jar:1.38:compile - omitted for duplicate)
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building the-ear 1.0.30-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] Failed to retrieve plugin descriptor for org.codehaus.mojo:gwt-maven-plugin:${gwt.version}: Plugin org.codehau
s.mojo:gwt-maven-plugin:${gwt.version} or one of its dependencies could not be resolved: Failed to read artifact descrip
tor for org.codehaus.mojo:gwt-maven-plugin:jar:${gwt.version}
[INFO]
[INFO] --- maven-dependency-plugin:2.4:tree (default-cli) # the-ear ---
[INFO] ru.my-company.ea.old:the-ear:ear:1.0.30-SNAPSHOT
[INFO] \- net.sf.jasperreports:jasperreports:jar:4.7.1:compile
[INFO] \- com.lowagie:itext:jar:2.1.7:compile
[INFO] \- org.bouncycastle:bctsp-jdk14:jar:1.38:compile
[INFO] +- org.bouncycastle:bcprov-jdk14:jar:1.38:compile
[INFO] \- org.bouncycastle:bcmail-jdk14:jar:1.38:compile
[INFO] \- (org.bouncycastle:bcprov-jdk14:jar:1.38:compile - omitted for duplicate)
[INFO] ------------------------------------------------------------------------
........
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.698 s
[INFO] Finished at: 2018-09-07T11:26:32+05:00
[INFO] Final Memory: 21M/226M
[INFO] ------------------------------------------------------------------------
D:\Projects\sea-eclipse>

Wasabi fails on build - Maven plugin

See the solution below
Using Ubuntu 16.04 on Google Cloud
Everything is done as noted here https://github.com/intuit/wasabi.
After successfully bootstraping the wasabai
by running:
$ ./bin/wasabi.sh bootstrap
and getting
Everything looks all right!
...
installed dependencies.
Then I reboot the machine
$ sudo reboot
and try running the build
$ ./bin/wasabi.sh build
which obviously fails, this is the output I see:
[INFO] Scanning for projects...
[INFO] Inspecting build with total of 30 modules...
[INFO] Installing Nexus Staging features:
[INFO] ... total of 30 executions of maven-deploy-plugin replaced with nexus-staging-maven-plugin
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] wasabi
[INFO] wasabi-experiment-objects
[INFO] wasabi-export
[INFO] wasabi-assignment-objects
[INFO] wasabi-exceptions
[INFO] wasabi-analytics-objects
[INFO] wasabi-authentication-objects
[INFO] wasabi-eventlog
[INFO] wasabi-auditlog-objects
[INFO] wasabi-authorization-objects
[INFO] wasabi-cassandra
[INFO] wasabi-database
[INFO] wasabi-feedback-objects
[INFO] wasabi-user-directory
[INFO] wasabi-repository
[INFO] wasabi-experiment
[INFO] wasabi-assignment
[INFO] wasabi-util
[INFO] wasabi-analytics
[INFO] wasabi-auditlog
[INFO] wasabi-event-objects
[INFO] wasabi-event
[INFO] wasabi-email
[INFO] wasabi-feedback
[INFO] wasabi-authentication
[INFO] wasabi-authorization
[INFO] wasabi-api
[INFO] wasabi-functional-test
[INFO] wasabi-main
[INFO] wasabi-swagger-ui
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building wasabi 1.0.20161107232436-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # wasabi ---
[INFO]
[INFO] --- maven-resources-plugin:2.7:copy-resources (copy-resources) # wasabi ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /var/www/html/wasabi/wasabi/src/main/env
[INFO]
[INFO] --- jacoco-maven-plugin:0.7.7.201606060606:prepare-agent (prepare-agent) # wasabi ---
[INFO] argLine set to -javaagent:/home/silversillu/.m2/repository/org/jacoco/org.jacoco.agent/0.7.7.201606060606/org.jacoco.agent-0.7.7.201606060606-runtime.jar=destfile=/var/www/html/wasabi/wasabi/target/jacoco.exec,excludes=com/intuit/wasabi/tests/**
[INFO]
[INFO] --- jacoco-maven-plugin:0.7.7.201606060606:report (post-unit-test) # wasabi ---
[INFO] Skipping JaCoCo execution due to missing execution data file.
[INFO]
[INFO] --- jacoco-maven-plugin:0.7.7.201606060606:report (report) # wasabi ---
[INFO] Skipping JaCoCo execution due to missing execution data file.
[INFO]
[INFO] --- maven-javadoc-plugin:2.10.3:jar (attach-javadocs) # wasabi ---
[INFO] Not executing Javadoc as the project is not a Java classpath-capable package
[INFO]
[INFO] --- maven-source-plugin:2.4:jar-no-fork (attach-sources) # wasabi ---
[INFO]
[INFO] --- build-helper-maven-plugin:1.10:remove-project-artifact (remove-old-artifacts) # wasabi ---
[INFO] /home/silversillu/.m2/repository/com/intuit/wasabi/wasabi removed.
[INFO]
[INFO] --- maven-site-plugin:3.4:attach-descriptor (attach-descriptor) # wasabi ---
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building wasabi-experiment-objects 1.0.20161107232436-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # wasabi-experiment-objects ---
[INFO]
[INFO] --- maven-resources-plugin:2.7:copy-resources (copy-resources) # wasabi-experiment-objects ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /var/www/html/wasabi/wasabi/modules/experiment-objects/src/main/env
[INFO]
[INFO] --- jacoco-maven-plugin:0.7.7.201606060606:prepare-agent (prepare-agent) # wasabi-experiment-objects ---
[INFO] argLine set to -javaagent:/home/silversillu/.m2/repository/org/jacoco/org.jacoco.agent/0.7.7.201606060606/org.jacoco.agent-0.7.7.201606060606-runtime.jar=destfile=/var/www/html/wasabi/wasabi/modules/experiment-objects/target/jacoco.exec,excludes=com/intuit/wasabi/tests/**
[INFO]
[INFO] --- maven-resources-plugin:2.7:resources (default-resources) # wasabi-experiment-objects ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /var/www/html/wasabi/wasabi/modules/experiment-objects/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.5.1:compile (default-compile) # wasabi-experiment-objects ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 24 source files to /var/www/html/wasabi/wasabi/modules/experiment-objects/target/classes
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Skipping wasabi
[INFO] This project has been banned from the build due to previous failures.
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] wasabi ............................................. SUCCESS [ 4.085 s]
[INFO] wasabi-experiment-objects .......................... FAILURE [ 0.633 s]
[INFO] wasabi-export ...................................... SKIPPED
[INFO] wasabi-assignment-objects .......................... SKIPPED
[INFO] wasabi-exceptions .................................. SKIPPED
[INFO] wasabi-analytics-objects ........................... SKIPPED
[INFO] wasabi-authentication-objects ...................... SKIPPED
[INFO] wasabi-eventlog .................................... SKIPPED
[INFO] wasabi-auditlog-objects ............................ SKIPPED
[INFO] wasabi-authorization-objects ....................... SKIPPED
[INFO] wasabi-cassandra ................................... SKIPPED
[INFO] wasabi-database .................................... SKIPPED
[INFO] wasabi-feedback-objects ............................ SKIPPED
[INFO] wasabi-user-directory .............................. SKIPPED
[INFO] wasabi-repository .................................. SKIPPED
[INFO] wasabi-experiment .................................. SKIPPED
[INFO] wasabi-assignment .................................. SKIPPED
[INFO] wasabi-util ........................................ SKIPPED
[INFO] wasabi-analytics ................................... SKIPPED
[INFO] wasabi-auditlog .................................... SKIPPED
[INFO] wasabi-event-objects ............................... SKIPPED
[INFO] wasabi-event ....................................... SKIPPED
[INFO] wasabi-email ....................................... SKIPPED
[INFO] wasabi-feedback .................................... SKIPPED
[INFO] wasabi-authentication .............................. SKIPPED
[INFO] wasabi-authorization ............................... SKIPPED
[INFO] wasabi-api ......................................... SKIPPED
[INFO] wasabi-functional-test ............................. SKIPPED
[INFO] wasabi-main ........................................ SKIPPED
[INFO] wasabi-swagger-ui .................................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.399 s
[INFO] Finished at: 2017-01-10T21:48:24+00:00
[INFO] Final Memory: 29M/70M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.5.1:compile (default-compile) on project wasabi-experiment-objects: Fatal error compiling: directory not found: /var/www/html/wasabi/wasabi/modules/experiment-objects/target/classes -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :wasabi-experiment-objects
error: invalid: mvn -Pdevelopment clean -Dmaven.test.skip=true package javadoc:aggregate
usage: build.sh [options]
options:
-b | --build [ true | false ] : build; default: false
-p | --profile [profile] : build profile; default: development
-t | --test [ true | false ] : test; default: false
-h | --help : help message
Solution
I don't know if it makes any sense but what fixed the issue was moving my cloud machine from micro to much more powerful one n1-standard-4 (4 vCPUs, 15 GB memory)
can you try the following:
% WASABI_MAVEN="-e -X" ./bin/wasabi.sh build
additionally one could try issuing the reported failed mvn invocation directly, ie:
% mvn -e -X -Pdevelopment clean -Dmaven.test.skip=true package javadoc:aggregate
clearly none of the codebase is compiling given the first module fails.
i don't see why a reboot would matter unless logged in as a different user, some directory is owned by 'root' and not writable/deletable, etc.
let's fix this :)

Can't get 'mvn test' run the tests

For some reason I don't know, sometimes, when I create a new Test project (I use IntelliJ + Maven module), I use the same pom file with some plugins which currently works in another projects, but then when I run the command line
mvn test
it doesn't run the JUnit test methods I have written. And I don't know what's wrong, it says:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building n26 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # n26 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # n26 ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # n26 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory D:\Automation\NewHomePage\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) # n26 ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to D:\Automation\NewHomePage\target\test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) # n26 ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.713 s
[INFO] Finished at: 2015-09-24T13:02:50+02:00
[INFO] Final Memory: 19M/306M
[INFO] ------------------------------------------------------------------------
Normally, it will execute tests afterwards, but sometimes it stops here.
#wemu thanks, I named my file was xxxTests.java, and the naming convention is xxxTest.java. It works, thanks

How can I disable default lifecycle phases in Maven 3?

By disable I mean completely, entirely cut the phase from the lifecycle, so that it is not even invoked.
I might need a custom lifecycle but I could not find an easy way to define it straight in my pom.xml. It appears I need to write a plugin just to list phases I want.
For example, I would like default-testResources, default-testCompile and default-test phases to never happen and turn 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] ------------------------------------------------------------------------
into 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-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] ------------------------------------------------------------------------
If you want to continue using a predefined packaging (jar, war, etc.) you cannot totally remove them. You may leave the packaging as pom and define your own lifecycle by binding the goals you want to the desired phases, or you may define your own lifecycle entirely. You may also bind a default goal to phase none to prevent the goal from doing any real work as shown.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>default-testResources</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
All that said - khmarbaise's question is a good one. Generally it's not a best practice to change the existing pre-built lifecycles.

Resources