Why 'mvn install' war projects?

amphibient

My maven project packages a war, which only gets deployed and is itself not a dependency to other projects (in other words is a final deployable).

Questions:

  • is there any reason to ever run mvn install on that package, which, in addition to mvn package only puts it in the localRepository?
  • Why should a final deployable be installed if nothing ever depends on it?
A_Di-Matteo

For a final deployable artifact indeed there may be no reason to invoke the install phase instead of the package phase: you want to build the .war file and you don't need to install it in your local repository indeed.

However, you may want as an habit to always run integration tests, if any. Looking at the default Maven lifecycle these phases happen after the packaging:

package take the compiled code and package it in its distributable format, such as a JAR.
pre-integration-test perform actions required before integration tests are executed. This may involve things such as setting up the required environment.
integration-test process and deploy the package if necessary into an environment where integration tests can be run.
post-integration-test perform actions required after integration tests have been executed. This may including cleaning up the environment.
verify run any checks to verify the package is valid and meets quality criteria.
install install the package into the local repository, for use as a dependency in other projects locally.

Hence, by invoking install you would make sure to always execute integration tests as well. Indeed a shorter invocation would be

mvn clean verify

Less popular but more effective in these cases.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Context.xml not coming to WAR on mvn clean install

From Dev

Is there a plugin or framework that converts java web app war to maven war (pom.xml and mvn install command)?

From Dev

'mvn clean install': why does 'clean' run after 'install'?

From Dev

Prevent war file from being copied to .m2/repository when running mvn clean install

From Dev

Why would mvn clean install and eclipse differ in junit tests they run?

From Dev

mvn install error eclipse

From Dev

Mvn clean install error

From Dev

Differences Between mvn install and mvn verify

From Dev

Why is mvn clean install -U not working: Non-resolvable parent POM

From Dev

switch between mvn jars and open projects in eclipse

From Dev

What is the difference between mvn install -U and mvn install?

From Dev

What is the difference between mvn install -U and mvn install?

From Dev

WAR and ERR on npm install

From Dev

Run "mvn clean install" in Eclipse

From Dev

Mvn install fails every time

From Dev

Use of mvn clean -e install

From Dev

Why AEM as war file?

From Dev

mvn clean install not able to resolve class

From Dev

can not install mvn 3.3.3 on ubuntu 14.04

From Dev

mvn clean install doens't find package

From Dev

mvn clean install Could not find artifact

From Dev

when i run mvn install ,there is a error

From Dev

Storm 1.0.2 : mvn install results in build failure

From Dev

maven -P option not working with mvn clean install

From Dev

How Do I Run "mvn install:install-file" in Intellij

From Dev

Adding maven local dependecies without mvn install:install-file

From Dev

Could not find artifact after mvn install:install-file

From Dev

Why am i getting failure to find com.google.zxing:core:jar:2.2-SNAPSHOT error when i run mvn -DskipTests -Dgpg.skip=true install and how to solve it?

From Dev

Gradle Multiproject Build: How to include JAR of a WAR project into another WAR without creating pseudo projects

Related Related

  1. 1

    Context.xml not coming to WAR on mvn clean install

  2. 2

    Is there a plugin or framework that converts java web app war to maven war (pom.xml and mvn install command)?

  3. 3

    'mvn clean install': why does 'clean' run after 'install'?

  4. 4

    Prevent war file from being copied to .m2/repository when running mvn clean install

  5. 5

    Why would mvn clean install and eclipse differ in junit tests they run?

  6. 6

    mvn install error eclipse

  7. 7

    Mvn clean install error

  8. 8

    Differences Between mvn install and mvn verify

  9. 9

    Why is mvn clean install -U not working: Non-resolvable parent POM

  10. 10

    switch between mvn jars and open projects in eclipse

  11. 11

    What is the difference between mvn install -U and mvn install?

  12. 12

    What is the difference between mvn install -U and mvn install?

  13. 13

    WAR and ERR on npm install

  14. 14

    Run "mvn clean install" in Eclipse

  15. 15

    Mvn install fails every time

  16. 16

    Use of mvn clean -e install

  17. 17

    Why AEM as war file?

  18. 18

    mvn clean install not able to resolve class

  19. 19

    can not install mvn 3.3.3 on ubuntu 14.04

  20. 20

    mvn clean install doens't find package

  21. 21

    mvn clean install Could not find artifact

  22. 22

    when i run mvn install ,there is a error

  23. 23

    Storm 1.0.2 : mvn install results in build failure

  24. 24

    maven -P option not working with mvn clean install

  25. 25

    How Do I Run "mvn install:install-file" in Intellij

  26. 26

    Adding maven local dependecies without mvn install:install-file

  27. 27

    Could not find artifact after mvn install:install-file

  28. 28

    Why am i getting failure to find com.google.zxing:core:jar:2.2-SNAPSHOT error when i run mvn -DskipTests -Dgpg.skip=true install and how to solve it?

  29. 29

    Gradle Multiproject Build: How to include JAR of a WAR project into another WAR without creating pseudo projects

HotTag

Archive