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 the following naming convention for the maven artifacts. Please share your comments on the same
Note: In our company, projectname is always unique
eg : org.companyname.projectname:org.companyname.projectname-1.0.0.pom
eg: org.companyname.projectname:org.companyname.projectname.modulename-1.0.0.jar
eg : org.companyname.projectname:org.companyname.projectname-1.0.0.pom
eg : org.companyname.projectname:org.companyname.projectname.subcategory-1.0.0.pom
eg : org.companyname.projectname:org.companyname.projectname.subcategory.modulename-1.0.0.jar
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.
<groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <groupId>org.codehaus.mojo</groupId> <artifactId>jboss-maven-plugin</artifactId> <groupId>net.sf.barcode4j</groupId> <artifactId>barcode4j-fop-ext-0.20.5-complete</artifactId> <groupId>org.springframework</groupId> <artifactId>spring</artifactId> <groupId>opensymphony</groupId> <artifactId>oscache</artifactId> <groupId>com.sun.xml.bind</groupId> <artifactId>jaxb-libs</artifactId> <groupId>javax.resource</groupId> <artifactId>connector-api</artifactId> <groupId>javax.servlet</groupId> <artifactId>jstl</artifactId> <groupId>javax.transaction</groupId> <artifactId>jta</artifactId> <groupId>org.hibernate</groupId> <artifactId>hibernate-core</artifactId>
And then there are many where the group and artifact IDs are the same unqualified name, e.g.:
<groupId>log4j</groupId> <artifactId>log4j</artifactId> <groupId>velocity</groupId> <artifactId>velocity</artifactId> <groupId>fop</groupId> <artifactId>fop</artifactId> <groupId>commons-lang</groupId> <artifactId>commons-lang</artifactId>
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
).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With