Bug 977975

Summary: javapackages-tools: Improve adding POM dependencies and plugins
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: medium    
Version: rawhideCC: java-sig-commits, mizdebsk, msimacek, msrb, sochotni, tradej
Target Milestone: ---Keywords: FutureFeature, Triaged, Upstream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 3.0.3-1 Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-12 05:41:20 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-06-25 17:27:33 UTC
Description of problem:
Macros that add new dependencies or plugins should add parent XML node if it's missing.

For example, currently %pom_add_dep fails to add a dependency if the POM doesn't have <dependencies> node -- empty "<dependencies/>" node needs to be injected prior to adding dependency:

%pom_xpath_inject pom:project "<dependencies/>"
%pom_add_dep foo:bar

The same applies to adding plugins.

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

Comment 1 Mikolaj Izdebski 2013-08-09 11:36:28 UTC
Feature implemented upstream in commit 022b926

Comment 2 Mikolaj Izdebski 2013-09-12 05:33:23 UTC
Verified in rawhide.

$ rpm -q javapackages-tools
javapackages-tools-3.0.3-1.fc21.noarch

$ cat pom.xml
<project></project>

$ (pom_add_dep foo:bar)

$ cat pom.xml
<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/xsd/maven-4.0.0.xsd">
<!-- section added by maintainer -->
<dependencies>
<!-- begin of code added by maintainer -->
<dependency>
<groupId>foo</groupId>
<artifactId>bar</artifactId>
<version>any</version>
</dependency>
<!-- end of code added by maintainer -->
</dependencies></project>

Comment 3 Mikolaj Izdebski 2013-09-12 05:33:40 UTC
Fixed in javapackages-tools-3.0.3-1

Comment 4 Mikolaj Izdebski 2013-09-12 05:41:20 UTC
I believe that this bug is fixed in javapackages-tools-3.0.3-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=463695