Eclipse从构建路径中删除测试文件夹 [英] Eclipse removing a test folder from the build path

查看:731
本文介绍了Eclipse从构建路径中删除测试文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个文件夹,src和test(对于junit)。当我导出时,测试文件夹被打包到带有JUnit的jar中,这是我不想要的。我去了项目的构建路径,尝试在'导出顺序'中取消选择'test'文件夹,但它不允许我取消选择它。

I have two folders, src and test (for junit). When I export, the test folder gets packaged into the jar with JUnit which I don't want. I went to Build Path for the project an tried to deselect the 'test' folder in 'order of export' but it does not allow me to deselect it.

然后我尝试使用*(所有内容)排除'soruces'选项卡中的文件夹,但是当我尝试导出时出现错误。

I then tried exclude the folder in the 'soruces' tab using * (everything), but then I got an error when I tried to export.

如何排除我的测试文件夹从出口?

How do I exclude my test folder from the export?

推荐答案

我刚刚做了它,它对我来说很好。这就是我做的。

I have just did it and it worked fine for me. Here is what I did.


  1. 右键点击我的项目;选择导出

  2. 选择Java / JAR文件,然后选择。

  3. 显示工作区中的项目列表。现在展开有趣项目的子树,只选择src文件夹。不应选择测试文件夹。

  4. 继续创建jar文件并查看结果。

  1. right click on my project; choose Export
  2. Choose Java/JAR file, Next.
  3. List of projects in the workspace appears. Now expand the sub-tree of interesting project and select src folder only. The test folder should not be selected.
  4. continue creating jar file and see the result.

这篇关于Eclipse从构建路径中删除测试文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆