简体   繁体   English

将maven项目导入netbeans

[英]Import a maven project into netbeans

I'm learning how to create some applications in Java, i found a maven project example in a tutorial and went to compile it in netbeans. 我正在学习如何用Java创建一些应用程序,我在教程中找到了一个maven项目示例,然后在netbeans中编译它。

I tried to search in the Internet how to import a maven project into netbeans , and i can't found a solution. 我试图在互联网上搜索如何将maven项目导入netbeans ,我找不到解决方案。

By the way, in the tutorial i downloaded something like pom.xml, i wonder what is it and how it can be used? 顺便说一句,在教程中我下载了类似pom.xml的东西,我想知道它是什么以及如何使用它?

Thanks! 谢谢!

You can import Eclipse Maven project in netbean, just follow the steps. 您可以在netbean中导入Eclipse Maven项目,只需按照步骤操作即可。

1) In Netbean , File->New Project->Select maven in left Pane -> Select Project with existing POM on right pane and finish. 1)在Netbean中,File-> New Project->在左窗格中选择maven - >在右窗格中选择Project with existing POM并完成。

2) Now you will be asked to open a eclipse project just open it and that's it.. 2)现在你将被要求打开一个eclipse项目,只需打开它就可以了。

I hope you will solve your problem with this...... 我希望你能解决你的问题......

Although not really a direct solution to your problem, a work around to get you up and running is to create a maven project in Netbeans via the wizard, with the same name as the example project you want to install. 虽然不能直接解决您的问题,但是通过向导在Netbeans中创建一个maven项目,与您要安装的示例项目同名。 Then, create the same package structure in the project as the example, then copy the files into their correct packages. 然后,在项目中创建与示例相同的包结构,然后将文件复制到正确的包中。 Although you are not importing the project, but it should get you up and running. 虽然您没有导入项目,但它应该让您启动并运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM