[英]How to integrate maven 2 in an existing netbeans project?
How to integrate maven 2 in an existing netbeans project ? 如何在现有的netbeans项目中集成maven 2?
I dont want to do it by creating a new maven web app project and moving my files manually to the new project (as I have versions of this project in my subversion repositories which I wont be able to link if I create new project), rather I need to integrate that in my already existing netbeans project. 我不想通过创建一个新的maven web应用程序项目并将我的文件手动移动到新项目来实现它 (因为我在我的subversion存储库中有这个项目的版本,如果我创建新项目,我将无法链接),而是我需要将它集成到我现有的netbeans项目中。 How do I go about it ? 我该怎么办呢? Would creating a pom.xml work ? 创建一个pom.xml会起作用吗?
Maven 2 already installed on my machine. Maven 2已安装在我的机器上。
What about creating a new Maven Web Project and moving the pom.xml
back to your existing Web Project? 如何创建一个新的Maven Web项目并将pom.xml
移回现有的Web项目? I mean: 我的意思是:
MavenWebTest
创建一个名为MavenWebTest
的新项目 pom.xml
from the MavenWebTest
project to your original project's folder 将pom.xml
从MavenWebTest
项目移动到原始项目的文件夹 pom.xml
's project specific settings (eg project name, dependencies) 修改pom.xml
的项目特定设置(例如项目名称,依赖项) build.xml
and the whole nbproject
folder 删除build.xml
和整个nbproject
文件夹 web
folder to src/main/webapp
( webapp
is the new name) (use svn mv
if you use Subversion) 将web
文件夹移动并重命名为src/main/webapp
( webapp
是新名称)(如果使用Subversion,请使用svn mv
) src/java
to src/main/java
( svn mv
here too) 将src/java
移动到src/main/java
(这里也是svn mv
) MavenWebTest
project 删除不必要的MavenWebTest
项目 Anyway, creating an empty pom.xml
also should work. 无论如何,创建一个空的pom.xml
也应该有效。 You have to list your dependencies in the pom.xml
and you have to set the project's name. 您必须在pom.xml
列出依赖项,并且必须设置项目的名称。 Maybe other fine tunings also required to get the same result as Netbeans create without Maven. 也许其他微调也需要得到与没有Maven的Netbeans创建相同的结果。 If you create the pom.xml
with Netbeans (the MavenWebTest above) I suppose that most of Netbeans specific stuff already will be there. 如果您使用Netbeans(上面的MavenWebTest)创建pom.xml
,我想大多数Netbeans特定的东西已经存在。
If you are new to Maven I suggest you to check the free pdf/html books on Sonatype's website . 如果您是Maven的新手,我建议您查看Sonatype网站上的免费pdf / html书籍。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.