I am new to Maven, I have a Java based web project with maven configured in my MyEclipse.
Now if I modified any java files then do I need to do Run as -> Mvn in
mvn install
is the option that is most often used.
mvn package
is seldom used, only if you're debugging some issue with the maven build process.
See: http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
Note that mvn package
will only create a jar file.
mvn install
will do that and install the jar (and class etc.) files in the proper places if other code depends on those jars.
I usually do a mvn clean install
; this deletes the target
directory and recreates all jars in that location.
The clean helps with unneeded or removed stuff that can sometimes get in the way.
Rather then debug (some of the time) just start fresh all of the time.
package - takes the compiled code and package it in its distributable format, such as a JAR or WAR file. install - install the package into the local repository, for use as a dependency in other projects locally