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.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
- Ensure Maven is configured for your project
- Right-click on your project
- Go to 'Run As'
- Select 'Run Configurations'
- In the left-hand column, right-click 'Maven Build' and select 'New'
- Select the base directory (the project) you want to build from
- Write 'install' and any other goals you want in the 'Goals' field
- Click the 'Skip Tests' radio button
- Click Run!
Hope that helps.
回答2:
It depends on maven test plugin that you use. You can try add parameter -Dmaven.test.skip=true
to your build configuration.
回答3:
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.
回答4:
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>
回答5:
At the Run configurations there is a Maven Build type of Run configuration. At that you could set up the standard Maven skipTests parameter.