Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

maven dependency.systemPath must specify an absolute path

Tags:

maven

I get the below error with maven

[WARNING] The POM for com.something:dependency_module:jar:103 is invalid, transitive dependencies (if any) will not be available: 2 problems were encountered while building the effective model for something:dependency_module:103  
[ERROR] 'dependencies.dependency.systemPath' for org.jacorb:jacorb:jar must specify an absolute path but is ${jacorb2.3.1.home}/lib/jacorb.jar @  
[ERROR] 'dependencyManagement.dependencies.dependency.systemPath' for org.jacorb:jacorb:jar must specify an absolute path but is ${jacorb2.3.1.home}/lib/jacorb.jar @

The problem seems to be that ${jacorb2.3.1.home} is not resolved. But the variable is actually set in the settings.xml.

<profile>
    <id>jacorb2.3.1</id>
    <properties>
         <jacorb2.3.1.home>C:\apps\jacorb-2.3.1\</jacorb2.3.1.home>
    </properties>
</profile>

Infact, project actually compiles fine. It seems to throw this error only while reading the POM of the dependent modules.

Please help me understand why this is happening and how to resolve it.

(Note: adding a property within dependent module POM seems to resolve this issue but I dont want to hardcode path within the project settings)

like image 930
Kiran Mohan Avatar asked Feb 04 '14 08:02

Kiran Mohan


1 Answers

Usually you only use systemPath for things like the tools jar in javahome.

In order to support location transparency and repeatable builds, anything inside a systemPath is extremely local.

Normally I would add 3rd party libraries in either a shared local repository (nexus or artifactory) or just install them locally with mvn install:install (Probably create a shell script so others can do the same on their build). Needless to say the first is the most sustainable solution.

http://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html

like image 150
Niels Bech Nielsen Avatar answered Sep 20 '22 16:09

Niels Bech Nielsen