specifying goal in pom.xml
The error message which you specified is nothing but you are not specifying goal for maven build.
you can specify any goal in your run configuration for maven build like clear, compile, install, package.
please following below step to resolve it.
- right click on your project.
- click 'Run as' and select 'Maven Build'
- edit Configuration window will open. write any goal but your problem specific write 'package' in Goal text box.
- click on 'Run'
I've bumped into this question because I actually wanted to define a default goal in pom.xml. You can define a default goal under build:
<build>
<defaultGoal>install</defaultGoal>
...
</build>
After that change, you can then simply run mvn
which will do exactly the same as mvn install
.
Note: I don't favor this as a default approach. My use case was to define a profile that downloaded a previous version of that project from Artifactory and wanted to tie that profile to a given phase. For convenience, I can run mvn -Pdownload-jar -Dversion=0.0.9
and don't need to specify a goal/phase there. I think it's reasonable to define a defaultGoal
in a profile which has a very specific function for a particular phase.
You should always give an argument to your maven command. Normally this is one of the lifecycles. For example:
mvn package
Package will create jars, wars, ears etc.
For more phases and their meaning, see: http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
1.right click on your project.
2.click 'Run as' and select 'Maven Build'
3. edit Configuration window will open. write any goal but your problem specific write 'package' in Goal
4 user settings: show your maven->directory->conf->settings.xml
for example; C:\maven\conf\settings.xml
- Go to Terminal
- Do
mvn clean install