How to Search Maven Coordinates or Dependecy details-POM.XML

How to Search Maven Coordinates or Dependecy details-POM.XML

If you want to add a dependency in your maven project , you should know the dependency details to add in POM.XML file of your project.

Then here where we will get stuck usually . We just know which jar or dependency is required that to be added , but we don't know the dependency details.

For any dependency to be added in your POM.XML file we should following three values.

  1. GroupId (Package name)
  2. ArtifactId (Dependency name)
  3. Version (Dependency Version)

You can know the above details by visiting maven central repository site.

Click here : Search in Maven Central Repository

Just type your dependency name , you will get a list of related dependencies with different versions.

You can see the GroupId , Artifact Id and version details .

Click on your required thing and download it and add dependency details in your POM.XML

For example :

For log4j :
<!-- Log4j details -->
<dependency>
 <groupId>org.apache.logging.log4j</groupId>
 <artifactId>log4j</artifactId>
 <version>2.8.2</version>
</dependency>

Search results for log4j in central repository.

Click on version to more details as below.

In similar way search any dependency you needed in central repository and add in your pom.xml . maven will download it and will keep it in your local repository.

Hope this is helpful..........!!!!Thank You.

JAVA CODE SNIPPET-7

JAVA CODE SNIPPET-7
/**
 * 
 */
package techyield;

/**
 * @author satyanarayana gokavarapu
 *
 */
public class Super {
 void init( long a,long b)
 {
  System.out.println("Super class long,long method.");
 }
 void init( Long a,Long b)
 {
  System.out.println("Super class Long,Long method.");
 }
}
package techyield;
/**
 * @author satyanarayana gokavarapu
 *
 */
public class Test extends Super{

 public static void main(String[] args) {
  // TODO Auto-generated method stub
  Super object = new Test();
  object.init(2,3);
 }
 void init( int a,int b)
 {
  System.out.println("Test class int,int method.");
 }
 void init(int... a)
 {
  System.out.println("Test class varargs method.");
 }
 void init( long a,long b)
 {
  System.out.println("Test class long,long method.");
 }
}

Select an answer





Please comment below if you have any doubts.

JAVA CODE SNIPPET-10

Java Code Snippet-10
/**
 * 
 */
package techyield;

/**
 * @author satyanarayana gokavarapu
 *
 */
public class Node {

 public Node(int i) {
  System.out.println("In Node class parameterized constructor "+i);
 }

}
package techyield;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
 * @author satyanarayana gokavarapu
 *
 */
public class Test{

 public static void main(String[] args) {
  // TODO Auto-generated method stub

  List list = new ArrayList();
  list.add(new Node(10));
  list.add(new String("Krishna"));
  System.out.println(list.get(1)); 

  Set set = new HashSet();
  set.add(new Node(1));
  set.add(new Node(2));
  set.add(new Node(2));
  System.out.println("Length of set is "+set.size());
 }


}

Select an answer





Please comment below if you have any doubts.

JAVA CODE SNIPPET-9

JAVA CODE SNIPPET-9
package techyield;
/**
 * @author satyanarayana gokavarapu
 *
 */
public class Test{

 public static void main(String[] args) {
  // TODO Auto-generated method stub
  Test object = new Test();
  int value=4;
  object.init(value,value);
 }
 void init( Long a,Long b)
 {
  System.out.println("Test class Long,Long method.");
 }
 void init(int... a)
 {
  System.out.println("Test class varargs method.");
 }
}

Select an answer





Please comment below if you have any doubts.

JAVA CODE SNIPPET-8

JAVA CODE SNIPPET-8
package techyield;
/**
 * @author satyanarayana gokavarapu
 *
 */
public class Test{

 public static void main(String[] args) {
  // TODO Auto-generated method stub
  Test object = new Test();
  int value=4;
  object.init(value,value);
 }
 void init( Long a,Long b)
 {
  System.out.println("Test class Long,Long method.");
 }
 void init(int... a)
 {
  System.out.println("Test class varargs method.");
 }
 void init( long a,long b)
 {
  System.out.println("Test class long,long method.");
 }
}

Select an answer





Please comment below if you have any doubts.

JAVA CODE SNIPPET-6

Java Code Snippet-6
/**
 * 
 */
package techyield;

/**
 * @author satyanarayana gokavarapu
 *
 */
public class Super {
 void init( long a,long b)
 {
  System.out.println("Super class long,long method.");
 }
 void init( Long a,Long b)
 {
  System.out.println("Super class Long,Long method.");
 }
}
package techyield;
/**
 * @author satyanarayana gokavarapu
 *
 */
public class Test extends Super{

 public static void main(String[] args) {
  // TODO Auto-generated method stub
  Super object = new Test();
  object.init(2,3);
 }
 void init( int a,int b)
 {
  System.out.println("Test class int,int method.");
 }
 void init(int... a)
 {
  System.out.println("Test class varargs method.");
 }
}

Select an answer





Please comment below if you have any doubts.

JAVA CODE SNIPPET-5

Java Code Snippet-5
/**
 * 
 */
package techyield;

/**
 * @author satyanarayana gokavarapu
 *
 */
public class Super {
 void init( int a,int b)
 {
  System.out.println("Super class int,int method.");
 }
 void init( long a,long b)
 {
  System.out.println("Super class long,long method.");
 }
 void init( Long a,Long b)
 {
  System.out.println("Super class Long,Long method.");
 }
}
package techyield;
/**
 * @author satyanarayana gokavarapu
 *
 */
public class Test extends Super{

 public static void main(String[] args) {
  // TODO Auto-generated method stub
  Test object = new Test();
  object.init(2,3);
 }
 void init(int... a)
 {
  System.out.println("Test class varargs method.");
 }
}

Select an answer





Please comment below if you have any doubts.

Featured Post

H1B Visa Stamping at US Consulate

  H1B Visa Stamping at US Consulate If you are outside of the US, you need to apply for US Visa at a US Consulate or a US Embassy and get H1...