Thursday, January 17, 2019

A Project Object Model or POM is the fundamental unit of work in Maven. It contains the project configuration details used by Maven.
Some of the configuration that can be specified in the POM are the project dependencies, the plugins or goals that can be executed, the build profiles, and so on.
The minimum requirement for a POM are the following:
  • project root
  • modelVersion - should be set to 4.0.0
  • groupId - the id of the project's group.
  • artifactId - the id of the artifact (project)
  • version - the version of the artifact under the specified group
Here's an example:
  1. <project>
  2. <modelVersion>4.0.0</modelVersion>
  3. <groupId>com.mycompany.app</groupId>
  4. <artifactId>my-app</artifactId>
  5. <version>1</version>
  6. </project>
Maven Version Range in Dependencies:
Upgrading Maven dependencies manually has always been a tedious work, especially in projects with a lot of libraries releasing frequently.
Developers could specify version ranges within which the artifacts would’ve been upgraded without the need of a manual intervention.
Version requirements have the following syntax: ('x' represents version)

  • 1.0 -> "Soft" requirement on 1.0 (just a recommendation, if it matches all other ranges for the dependency)
  • [1.0]: -> "Hard" requirement on 1.0
  • (,1.0]: -> x <= 1.0
  • [1.5,): -> x >= 1.5
  • [1.2,1.3]: -> 1.2 <= x <= 1.3
  • [1.0,2.0): -> 1.0 <= x < 2.0
  • (,1.0],[1.2,): -> x <= 1.0 or x >= 1.2; multiple sets are comma-separated
  • (,1.1),(1.1,): -> this excludes 1.1 (for example if it is known not to work in combination with this library)
A square bracket ( [ & ] ) means "closed" (inclusive).
A parenthesis ( ( & ) ) means "open" (exclusive).
Maven2 has provided two special metaversion values to achieve the result: LATEST and RELEASE.
They’ve been deprecated and completely removed in Maven3 for the sake of reproducible builds.
Note: When you release a software, you should always make sure that your project depends on specific versions to reduce the chances of your build or your project being affected by a software release not under your control.

0 comments:

Post a Comment

selenium-repo by venu

Blog helps to a student or IT employee to develop or improve skills in Software Testing.
For Online Classes Email us: gadiparthi122@mail.com

Followers

About Me

My photo
Hyderabad, Andhra Pradesh, India
I am Automation Testing Professional. I have completed my graduation in B.Tech (Computers) from JNTU Hyderabad and started my career in Software Testing accidentally since then, I passionate on learning new technologies

Contact Form

Name

Email *

Message *

Popular Posts