Hi all, 
My projects are organized in a standard way with a top level pom that
lists out the general dependencies and versions to be used for all the
child projects that would inherit from it. However, i am facing a
situation where i need a different version of a particular dependency in
a particular child project. To be particular, all my projects depend on
testng version 5.1 and one particular child project needs a dependency
on version 5.7. When i tried adding this dependency explicitly to the
child pom, it fails with a missing dependency error for " 

1) org.testng:testng:jar:5.7

". However, the maven repository has testng version 5.7 jars available
in it and it is able to download it when i change the version directly
in the parent pom. Can somebody let me know the reason for such a thing
happening? 

 

Parent pom:

<dependencies>
  <dependency>
   <groupId>org.testng</groupId>
   <artifactId>testng</artifactId>
   <version>5.1</version>
   <classifier>jdk15</classifier>
  </dependency>
 </dependencies>

 

Child pom:

<dependency>
   <groupId>org.testng</groupId>
   <artifactId>testng</artifactId>
   <version>5.7</version>
   <classifier>jdk15</classifier>
  </dependency>

Error while building the child pom:

INFO] Failed to resolve artifact.

Missing:

----------

1) org.testng:testng:jar:5.7

Try downloading the file manually from: 

http://testng.org

Then, install it using the command: 

mvn install:install-file -DgroupId=org.testng -DartifactId=testng
-Dversion=5.7 -Dpackaging=jar -Dfile=/path/to/file

Alternatively, if you host your own repository you can deploy the file
there: 

mvn deploy:deploy-file -DgroupId=org.testng -DartifactId=testng
-Dversion=5.7 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url]
-DrepositoryId=[id]

 

 

Thanks, 

Ravi


 

Reply via email to