如何为 Netbeans 7.1 创建可分发的 Java 模板?
我正在尝试为 Netbeans 7.1 创建一个可分发模块,其中包含一个许可证模板和一些 java 模板。我正在按照 Netbean 的支持 上的教程进行操作,但是他们只讨论如何创建 HTML 模板。如果我创建一个 java 文件用作模板,构建器会尝试编译该模板并失败。
我的项目如下所示:
Netbeans Code Template Module
+ org.myorg.nbcodetemplates
- Bundle.properties
+ org.myorg.nbcodetemplates.javaclass
- JavaClass.java
- JavaClassDescription.html
- package-info.java
+ org.myorg.nbcodetemplates.license
- LicenseDescription.html
- license-myorg.txt
- package-info.java
How do I get the builder to跳过 Java 模板 - 或者我应该在这里做其他事情?如果我将 JavaClass.java 命名为 JavaClass.html 并以这种方式构建模块,这似乎很高兴,但当我尝试通过新建文件向导将其添加到项目时,它会显示为 HTML 文件。
I'm trying to create a distributable module for Netbeans 7.1 which will contain a license template and some java templates. I'm following the tutorial at Netbean's support but they only talk about how to create an HTML template. If I create a java file to use as a template, the builder tries to compile the template and fails.
My project looks like this:
Netbeans Code Template Module
+ org.myorg.nbcodetemplates
- Bundle.properties
+ org.myorg.nbcodetemplates.javaclass
- JavaClass.java
- JavaClassDescription.html
- package-info.java
+ org.myorg.nbcodetemplates.license
- LicenseDescription.html
- license-myorg.txt
- package-info.java
How do I get the builder to skip the Java template - or is there something else I should have done here? It seems to be happy if I leave the JavaClass.java named JavaClass.html and build the module that way, but it shows up as an HTML file when I try to add it to a project through the New File wizard.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只需将文件名从
JavaClass.java
更改为
JavaClass.java.template
后 .template 将自动删除
just change name of your file from
JavaClass.java
to
JavaClass.java.template
after that .template will be removed automatically