Incorrect system dependency results the compile-dependent libraries not be
included into war
--------------------------------------------------------------------------------------------
Key: MNG-2785
URL: http://jira.codehaus.org/browse/MNG-2785
Project: Maven 2
Issue Type: Bug
Affects Versions: 2.0.4
Environment: $ java -version
java version "1.5.0_04"
$ mvn -v
Maven version: 2.0.4
Reporter: Dmitry Katsubo
I want to build a .war file in {{frontend}} project, that depends on
{{sabre-lib}} library:
{code:xml|title=frontend/pom.xml}
<dependencies>
<dependency>
<groupId>com.company.sabre</groupId>
<artifactId>sabre-lib</artifactId>
<version>0.5</version>
</dependency>
...
{code}
The {{sabre-lib}} library itself has the system dependency, that refers the
library within the same project, plus one {{sabre-ota-common}} library with
common classes:
{code:xml|title=sabre-lib/pom.xml}
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>sabre-ota-common</artifactId>
<version>0.1</version>
</dependency>
<dependency>
<groupId>com.sun.xml.messaging.saaj</groupId>
<artifactId>saaj-impl</artifactId>
<version>1.3</version>
<scope>system</scope>
<systemPath>${basedir}/lib/saaj-ri.jar</systemPath>
<optional>true</optional>
</dependency>
...
{code}
When building {{frontend}}, the following message is produced:
{quote}
[WARNING] POM for 'com.company:sabre-lib:pom:0.5:compile' is invalid. It will
be ignored for artifact resolution. Reason: Failed to validate POM
[DEBUG] Reason: Failed to validate POM
[DEBUG] Validation Errors:
[DEBUG] For dependency Dependency \{groupId=com.sun.xml.messaging.saaj,
artifactId=saaj-impl, version=1.3, type=jar\}: system-scoped dependency must
specify an absolute path systemPath.
{quote}
and, as the result, {{sabre-lib}} is packaged into .war, and
{{sabre-ota-common}} is not. I think, this is because
{{$\{basedir\}/lib/saaj-ri.jar}} is resolved in {{frontend}} project scope to
its directory. However:
# As soon as optional system dependencies should not be packaged, why to check
the path? (solution, provided in [MNG-1173] and [MNG-1187] does not help)
# Even with {{$\{basedir\}}} of {{frontend}} project, the path is still
absolute, though non-existent. The error message is incorrect then.
# The build process should fail, as soon as .war is finally incorrectly
packaged.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira