Categories:
Audio (13)
Biotech (29)
Bytecode (35)
Database (77)
Framework (7)
Game (7)
General (512)
Graphics (53)
I/O (32)
IDE (2)
JAR Tools (86)
JavaBeans (16)
JDBC (89)
JDK (337)
JSP (20)
Logging (103)
Mail (54)
Messaging (8)
Network (71)
PDF (94)
Report (7)
Scripting (83)
Security (32)
Server (119)
Servlet (17)
SOAP (24)
Testing (50)
Web (19)
XML (301)
Other Resources:
Maven Project Build Phases
What are Maven project build phases?
✍: FYIcenter.com
The Maven project build lifecycle has 8 phases:
You can use the phase name as the Maven command: "mvn validate | compile | test | package | integration-test | verify | install | deploy" to drive your project from the frist phase to the given phase.
You can modify the App.java code by changing the output string:
C:\fyicenter>cd hello C:\fyicenter\hello>type src\main\java\com\fyicenter\App.java package com.fyicenter; /** * Hello world! * */ public class App { public static void main( String[] args ) { System.out.println( "Hello World Again!" ); } }
Then try the following Maven phase commands:
C:\fyicenter\hello>\fyicenter\apache-maven-3.5.4\bin\mvn validate [INFO] Scanning for projects... [INFO] [INFO] ------------------------ com.fyicenter:hello >------------------------- [INFO] Building hello 1.0-SNAPSHOT [INFO] --------------------------------[ jar ]--------------------------------- [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 0.160 s [INFO] ------------------------------------------------------------------------ C:\fyicenter\hello>\fyicenter\apache-maven-3.5.4\bin\mvn compile [INFO] Scanning for projects... [INFO] [INFO] ------------------------ com.fyicenter:hello >------------------------- [INFO] Building hello 1.0-SNAPSHOT [INFO] --------------------------------[ jar ]--------------------------------- [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ hello --- [INFO] skip non existing resourceDirectory C:\fyicenter\hello\src\main\resources [INFO] [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ hello --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 1 source file to C:\fyicenter\hello\target\classes [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1.611 s [INFO] ------------------------------------------------------------------------ C:\fyicenter\hello>\fyicenter\apache-maven-3.5.4\bin\mvn test [INFO] Scanning for projects... [INFO] [INFO] ------------------------ com.fyicenter:hello >------------------------- [INFO] Building hello 1.0-SNAPSHOT [INFO] --------------------------------[ jar ]--------------------------------- [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ hello --- [INFO] skip non existing resourceDirectory C:\fyicenter\hello\src\main\resources [INFO] [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ hello --- [INFO] Nothing to compile - all classes are up to date [INFO] [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ hello --- [INFO] skip non existing resourceDirectory C:\fyicenter\hello\src\test\resources [INFO] [INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ hello --- [INFO] Nothing to compile - all classes are up to date [INFO] [INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ hello --- [INFO] Surefire report directory: C:\fyicenter\hello\target\surefire-reports ------------------------------------------------------- T E S T S ------------------------------------------------------- Running com.fyicenter.AppTest Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.017 sec Results : Tests run: 1, Failures: 0, Errors: 0, Skipped: 0 [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 2.256 s [INFO] ------------------------------------------------------------------------
Â
⇒ "mvn clean" - Compile Maven Project
⇠"maven-archetype-quickstart" - Default Java Code
⇑⇑ FAQ for Apache Maven
2020-10-17, 554👍, 0💬
Popular Posts:
JAX-WS is an API for building web services and clients. It is the next generation Web Services API r...
JDK 11 jdk.jshell.jmod is the JMOD file for JDK 11 JShell tool, which can be invoked by the "jshell"...
XOM™ is a new XML object model. It is an open source (LGPL), tree-based API for processing XML with ...
Smack is an Open Source XMPP (Jabber) client library for instant messaging and presence. A pure Java...
XMLSchema, Release 1.4.2, is a lightweight Java object model that can be used to manipulate and gene...