IntelliJ IDEA 14: How to skip tests while deploying project into Tomcat

55,382

Solution 1

In case you are using Maven, on the View > Tool Windows > Maven Projects click on the button shown below ( called Skip Tests Mode). Essentially it is taking the test phase out of the lifecycle when you say run package.

enter image description here

Solution 2

When creating a maven configuration for the project. On the Runner tab you can click on skip test checkbox as below :

enter image description here

It helped me a lot!

Solution 3

In the Tomcat Run/Debug configurations you can specify in the Before launch section a maven task with this parameter:

-Dmaven.test.skip=true

Share:
55,382
stevey
Author by

stevey

Updated on April 11, 2021

Comments

  • stevey
    stevey about 3 years

    I have a Spring MVC project using IntelliJ IDEA 14 as my IDE (I'm new to IntelliJ IDEA; I used Eclipse).

    My main Java code is in folder src/main, and the unit test code is in src/test. While deploying the project, I found that all the unit tests are executed.

    How can I skip all the unit tests while deploying the project into Tomcat?

  • djkelly99
    djkelly99 over 6 years
    Does an option exist to do this on a per project basis? If you click Skip Tests Mode, test runs are disabled for all maven projects.
  • Dilip Raj Baral
    Dilip Raj Baral over 5 years
    This didn't work me (or at least the way I want it to). Even after disabling tests like this, when I run a Run or Debug configuration, the build attempts to compile the tests. Can we skip compile as well? Because in the codebase I'm working there are hell lot of tests with compile errors.
  • ktamas
    ktamas almost 5 years
    How to skip even building the tests/test packages?