免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1198 | 回复: 0
打印 上一主题 下一主题

netBeans中用mvn来管理项目 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-11-30 00:43 |只看该作者 |倒序浏览

                  前面写了一些对mvn的介绍,此处就不再对此多说了。这里只是写一点如何在netBeans中用mvn来管理项目。
  要使用mvn,我们首先要建一个mvn项目,比如:
shell>mvn archetype:create -DgroupId=cn.edu.sdau.neat -DartifactId=netbeansproject -DarchetypeArtifactId=maven-archetype-quickstart
   这样我们会建一个简单的HelloWord实例。然后再将mvn项目同时转为netBeans能找到的项目:
shell>mvn netbeans-freeform:generate-netbeans-project
   这样会在我们的项目目录下建一个nbproject的文件夹,里面是nb的一些必要信息。
  • The
    file is the Netbeans Freeform project descriptor.
  • The mavencall.xml
    holds the Ant calls which execute Maven 2, as Netbeans uses Ant as its build tool.
  • The project.properties
    files holds the two properties: local.repository
    which is the absolute path to the Maven 2 local repository and project.directory
    which is the absolute path to the project directory.
   现在我们用netBeans打开,就可以在netBeans中编辑项目了。
   如果你用netBeans编辑,然后在编译它,也许会提示你找不到${mvn.path},此时你需要做如下工作来解决这个问题:
   Tools -> Options -> Ant 在Properties里加入:
   mvn.path=mvn
   然后在使用nb编译运行应该就都没有问题了。
               
               
               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/30752/showart_433117.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP