0

I have a maven based project. And I have few dependencies that are our custom dependencies.

Now till now, if I add these dependencies in java build path and make their entry in pom file using

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

And make project build then it works fine.

But as I tried by removing its entry in pom file, as I have already added in java build path build fails with error's package com.abc does not exist

I want to know why it is failing as by adding entries in java build path in dynamic java project (not maven), it works fine and build gets created.

I have dependency like this enter image description here

John
  • 276
  • 1
  • 9
  • 29

1 Answers1

2

Maven wants dependencies in repositories. Using the system scope will cause interesting forms of pain down the road!

First, if you can locate mavenized versions of the jars you use, then switch to those. If not, then install them to your local repository (.m2 folder) with mvn install:install-fileor your in-house Maven repository (Nexus, Artifactory etc).

At the time where I had a similar situation I ended up doing the install as part of the build which worked well as a temporary solution. You can see the accepted answer at https://stackoverflow.com/a/10803426/53897

Thorbjørn Ravn Andersen
  • 73,784
  • 33
  • 194
  • 347