java 在 Netbeans 7 中更改 JAR 文件的目标文件夹

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6416445/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-30 15:48:13  来源:igfitidea点击:

Change destination folder of JAR files in Netbeans 7

javanetbeansjardirectory

提问by Mike Vittiglio

I'm working on a multiproject solution for a client and we're trying to have all our builds automatically go into a predetermined BIN folder. All the C++ projects were easily enough moved over but the Java side has proven not so easily configured. When I go to the project's properties and go to Build->Packaging the "JAR File:" text box shows a read-only text-box pointing to "dist/App.jar" (which I would like to change to "../../../bin/App.jar". Any thoughts on how to do this?

我正在为客户开发多项目解决方案,我们正在尝试让我们所有的构建自动进入预定的 BIN 文件夹。所有的 C++ 项目都可以很容易地转移,但 Java 方面已经证明不是那么容易配置。当我转到项目的属性并转到 Build->Packaging 时,“JAR 文件:”文本框会显示一个指向“dist/App.jar”的只读文本框(我想将其更改为“.. /../../bin/App.jar”。关于如何做到这一点的任何想法?

回答by Pit

You can change the dist-folder by editing the dist.dirkey in the project.propertiesfile which is located in the nbprojectdirectory from

您可以通过编辑位于以下目录dist.dir中的project.properties文件中的键来更改 dist 文件夹nbproject

dist.dir=dist

to

dist.dir=../../../bin

In my case the key is in line 24. The name of the jar-file itself is determined by the dist.jarkey, if you would need to rename the file aswell.

在我的例子中,键在第 24 行。jar 文件本身的名称由dist.jar键决定,如果您还需要重命名文件。

回答by ghaliloo

Did you check under the menu

你在菜单下检查了吗

[Run] --> [Set project configuration] --> [Customize]
You have plenty of options to change there, it is easy than that.

[Run] --> [Set project configuration] --> [Customize]
你有很多选项可以在那里改变,这很容易。

Good luck

祝你好运

回答by Jason K.

add into build.xml

添加到 build.xml

<target name="-post-jar">
    <copy file="${dist.jar}" todir="drive\path\"/>
</target>