Maven - How to find correct groupId/artifactId to include dependency in POM

后端 未结 7 1575
隐瞒了意图╮
隐瞒了意图╮ 2020-12-29 04:31

In general, what is the best strategy for finding the groupId and artifactId for a well-known dependency for use in a Maven POM? For example, how would I find the correct en

相关标签:
7条回答
  • 2020-12-29 04:41

    Maven site suggests to browse biblio to get maven co-ordinates; http://www.ibiblio.org/ .

    Say for log4j

    First, we need to know what the groupId, artifactId, and version are for log4j. We can browse ibiblio and look for it, or use Google to help by searching for "site:www.ibiblio.org maven2 log4j".

    Maven metadata for log4j: http://mirrors.ibiblio.org/maven2/log4j/log4j/maven-metadata.xml

    0 讨论(0)
  • 2020-12-29 04:42

    M2Eclipse, the maven integration of eclipse, supports local searchable indexes of maven repositories. So you can right-click a project or a pom.xml and do

    Maven -> Add Dependency
    

    A dialog appears where you can search for artifacts from your local indexes. Wouldn't want to miss it.

    If that's not an option, use mvnrepository.com

    0 讨论(0)
  • 2020-12-29 04:44

    I would suggest to use http://search.maven.org

    0 讨论(0)
  • 2020-12-29 04:47

    I use http://repository.sonatype.org.

    0 讨论(0)
  • 2020-12-29 04:49

    1. Go to http://search.maven.org

    2. Search in the required jar with groupId/artifactId or Just with basic text.

    Like for your case

    0 讨论(0)
  • 2020-12-29 04:54

    Most of the time my IDE does this for me. But when I'm not sure I search manually; Google really helps.

    You can also search on maven search engines like this mvnrepository.com.

    0 讨论(0)
提交回复
热议问题