Friday, 1 December 2017

Introduction to Maven Pom structure

Taking the example of a simple pom shown in [1] we analyze in detail its content:
  • project tag is the top-level element in all pom.xml files.
  • modelVersion tag indicates what version of the object model this pom is using.
  • groupId tag indicates the unique identifier of the organization or group that created the project.
  • artifactId tag indicates the unique base name of the primary artifact being generated by this project.
  • packaging tag indicates the package type to be used by this artifact (e.g. JAR, WAR, EAR, etc.). If this tag is not present so the default value is jar.
  • version tag indicates the version of the artifact generated by the project.
  • name tag indicates the display name used for the project.
  • url tag indicates where the project's site can be found.
  • description tag provides a basic description of your project.
Name, url and description tags are often used in Maven's generated documentation.
Instead the dependencies tag contains the dependency list, in our example there is just junit dependency. A dependency is structured as:
 <dependency>
        <groupId>${mydependency.groupId}</groupId>
        <artifactId>${mydependency.artifactId}</artifactId>
        <version>${mydependency.version}</version>
        <scope>${mydependency.scope}</scope>
        <type>${mydependecy.type}</type> 
 </dependency>
Scope and type are optional, (if it is not present) the default value for scope is "compile". The default value for type is "jar". More details will provided in future posts.

Internal Links

No comments:

Post a Comment

Welcome

Hello everybody, Welcome in my blog called "Information technology archive". Obviously the topics will be related to Informatio...