Sl Home Fashions 4pc Maven Comforter Set
If you are working on Java, y'all must know Maven. Maven is the most popular projection and dependency management tool for Java applications. Maven provides a lot of commands and options to assist us in our 24-hour interval to day tasks.
Maven Commands
Permit'southward wait into some pop and must know maven commands. We will use a sample Maven project to showcase the command output.
1. mvn clean
This command cleans the maven project by deleting the target directory. The command output relevant letters are shown below.
$ mvn clean ... [INFO] --- maven-clean-plugin:ii.5:clean (default-make clean) @ maven-example-jar --- [INFO] Deleting /Users/pankaj/Desktop/maven-examples/maven-instance-jar/target ... $
2. mvn compiler:compile
This command compiles the java source classes of the maven project.
$ mvn compiler:compile ... [INFO] --- maven-compiler-plugin:3.viii.1:compile (default-cli) @ maven-example-jar --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 1 source file to /Users/pankaj/Desktop/maven-examples/maven-instance-jar/target/classes ... $
3. mvn compiler:testCompile
This command compiles the test classes of the maven project.
$ mvn compiler:testCompile ... [INFO] --- maven-compiler-plugin:3.8.ane:testCompile (default-cli) @ maven-example-jar --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 1 source file to /Users/pankaj/Desktop/maven-examples/maven-instance-jar/target/test-classes ... $
4. mvn bundle
This command builds the maven project and packages them into a JAR, WAR, etc.
$ mvn bundle ... [INFO] --- maven-compiler-plugin:3.8.ane:compile (default-compile) @ maven-example-jar --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 1 source file to /Users/pankaj/Desktop/maven-examples/maven-example-jar/target/classes ... [INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ maven-example-jar --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 1 source file to /Users/pankaj/Desktop/maven-examples/maven-example-jar/target/test-classes [INFO] [INFO] --- maven-surefire-plugin:ii.12.4:test (default-test) @ maven-example-jar --- [INFO] Surefire report directory: /Users/pankaj/Desktop/maven-examples/maven-example-jar/target/surefire-reports ------------------------------------------------------- T Eastward Southward T S ------------------------------------------------------- Running com.journaldev.maven.classes.AppTest Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.005 sec Results : Tests run: 1, Failures: 0, Errors: 0, Skipped: 0 [INFO] [INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ maven-case-jar --- [INFO] Building jar: /Users/pankaj/Desktop/maven-examples/maven-case-jar/target/maven-case-jar-0.0.1-SNAPSHOT.jar [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS ...
The output shows the location of the JAR file simply before the "BUILD SUCCESS" message. Notice the package goal executes compile, testCompile, and test goals before packaging the build.
five. mvn install
This command builds the maven project and installs the projection files (JAR, WAR, pom.xml, etc) to the local repository.
$ mvn install ... [INFO] --- maven-resources-plugin:two.6:resources (default-resources) @ maven-instance-jar --- ... [INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ maven-example-jar --- ... [INFO] --- maven-resource-plugin:2.6:testResources (default-testResources) @ maven-case-jar --- ... [INFO] --- maven-compiler-plugin:3.eight.1:testCompile (default-testCompile) @ maven-example-jar --- ... [INFO] --- maven-surefire-plugin:ii.12.4:test (default-test) @ maven-case-jar --- ... [INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ maven-example-jar --- ... [INFO] --- maven-install-plugin:2.4:install (default-install) @ maven-example-jar --- [INFO] Installing /Users/pankaj/Desktop/maven-examples/maven-example-jar/target/maven-example-jar-0.0.1-SNAPSHOT.jar to /Users/pankaj/.m2/repository/com/journaldev/maven/maven-example-jar/0.0.1-SNAPSHOT/maven-example-jar-0.0.1-SNAPSHOT.jar [INFO] Installing /Users/pankaj/Desktop/maven-examples/maven-example-jar/pom.xml to /Users/pankaj/.m2/repository/com/journaldev/maven/maven-case-jar/0.0.one-SNAPSHOT/maven-example-jar-0.0.1-SNAPSHOT.pom ...
6. mvn deploy
This command is used to deploy the artifact to the remote repository. The remote repository should be configured properly in the project pom.xml file distributionManagement tag. The server entries in the maven settings.xml file is used to provide authentication details.
vii. mvn validate
This command validates the maven project that everything is right and all the necessary information is available.
8. mvn dependency:tree
This command generates the dependency tree of the maven project.
$ mvn dependency:tree ... [INFO] --- maven-dependency-plugin:ii.8:tree (default-cli) @ Mockito-Examples --- [INFO] com.journaldev.mockito:Mockito-Examples:jar:i.0-SNAPSHOT [INFO] +- org.junit.platform:junit-platform-runner:jar:1.2.0:exam [INFO] | +- org.apiguardian:apiguardian-api:jar:1.0.0:examination [INFO] | +- org.junit.platform:junit-platform-launcher:jar:one.ii.0:exam [INFO] | \- org.junit.platform:junit-platform-suite-api:jar:1.ii.0:test [INFO] | \- org.junit.platform:junit-platform-eatables:jar:one.2.0:test [INFO] +- org.junit.jupiter:junit-jupiter-engine:jar:v.ii.0:test [INFO] | +- org.junit.platform:junit-platform-engine:jar:1.2.0:exam [INFO] | | \- org.opentest4j:opentest4j:jar:ane.1.0:examination [INFO] | \- org.junit.jupiter:junit-jupiter-api:jar:5.two.0:exam [INFO] +- org.mockito:mockito-junit-jupiter:jar:2.nineteen.0:test [INFO] | \- org.mockito:mockito-core:jar:2.19.0:test [INFO] | +- net.bytebuddy:byte-buddy:jar:1.8.10:exam [INFO] | +- internet.bytebuddy:byte-buddy-agent:jar:1.8.10:test [INFO] | \- org.objenesis:objenesis:jar:2.half-dozen:test [INFO] \- org.testng:testng:jar:6.xiv.3:examination [INFO] +- com.beust:jcommander:jar:1.72:test [INFO] \- org.apache-extras.beanshell:bsh:jar:ii.0b6:test
nine. mvn dependency:analyze
This command analyzes the maven project to identify the unused declared and used undeclared dependencies. Information technology's useful in reducing the build size past identifying the unused dependencies and so remove information technology from the pom.xml file.
$ mvn dependency:analyze ... [INFO] --- maven-dependency-plugin:2.8:clarify (default-cli) @ Mockito-Examples --- [Alert] Used undeclared dependencies plant: [WARNING] org.junit.jupiter:junit-jupiter-api:jar:five.2.0:test [Warning] org.mockito:mockito-core:jar:two.19.0:exam [Warning] Unused declared dependencies found: [Warning] org.junit.platform:junit-platform-runner:jar:1.2.0:examination [WARNING] org.junit.jupiter:junit-jupiter-engine:jar:5.ii.0:exam [Alarm] org.mockito:mockito-junit-jupiter:jar:ii.xix.0:test ... $
10. mvn archetype:generate
Maven archetypes is a maven projection templating toolkit. We can use this command to generate a skeleton maven project of different types, such as JAR, web application, maven site, etc.
Recommended Reading: Creating a Java Projection using Maven Archetypes
11. mvn site:site
This control generates a site for the project. You will discover a "site" directory in the target after executing this command. There will be multiple HTML files inside the site directory that provides information related to the project.
12. mvn test
This control is used to run the examination cases of the project using the maven-surefire-plugin
.
$ mvn test ... [INFO] --- maven-surefire-plugin:2.22.0:exam (default-test) @ Mockito-Examples --- [INFO] [INFO] ------------------------------------------------------- [INFO] T East Southward T S [INFO] ------------------------------------------------------- [INFO] Running TestSuite first-element second-element Employee setName Argument = Pankaj ... [INFO] Results: [INFO] [INFO] Tests run: five, Failures: 0, Errors: 0, Skipped: 0 ... $
13. mvn compile
It'south used to compile the source Java classes of the project.
$ mvn compile ... [INFO] --- maven-compiler-plugin:iii.7.0:compile (default-compile) @ Mockito-Examples --- [INFO] Changes detected - recompiling the module! [Alarm] File encoding has non been prepare, using platform encoding UTF-eight, i.e. build is platform dependent! [INFO] Compiling 10 source files to /Users/pankaj/Desktop/maven-examples/Mockito-Examples/target/classes ... $
fourteen. mvn verify
This control build the project, runs all the test cases and run whatever checks on the results of the integration tests to ensure quality criteria are met.
Maven Options
Maven provides a lot of command-line options to change the maven build process. Let's look at some of the of import maven options.
15. mvn -help
This command prints the maven usage and all the available options for us to use.
sixteen. mvn -f maven-example-jar/pom.xml package
This control is used to build a project from a different location. We are providing the pom.xml file location to build the project. It's useful when you accept to run a maven build from a script.
17. mvn -o bundle
This control is used to run the maven build in the offline fashion. Information technology's useful when we have all the required JARs download in the local repository and we don't want Maven to await for whatever JARs in the remote repository.
18. mvn -q packet
Runs the maven build in the quiet mode, simply the examination cases results and errors are displayed.
$ mvn -q package ------------------------------------------------------- T Eastward S T S ------------------------------------------------------- Running com.journaldev.maven.classes.AppTest Tests run: one, Failures: 0, Errors: 0, Skipped: 0, Fourth dimension elapsed: 0.006 sec Results : Tests run: i, Failures: 0, Errors: 0, Skipped: 0 $
19. mvn -10 package
Prints the maven version and runs the build in the debug mode. It's opposite of the quiet mode and you will run across a lot of debug messages in the console.
twenty. mvn -v
Used to brandish the maven version data.
$ mvn -v Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f) Maven habitation: /Users/pankaj/Downloads/apache-maven-3.6.3 Java version: 13.0.1, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk-thirteen.0.ane.jdk/Contents/Home Default locale: en_IN, platform encoding: UTF-viii Bone proper noun: "mac os x", version: "10.15.i", curvation: "x86_64", family: "mac" $
21. mvn -Five package
This control prints the maven version and then continue with the build. It'southward equivalent to the commands mvn -five;mvn parcel
.
22. mvn -DskipTests package
The skipTests
organization property is used to skip the unit test cases from the build bike. We can likewise utilize -Dmaven.test.skip=true
to skip the examination cases execution.
23. mvn -T 4 packet
This command tells maven to run parallel builds using the specified thread count. It's useful in multiple module projects where modules can exist built in parallel. It can reduce the build time of the project.
Maven Commands Crook Sheet
References
- Maven Plugins
- Maven CLI Options Reference
0 Response to "Sl Home Fashions 4pc Maven Comforter Set"
Post a Comment