Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error in pom.xml

I am getting an error as below:

For dependency Dependency {groupId=weblogic, artifactId=webservices, version=9.2, type=jar}: system- scoped dependency must specify an absolute path system Path

Not sure what is wrong. I have the environment variable configured which I am using in pom.xml

like image 614
sab Avatar asked Jul 01 '11 15:07

sab


People also ask

How do you fix the first line error in POM xml?

Right click on Springboot Application>>Maven>>update project. The error sign from your pom. xml will go away.


2 Answers

When using system scope you have to provide an absolute path to the dependency (as opposed to any other dependencies, which are searched in Maven repositories). See System Dependencies in Introduction to the Dependency Mechanism.

Example:

<dependency>
  <groupId>javax.sql</groupId>
  <artifactId>jdbc-stdext</artifactId>
  <version>2.0</version>
  <scope>system</scope>
  <systemPath>${java.home}/lib/rt.jar</systemPath>
</dependency>

Why don't you just install your third-party artifact in your local/company repository?

EDIT: If you have systemPath defined but suspect that environment variable is not resolved, you will get the following error (note the presence of variable in the path):

The project ... has 1 error
'dependencies.dependency.systemPath' for weblogic:webservices:jar must specify an absolute path but is ${env.BEA_HOME}/lib/xyz.jar @ line ...

But if Maven discovers the variable and resolves it properly, the error message quoted above will contain already resolved directory (not a placeholder). Tested on Ubuntu/Maven 3.

like image 188
Tomasz Nurkiewicz Avatar answered Sep 26 '22 23:09

Tomasz Nurkiewicz


Can you post your 'Dependency' element from the pom?

Guessing that it's of scope 'system' and that there's a path in there, and that path is a relative path (eg '../../someJar.jar') instead of an absolute path (eg /opt/someDir/someJar.jar).

Maven needs an absolute path.

As a side note, you might want to look in to creating a local shared repository for non-public shared jars and steer away from the 'system' scope. System scope can bite you on the rear when the build is done in other environments.

like image 23
Roy Truelove Avatar answered Sep 26 '22 23:09

Roy Truelove