jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Mojo RPM Plugin
  • MRPM-99

rpm packing wrongly seeks :jar: type instead of :war: type

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Not A Bug
  • Affects Version/s: 2.1-alpha-1
  • Fix Version/s: None
  • Component/s: rpm
  • Labels:
    None
  • Environment:
    Hide
    Apache 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"
    Show
    Apache 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 )

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Brett Okken added a comment - 11/Jan/12 1:19 PM

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.

Show
Brett Okken added a comment - 11/Jan/12 1:19 PM 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.
Hide
Permalink
Christopher Cobb added a comment - 11/Jan/12 1:25 PM

Thank you. Putting <type> in the dependency works.

(I did look at the maven docs for adding packing type to a dependency, but I guess the docs I looked at didn't list it.)

Thanks!

Show
Christopher Cobb added a comment - 11/Jan/12 1:25 PM Thank you. Putting <type> in the dependency works. (I did look at the maven docs for adding packing type to a dependency, but I guess the docs I looked at didn't list it.) Thanks!
Hide
Permalink
Brett Okken added a comment - 11/Jan/12 1:25 PM

If the dependency.type is not explicitly included, it is assumed to be jar.

http://maven.apache.org/pom.html#Dependencies

Show
Brett Okken added a comment - 11/Jan/12 1:25 PM If the dependency.type is not explicitly included, it is assumed to be jar. http://maven.apache.org/pom.html#Dependencies

People

  • Assignee:
    Brett Okken
    Reporter:
    Christopher Cobb
Vote (0)
Watch (0)

Dates

  • Created:
    11/Jan/12 12:56 PM
    Updated:
    11/Jan/12 1:25 PM
    Resolved:
    11/Jan/12 1:25 PM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.