Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

maven build goal need to specify

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?

like image 683
FrankD Avatar asked Oct 18 '12 06:10

FrankD


People also ask

What should I specify in goals for 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.

How do I specify goals for Maven in STS?

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.

What is the goal for Maven build in Eclipse?

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).


2 Answers

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.

like image 145
kostja Avatar answered Sep 20 '22 19:09

kostja


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

like image 23
Sasi Kathimanda Avatar answered Sep 23 '22 19:09

Sasi Kathimanda