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
Right click on Springboot Application>>Maven>>update project. The error sign from your pom. xml will go away.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With