1

I can disable the particular phase in pom: Disable phases in Maven lifecycle. It is possible to disable test from the command line: -Dmaven.test.skip=true Is it possible to start mvn lifecycle from the particular phase, for example compile using only the command line options ?

Irbis
  • 1,432
  • 1
  • 13
  • 39
  • As already mentioned in linked resources you can't disable phases of the life cycle. You can only disable particular plugins not to be executed in a life cycle phase. furthermore the question is what kind of problem do you have? – khmarbaise Apr 18 '19 at 20:41

1 Answers1

1

By default, a lifecycle is as follows (from Introduction to the Build Lifecycle):

  1. validate - validate the project is correct and all necessary information is available
  2. compile - compile the source code of the project
  3. test - test the compiled source code using a suitable unit testing framework
  4. package - take the compiled code and package it in its distributable format, such as a JAR
  5. verify - run any checks on results of integration tests to ensure quality criteria are met
  6. install - install the package into the local repository, for use as a dependency in other projects locally
  7. deploy - done in the build environment, copies the final package to the remote repository for sharing with other developers and projects.

While we can build applications without automated testing, we can't execute the package phase without an earlier code compilation. Just as we are not able to install the package into the local repository without the .jar/.war packages, that are created in package phase.

For compilation you can use Apache Maven Compiler Plugin.

Then you can run compilation by executing

mvn compile

The command will execute maven goal compiler:compile

pobu
  • 402
  • 1
  • 5
  • 13