Showing posts with label Maven. Show all posts
Showing posts with label Maven. Show all posts

Tuesday, August 3, 2021

Install Maven on MacOS Catalina

 There might be many ways to install Maven on mac but I found the best way to install maven on mac is to using homebrew:


Step1:  install homebrews (if you don't have already)

Follow this URL : how-to-install-homebrew-on-mac


Step 2 : Install Maven:

https://mkyong.com/maven/install-maven-on-mac-osx/


Extra tips.

Where I can find maven local repository:

>> ~/.m2

Saturday, October 13, 2018

Maven: Standard Directory Structure

If we want to understand how maven works you need to understand about Maven Standard Directory Structure.

https://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html

https://www.baeldung.com/maven-directory-structure



Friday, October 12, 2018

Maven: How to create executable JAR

If you want to  work on  Java world you must learn maven. in this article I will show how you can create an executable JAR file using maven.

For now i am using the reference of the following article.

https://www.baeldung.com/executable-jar-with-maven

Thursday, August 9, 2018

Maven: Basics


Why Maven?

Let's look what are the things a everyday developer does:

1. Write Code
2, Add library to the Project
2. Compile Code
3. Run unit test
4. Package Code  (Jar,War,Ear etc)
5. Deploy the binary to to Production or Test environment (Tomcat Jetty etc)

This whole thing can be automated using Maven.


Concept Must Understand :


1. POM(Project Object Model)
2. Super POM
3.Parent POM
4.Plug-in
5.Repository
6.Dependency
7.Transitive Dependencies
8.Maven Archetypes
9. Maven Directory Structure





Important Notes: If you execute any command in the life cycle maven will execute all the prior commands before executing the command. for example if you run "Test" Command maven will first run validate and compile command then it will run the Test Command .


Good to know Maven Concept :

1. Scope of a Dependency
2. Effective POM
4. Effective Settings
5. Dependency Hierarchy
6. Versioning of Dependency
7. Plug-in Goals
8. Plug-in Phase
9.Multi Module Maven Project

will continue...



Monday, August 6, 2018

Maven: Difference between plugins and dependencies


In Maven POM file we can define both plugins and dependencies which could be little confusing
sometime to understand the difference.



Both plugins and dependencies are Jar files.
But the difference between them is, most of the work in maven is done using plugins; whereas dependency is just a Jar file which will be added to the classpath while executing the tasks.
For example, you use a compiler-plugin to compile the java files. You can't use compiler-plugin as a dependency since that will only add the plugin to the classpath, and will not trigger any compilation. The Jar files to be added to the classpath while compiling the file, will be specified as a dependency.
Same goes with your scenario. You have to use spring-plugin to execute some spring executables [ I'm not sure what spring-plugins are used for. I'm just taking a guess here ]. But you need dependencies to execute those executables. And Junit is tagged under dependency since it is used by surefire-plugin for executing unit-tests.
So, we can say, plugin is a Jar file which executes the task, and dependency is a Jar which provides the class files to execute the task.

Monday, April 23, 2018

Install Maven in CentOS 7


Step 1: Add maven to the yum libraries:


wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo

Step 2: Install maven using the following command :


sudo yum install apache-maven


Done!


Check if maven installed correctly 

mvn -version 

5 Strategies for Getting More Work Done in Less Time

Summary.    You’ve got more to do than could possibly get done with your current work style. You’ve prioritized. You’ve planned. You’ve dele...