Its very interesting topic to discuss, those who are working with building tools they will find very helpful.

Basically package & install are known as goals in maven building tool

Both are used to generate the distributable format like war & jar.

package  will takes the compiled code and generate the distributable format, such as a JAR or WAR

install also take the compile code, generates the distributable format and copies into maven repository.

In short,

install = package + copy to maven repoistory

Here is the observation made while using the mvn goals separately.

1. mvn package

  1. Assembles the code in target folder in the mvn project.
  2. Start processing the files assembles files into desired structure based on project (ie., Java project or Java Web project) .
  3. Starts building the distributable format into target folder.

2. mvn install

  1. Assembles the code in target folder in the mvn project.
  2. Start processing the files assembles files into desired structure based on project (ie., Java project or Java Web project) .
  3. Starts building the distributable format into target folder.
  4. Take the build formatted file from target folder and copies into maven repository.

 

Hope my explanation helps who are familiar with Java building tools. Thank you.

 

Advertisements