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.

Related Posts:

  • System.out.println() System.out.println(). Simply SOP System:  is a final class in java.lang package. This class has methods to provide access to Standard Input, Standard Output and Standard Error Output streams. Can not be instantiated. ou… Read More
  • Java Database Connectivity(JDBC) JDBC: is an acronym for 'Java Data Base Connectivity'. It is used for accessing the databases from Java Applications. JDBC API allows to do CRUD operations on Database. Steps to connectivity between Java program and Dat… Read More
  • String Reverse Example public class StringReverse { public static void main(String[] args) { String str="selenium",reverse=""; for(int i=str.length()-1;i>=0;i--) { reverse=reverse+str.charAt(i… Read More
  • Hashmap vs Hashtable Difference between Hashmap and Hashtable? HashMap is non-synchronized. Hashtable is synchronized.  HashMap allows multiple threads where as hashtable doesn't HashMap is not thread-safe where as hashtable is. HashMap … Read More
  • TestNG Annotations What is TesNG and What are the annotations in the TestNG?      Ans: TestNG is testing framework to run the test cases. TestNG supports annotations like:       @BeforeSuite       &… Read More

0 comments:

Post a Comment

Selenium Training in Realtime

Blog helps to a student or IT employee to develop or improve skills in Software Testing.

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