How to configure maven install to skip tests in eclipse?

EclipseJakarta EeMavenM2eclipseM2e

Eclipse Problem Overview


i was wondering if it's possible to configure run as maven install in eclipse to skip unit tests, if such thing is doable, then please tell me how to do it, thanks in advance.

Eclipse Solutions


Solution 1 - Eclipse

  1. Ensure Maven is configured for your project
  2. Right-click on your project
  3. Go to 'Run As'
  4. Select 'Run Configurations'
  5. In the left-hand column, right-click 'Maven Build' and select 'New'
  6. Select the base directory (the project) you want to build from
  7. Write 'install' and any other goals you want in the 'Goals' field
  8. Click the 'Skip Tests' radio button
  9. Click Run!

Hope that helps.

Solution 2 - Eclipse

accordig to maven's document you can write this in you pom.xml:

<project>


[...]
<build>
<plugins>
  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>2.12</version>
    <configuration>
      <skipTests>true</skipTests>
    </configuration>
  </plugin>
</plugins>

Solution 3 - Eclipse

It depends on maven test plugin that you use. You can try add parameter -Dmaven.test.skip=true to your build configuration.

Solution 4 - Eclipse

You can put the property maven.test.skip in a profile in your pom. And then you activate this profile in eclipse in the project properties of maven in eclipse.

Solution 5 - Eclipse

At the Run configurations there is a Maven Build type of Run configuration. At that you could set up the standard Maven skipTests parameter.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionfresh_devView Question on Stackoverflow
Solution 1 - EclipseTom ElliottView Answer on Stackoverflow
Solution 2 - EclipseSaeedView Answer on Stackoverflow
Solution 3 - EclipsemishadoffView Answer on Stackoverflow
Solution 4 - EclipsegruenyView Answer on Stackoverflow
Solution 5 - EclipseZoltán UjhelyiView Answer on Stackoverflow