Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Not A Bug
-
Affects Version/s: 2.1-alpha-1
-
Fix Version/s: None
-
Component/s: rpm
-
Labels:None
-
Environment:HideApache Maven 3.0.3 (r1075438; 2011-02-28 12:31:09-0500)
Maven home: C:\Users\christopher.cobb\SVN\symdb\trunk\internal\apache-maven-3.0.3
Java version: 1.7.0_01, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.7.0_01\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
ShowApache Maven 3.0.3 (r1075438; 2011-02-28 12:31:09-0500) Maven home: C:\Users\christopher.cobb\SVN\symdb\trunk\internal\apache-maven-3.0.3 Java version: 1.7.0_01, vendor: Oracle Corporation Java home: C:\Program Files\Java\jdk1.7.0_01\jre Default locale: en_US, platform encoding: Cp1252 OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
Description
I have a pom that is configured with rpm packaging and has a single dependency:
<dependency>
<groupId>symdb.presentation</groupId>
<artifactId>presentation-war</artifactId>
<version>0.0.4-SNAPSHOT</version>
</dependency>
This dependency exists, as is illustrated by this directory listing:
$ ls -l repository/symdb/presentation/presentation-war/0.0.4-SNAPSHOT
total 4618
rwx-----+ 1 christopher.cobb Domain_Users 206 Jan 11 12:34 _maven.repositories
rwx-----+ 1 christopher.cobb Domain_Users 720 Jan 11 12:34 maven-metadata-local.xml
rwx-----+ 1 christopher.cobb Domain_Users 253 Jan 11 13:35 presentation-war-0.0.4-SNAPSHOT.jar.lastUpdated
rwx-----+ 1 christopher.cobb Domain_Users 6496 Jan 11 10:47 presentation-war-0.0.4-SNAPSHOT.pom
rwx-----+ 1 christopher.cobb Domain_Users 4712437 Jan 11 12:34 presentation-war-0.0.4-SNAPSHOT.war
This dependency is of type war, as can be seen from the above directory listing, but also from the .pom file:
$ head repository/symdb/presentation/presentation-war/0.0.4-SNAPSHOT/presentation-war-0.0.4-SNAPSHOT.pom
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<name>SymDB Presentation Tier Vaadin Web Application</name>
<groupId>symdb.presentation</groupId>
<artifactId>presentation-war</artifactId>
<version>0.0.4-SNAPSHOT</version>
<packaging>war</packaging>
However, when I perform a maven command, such as mvn compile, a jar file is sought:
$ mvn compile
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building packaging-type-bug-test 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.868s
[INFO] Finished at: Wed Jan 11 13:41:37 EST 2012
[INFO] Final Memory: 6M/122M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project presentation-rpm: Could not resolve dependencies for project symdb.presentation:presentation-rpm:rpm:0.0.1-SNAPSHOT: Failure to find symdb.presentation:presentation-war:jar:0.0.4-SNAPSHOT
Notice that maven is wrongly looking for a :jar: artifact instead of a :war: artifact:
Failure to find symdb.presentation:presentation-war:jar:0.0.4-SNAPSHOT
Here is my test pom.xml. Changing the packing to type 'pom' will make this go away. The problem only manifests with pom type 'rpm'. I have stripped everything out that is not related to this error.
$ cat pom.xml
<project>
<modelVersion>4.0.0</modelVersion>
<name>packaging-type-bug-test</name>
<groupId>symdb.presentation</groupId>
<artifactId>presentation-rpm</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>rpm</packaging>
<dependencies>
<dependency>
<groupId>symdb.presentation</groupId>
<artifactId>presentation-war</artifactId>
<version>0.0.4-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>rpm-maven-plugin</artifactId>
<version>2.1-alpha-1</version>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
</project>
(Also, if I copy the .war file in the repository to a .jar file of the same name, the command completes successfully, indicating that access to the repository is working properly. Of course, that is not what I want
)
You need to define the dependency type (http://maven.apache.org/pom.html#Dependencies).
<dependency> <groupId>symdb.presentation</groupId> <artifactId>presentation-war</artifactId> <version>0.0.4-SNAPSHOT</version> <type>war</type> </dependency>As noted in the documentation, this defaults to jar if not present.
<dependency> <groupId>symdb.presentation</groupId> <artifactId>presentation-war</artifactId> <version>0.0.4-SNAPSHOT</version> <type>war</type> </dependency>