简体   繁体   English

m2eclipse过滤测试资源

[英]m2eclipse filtering test resources

I am using m2eclipse and I want to right click and run tests from inside eclipse while the test resources get filtered from Maven. 我正在使用m2eclipse,我想从Eclipse内部右键单击并运行测试,同时从Maven中过滤掉测试资源。 How can I do this? 我怎样才能做到这一点? From eclipse when I right click on a test I do not get any m2eclipse options 当我右键单击测试时,从eclipse中我没有任何m2eclipse选项

Julia. 朱莉娅

Similar to: 如同:

Debugging maven junit tests with filtered resources? 使用过滤的资源调试Maven junit测试?

右键单击项目->运行方式-> Maven测试

  1. Setup filtering in your pom.xml (and you'll get filtering under Eclipse with m2eclipse, m2eclipse runs process-resources after a change of any resource). pom.xml设置过滤(您将在Eclipse下使用m2eclipse进行过滤,m2eclipse在更改任何资源后将运行process-resources资源)。
  2. Run your test as any other test ( right-click then Run As > JUnit Test ). 与其他任何测试一样运行您的测试( 右键单击,然后单击 运行方式> JUnit Test )。
  3. After a first run, you can run an individual test method ( right-click on the method in the JUnit view). 第一次运行后,您可以运行一个单独的测试方法(在JUnit视图中右键单击该方法)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM