[
http://jira.codehaus.org/browse/MNG-2785?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=171158#action_171158
]
Max Offman commented on MNG-2785:
---------------------------------
I also bumped into this bug. It took me a while to find this report, so here
are some additional symptoms for the search engines. I also had an
absolute-path <scope>system</scope> dependency. However, unlike the above
report, my system dependency was not missing. Odd thing is that it works on my
WIN-XP machine.
{noformat}
> cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.2 (Tikanga)
> mvn -version
Maven version: 2.0.10
Java version: 1.5.0
OS name: "linux" version: "2.6.18-92.el5xen" arch: "x86" Family: "unix"
> mvn install
...
[WARNING] POM for 'com.xxx.pman:pman-proto-compute:pom:1.0.0-SNAPSHOT:compile'
is invalid. It will be ignored for artifact resolution.
Reason: Failed to validate POM for project com.xxx.pman:pman-proto-compute at
Artifact [com.xxx.pman:pman-proto-compute:pom:1.0.0-SNAPSHOT:compile]
...
{noformat}
If I run w/ the m2eclipse embedded maven on same platform, I get different
messages:
{noformat}
The following mojo encountered an error while executing:
Group-Id: org.apache.maven.plugins
Artifact-Id: maven-war-plugin
Version: 2.1-alpha-1
Mojo: war
brought in via: packaging: war
While building project:
Group-Id: com.xxx.pman
Artifact-Id: pman-proto-nb-compute-webapp
Version: 1.0.0-SNAPSHOT
>From file: /root/RSA75/pman/trunk/pman-proto-nb-compute-webapp/pom.xml
Reason: Failed to copy file for
artifact[com.xxx.pman:pman-proto-compute:jar:1.0.0-SNAPSHOT:compile]
java.io.FileNotFoundException:
/root/RSA75/pman/trunk/pman-proto-compute/target/classes (Is a directory)
at java.io.FileInputStream.<init>(FileInputStream.java:135)
at org.codehaus.plexus.util.FileUtils.copyFile(FileUtils.java:929)
at
org.apache.maven.plugin.war.packaging.AbstractWarPackagingTask.copyFile(AbstractWarPackagingTask.java:304)
at
org.apache.maven.plugin.war.packaging.AbstractWarPackagingTask$1.registered(AbstractWarPackagingTask.java:145)
at
org.apache.maven.plugin.war.util.WebappStructure.registerFile(WebappStructure.java:113)
at
org.apache.maven.plugin.war.packaging.AbstractWarPackagingTask.copyFile(AbstractWarPackagingTask.java:140)
at
org.apache.maven.plugin.war.packaging.ArtifactsPackagingTask.performPackaging(ArtifactsPackagingTask.java:76)
at
org.apache.maven.plugin.war.packaging.WarProjectPackagingTask.handleArtifacts(WarProjectPackagingTask.java:151)
at
org.apache.maven.plugin.war.packaging.WarProjectPackagingTask.performPackaging(WarProjectPackagingTask.java:72)
at
org.apache.maven.plugin.war.AbstractWarMojo.buildWebapp(AbstractWarMojo.java:364)
at
org.apache.maven.plugin.war.AbstractWarMojo.buildExplodedWebapp(AbstractWarMojo.java:317)
at
org.apache.maven.plugin.war.WarMojo.performPackaging(WarMojo.java:166)
at org.apache.maven.plugin.war.WarMojo.execute(WarMojo.java:130)
...
{noformat}
> 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
> Components: Dependencies
> Affects Versions: 2.0.4
> Environment: $ java -version
> java version "1.5.0_04"
> $ mvn -v
> Maven version: 2.0.4
> Reporter: Dmitry Katsubo
> Fix For: 3.x
>
>
> 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