I have extracted a sample Struts 2 project and it has the maven pom.xml file. I already installed the m2e plugin for eclipse. But when I right click the pom.xml file and select Maven Build it gives me the below error.
No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in the format : or :[:]:. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-site, site, post-site, site-deploy, pre-clean, clean, post-clean. -> [Help 1]
What is the goal I need to specify in the m2e window when I click on Maven build?
From the main menu, select Run | Edit Configurations to open the run/debug configuration for your project. In the list that opens, select Run Maven Goal. In the Select Maven Goal dialog, specify a project and a goal that you want to execute before launching the project. Click OK.
Right-click Maven Build, and click New. Enter a configuration name, and click Select to select the goals you want to run. Note: If you click the Select button to specify goals and the goals list is empty, you need to enable the full repository index.
You can Launch Maven builds from within Eclipse. It does the dependency management for Eclipse build path based on Maven's pom. xml. It resolves Maven dependencies from the Eclipse workspace without installing to local Maven repository (requires dependency project be in same workspace).
You can build a maven project with m2e by right-clicking your project or your .pom
, selecting Run as
then Maven build...
then write package
into the goal field and click Run
.
The according keyboard shortcut is Alt+Ctrl+X
, then m
- it will get you to the same dialog.
The result will probably be a .war
file in the target
subfolder of your project.
In your Eclipse, Run-->Run Configurations --> on left you will see "Maven Build".on right please mention your goal in the goals tab. for eg:-Dmaven.tomcat.port=8080 tomcat:run
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With