您将如何将maven添加到Eclipse中的现有GWT项目中,并安装了m2e? [英] How would you add maven to an existing GWT project in Eclipse with m2e installed?

查看:155
本文介绍了您将如何将maven添加到Eclipse中的现有GWT项目中,并安装了m2e?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

项目包含GWTQuery。我想在现有项目中生成pom.xml,因此我可以配置该构建。

解决方案

最好的方法我看到的是使用gwtquery原型创建一个新的maven-ready项目,并设置与当前项目中使用的相同的命名空间和模块名称。

  mvn archetype:generate -DarchetypeGroupId = com.googlecode.gwtquery \ 
-DarchetypeArtifactId = gquery-archetype \
-DarchetypeVersion = 1.3.3 \
-DgroupId = com .mycompany \
-DartifactId = myproject \
-DprojectName = MyProject

然后在eclipse导入maven项目(使用m2e插件),并检查它是否工作(开发模式,测试等)。



从src中复制所有的源代码文件夹到新项目src / main / java,与你的公共东西.gw一样t.xml文件和测试。



最后,使用eclipse pom编辑器将您的依赖项添加到您的pom。



<注意:将正常eclipse项目转换为maven的m2e功能需要大量工作。


The project has GWTQuery included. I'd like to have the pom.xml generated in the existing project so I can configure the build.

解决方案

The best way I see is to create a new maven-ready project using gwtquery archetype and setting the same namespaces and module name that you use in your current project.

mvn archetype:generate  -DarchetypeGroupId=com.googlecode.gwtquery \
                        -DarchetypeArtifactId=gquery-archetype  \
                        -DarchetypeVersion=1.3.3 \
                        -DgroupId=com.mycompany \
                        -DartifactId=myproject \
                        -DprojectName=MyProject 

Then import the maven project in eclipse (use m2e plugin) and check if it works (dev mode, tests, etc).

Copy all your source code from your src folder to the new project src/main/java, the same with your public stuff, .gwt.xml file, and tests.

And finally add your dependencies to your pom using the eclipse pom editor.

Note: The m2e feature of converting a normal eclipse project to maven needs a lot of work.

这篇关于您将如何将maven添加到Eclipse中的现有GWT项目中,并安装了m2e?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆