0

I am having a trouble while building my java maven project in jenkins. In my project, there are few custom jars which I included in pom like this

     <dependency>
        <groupId>SMSGatewayClient</groupId>
        <artifactId>SMSGatewayClient</artifactId>
        <scope>system</scope>
        <version>1.0</version>
        <systemPath>${basedir}\lib\SMSGatewayClient.jar</systemPath>
    </dependency>

But jenkins throwing exception

"Could not find artifact SMSGatewayClient:SMSGatewayClient:jar:1.0 at specified path /var/lib/jenkins/workspace/DEV-metal-auc/MetalBusiness_mvn\lib\SMSGatewayClient.jar"

and build is stopped.

How can I use that custom jar so that jenkins builds successfully?

Tajinder
  • 1,998
  • 1
  • 25
  • 43

1 Answers1

0

Have you tried using ”/" path separators (or ${file.separator} ) in the path?

Your error shows a mix and /var/lib/ suggests you are on unix.

That assumes the ${basedir} resolved correctly.

You can also use relative notation ( ../ ) and is probably preferred if inside your workspace. You may wish to review Maven complaining about parent relative path and Maven: add a dependency to a jar by relative path

In maven, "${basedir} represents the directory containing pom.xml", so <relativePath>./lib</relativePath>. If you had to fo up,and down, ../ for each level up, then path down.

Ian W
  • 2,410
  • 2
  • 13
  • 24