Bug 1014307

Summary: javapackages-tools: %add_maven_depmap does not include <version> in <maven> part
Product: [Fedora] Fedora Reporter: Mikolaj Izdebski <mizdebsk>
Component: javapackages-toolsAssignee: Mikolaj Izdebski <mizdebsk>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: java-sig-commits, mizdebsk, msrb, sochotni
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 3.3.1-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-10-02 15:56:18 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Mikolaj Izdebski 2013-10-01 17:12:33 UTC
Description of problem:
In some cases %add_maven_depmap does not include <version> in <maven> part, which causes auto-provides generator to fail.

Either maven_depmap should always include version or auto-provides generator should accept depmaps with missing versions.

Version-Release number of selected component (if applicable):
3.3.0-1

Steps to Reproduce:
1. build junit in rawhide

Actual results:
Traceback (most recent call last):
  File "/usr/lib/rpm/maven.prov", line 74, in <module>
    builder = TagBuilder ()
  File "/usr/lib/rpm/maven.prov", line 46, in __init__
    depmap = Depmap(path)
  File "/usr/lib/python2.7/site-packages/javapackages/depmap.py", line 62, in __init__
    if not self.get_provided_mappings():
  File "/usr/lib/python2.7/site-packages/javapackages/depmap.py", line 107, in get_provided_mappings
    raise DepmapInvalidException("Depmap {path} does not have version in maven provides".format(path=self.__path))
DepmapInvalidException: Depmap /builddir/build/BUILDROOT/junit-4.11-7.fc21.x86_64/usr/share/maven-fragments/junit does not have version in maven provides

Additional info:
Depmap generated by %add_maven_depmap is:

<dependencyMap>
	<dependency>
		<maven>
			<artifactId>junit</artifactId>
			<groupId>junit</groupId>
		</maven>
		<jpp>
			<artifactId>junit</artifactId>
			<groupId>JPP</groupId>
		</jpp>
	</dependency>
</dependencyMap>

Comment 1 Stanislav Ochotnicky 2013-10-02 12:41:08 UTC
This is caused by:
%pom_xpath_set pom:project/pom:version "%{version}"

POM class expects only text content for <version> node. Similar problems can be expected in other node handling methods

Comment 2 Stanislav Ochotnicky 2013-10-02 15:13:48 UTC
Fixed by upstream commit b80c1b6b, testcases in 59ec908f

Comment 3 Mikolaj Izdebski 2013-10-02 15:47:04 UTC
Fixed in javapackages-tools-3.3.1-1

Comment 4 Mikolaj Izdebski 2013-10-02 15:47:47 UTC
Verified by rebuilding junit package.

Comment 5 Mikolaj Izdebski 2013-10-02 15:56:18 UTC
I believe that this bug is fixed in javapackages-tools-3.3.1-1,
which is available in Fedora Rawhide, so I am closing this bug now.

The build containing the fix can be found at Koji:
http://koji.fedoraproject.org/koji/buildinfo?buildID=469008