Naming convention for Maven Artifacts

前端 未结 2 975
执笔经年
执笔经年 2020-12-13 05:24

We are currently trying to mavenize the existing projects in our company. We have executed a POC and are currently documenting our learnings and guidelines. I have come up t

2条回答
  •  没有蜡笔的小新
    2020-12-13 05:49

    IMO you need not include org.companyname in the artifactId - it is just duplicating the information already present in the groupId, thus making the artifact names longer and less readable.

    Update: FYI, looking through the dependencies of our project, I see plenty of similar examples, e.g.

    org.apache.maven.plugins
    maven-jar-plugin
    
    org.codehaus.mojo
    jboss-maven-plugin
    
    net.sf.barcode4j
    barcode4j-fop-ext-0.20.5-complete
    
    org.springframework
    spring
    
    opensymphony
    oscache
    
    com.sun.xml.bind
    jaxb-libs
    
    javax.resource
    connector-api
    
    javax.servlet
    jstl
    
    javax.transaction
    jta
    org.hibernate
    hibernate-core
    

    And then there are many where the group and artifact IDs are the same unqualified name, e.g.:

    log4j
    log4j
    
    velocity
    velocity
    
    fop
    fop
    
    commons-lang
    commons-lang
    

    But I haven't seen any having a fully qualified group ID and an identical artifact ID (which e.g. for Log4J would be org.apache.log4j:org.apache.log4j).

提交回复
热议问题