如何将一个目录添加到近百个Eclipse运行配置中?

发布于 2025-01-08 01:40:50 字数 126 浏览 1 评论 0原文

我有很多项目、单元测试等。几乎有一百个,我不是在开玩笑。 单击“运行配置”、“类路径”、“高级”、“添加文件夹”一百次并不是我乐意做的事情。有没有像 Ctrl-A 然后一次这样更快的方法。好吧,它不能与 Crtl-A 一起使用......

I have many projects, unit tests etc. Almost a hundred and I am not joking.
Clicking 'Run Configurations', 'Classpath', 'Advanced', 'Add Folder' a hundred times is not what I would be glad to do. Is there any quicker way like Ctrl-A and then once. Well, it does not work with Crtl-A though...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

甜是你 2025-01-15 01:40:50

您可以将运行配置保存到启动文件中。之后您可以手动或以编程方式编辑此文件。这可能比单击...更容易一些。

You could save the Run Configuration to a launch file. Afterwards you can edit this file manually or programmatically. This might be a little easier than clicking...

柠北森屋 2025-01-15 01:40:50

您的运行配置将作为 .launch 文件保存在工作区的子文件夹中:

<workspace>\.metadata\.plugins\org.eclipse.debug.core\.launches

您可以使用良好的文本编辑器轻松地在这些文件中查找/替换您想要的内容。

Your Run Configurations are saved as .launch files in a subfolder of your workspace:

<workspace>\.metadata\.plugins\org.eclipse.debug.core\.launches

You can easily find/replace what you want in those file using a good text editor.

淡墨 2025-01-15 01:40:50

查看 Eclipse 工作区中的 /.metadata/.plugins/org.eclipse.debug.core/.launches/*.launch 文件。这些是定义您的启动的 XML 文件。使用文本编辑器编辑它们,然后重新启动 Eclipse。

您需要更改 org.eclipse.jdt.launching.CLASSPATH 条目。

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.junit.launchconfig">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/project/src/test/java/xx/yy/zz/FichierExportImplTest.java"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="1"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit3"/>
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<runtimeClasspathEntry containerPath="org.eclipse.jdt.launching.JRE_CONTAINER" path="1" type="4"/>
"/>
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<runtimeClasspathEntry path="3" projectName="SIBAT_BATCH_EXPORTS" type="1"/>
"/>
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<runtimeClasspathEntry containerPath="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER" path="3" type="4"/>
"/>
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<runtimeClasspathEntry internalArchive="/other/conf/dev" path="3" type="2"/>
"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.maven.ide.eclipse.launchconfig.classpathProvider"/>
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="xx.yy.zz.FichierExportImplTest"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="SIBAT_BATCH_EXPORTS"/>
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.maven.ide.eclipse.launchconfig.sourcepathProvider"/>
</launchConfiguration>

Look in your Eclipse workspace, in your <workspace>/.metadata/.plugins/org.eclipse.debug.core/.launches/*.launch files. These are XML file which define your launch. Edit them with a text editor, and then restart Eclipse.

You'll need to change the org.eclipse.jdt.launching.CLASSPATH entry.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.junit.launchconfig">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/project/src/test/java/xx/yy/zz/FichierExportImplTest.java"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="1"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit3"/>
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<runtimeClasspathEntry containerPath="org.eclipse.jdt.launching.JRE_CONTAINER" path="1" type="4"/>
"/>
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<runtimeClasspathEntry path="3" projectName="SIBAT_BATCH_EXPORTS" type="1"/>
"/>
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<runtimeClasspathEntry containerPath="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER" path="3" type="4"/>
"/>
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<runtimeClasspathEntry internalArchive="/other/conf/dev" path="3" type="2"/>
"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.maven.ide.eclipse.launchconfig.classpathProvider"/>
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="xx.yy.zz.FichierExportImplTest"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="SIBAT_BATCH_EXPORTS"/>
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.maven.ide.eclipse.launchconfig.sourcepathProvider"/>
</launchConfiguration>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文