0

I have a custom dependency for my project, api-client. This dependency is used to connect among multiple modules within my project.

The problem is, if I make any changes in my api-client dependency and I produce a .jar file using the below command:

mvn install -Dmaven.test.skip=true

I will place that .jar file in my .m2 repository manually. Afterwards, if I try to run other modules which depends on api-client, those modules would throw lots of compilation errors. (Previously, all ran successfully.)

Some of the sample errors are as follows:

[ERROR] /C:/Local/core/src/main/java/com/core/service/impl/DBSClaimServiceImpl.java:[33,39] C:\Local\core\src\main\java\com\core\service\impl\DBSClaimServiceImpl.java:33: package org.apache.commons.lang3 does not exist
[ERROR] /C:/Local/core/src/main/java/com/core/service/impl/DBSClaimServiceImpl.java:[33,1] C:\Local\core\src\main\java\com\core\service\impl\DBSClaimServiceImpl.java:33: static import only from classes and interfaces
[ERROR] /C:/Local/core/src/main/java/com/core/model/Dealer.java:[9,39] C:\Local\core\src\main\java\com\core\model\Dealer.java:9: package org.apache.commons.lang3 does not exist
[ERROR] /C:/Local/core/src/main/java/com/core/model/Dealer.java:[9,1] C:\Local\core\src\main\java\com\core\model\Dealer.java:9: static import only from classes and interfaces
[ERROR] /C:/Local/core/src/main/java/com/core/resource/settlement/flatFile/RecordType1ClaimInformation.java:[10,39] C:\Local\core\src\main\java\com\core\resource\settlement\flatFile\RecordType1ClaimInformation.java:10: package org.apache.commons.lang3 does not exist

All the packages are available in my local repository, but still, it is not recognising them. I am unsure what exactly the problem is here.

Below please find entries that I have in one of the module:

<api.version>1.0.245</api.version>
<api.client.version>1.0.292</api.client.version>

The problem started once I changed the above version (api.client.version). After that, an old version also throws the same error.

wandersick
  • 127
  • 7
Karthikeyan
  • 93
  • 3
  • 14
  • Possible duplicate of [Maven - Transitive dependencies are not resolved for artifact deployed on Artifactory](https://stackoverflow.com/questions/43999612/maven-transitive-dependencies-are-not-resolved-for-artifact-deployed-on-artifa) – tkruse Jun 23 '19 at 07:48

1 Answers1

0

To resolve transitive dependencies, other modules do not just need the api-client.jar, but also a generated pom.xml which declares what other jars are needed to use api-client.jar.

There are multiple ways to fix this, but the description of your environment is not detailed enough to tell how best to fix this.

tkruse
  • 10,222
  • 7
  • 53
  • 80