问题
The project has GWTQuery included. I'd like to have the pom.xml generated in the existing project so I can configure the build.
回答1:
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.
回答2:
You can start with an empty pom.xml
by defining your project attributes first and add your dependency to gwtquery
<dependency>
<groupId>com.googlecode.gwtquery</groupId>
<artifactId>gwtquery</artifactId>
<version>1.3.3</version>
</dependency>
Another way is to generate a new project using an archetype
:
Step 1:
mvn archetype:generate
Step 2: choose 44
, which at the time of writing means: 44: remote -> com.googlecode.gwtquery:gquery-archetype (This archetype generates a Gwt-2.5.0-rc1 project with all set to use GwtQuery and its plugins.)
Step 3: enter your project information
来源:https://stackoverflow.com/questions/16812283/how-would-you-add-maven-to-an-existing-gwt-project-in-eclipse-with-m2e-installed