Bug 977975 - javapackages-tools: Improve adding POM dependencies and plugins
javapackages-tools: Improve adding POM dependencies and plugins
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: javapackages-tools (Show other bugs)
rawhide
Unspecified Unspecified
medium Severity unspecified
: ---
: ---
Assigned To: Mikolaj Izdebski
Fedora Extras Quality Assurance
: FutureFeature, Triaged, Upstream
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-25 13:27 EDT by Mikolaj Izdebski
Modified: 2013-09-12 01:41 EDT (History)
6 users (show)

See Also:
Fixed In Version: 3.0.3-1
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-09-12 01:41:20 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Mikolaj Izdebski 2013-06-25 13:27:33 EDT
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 07:36:28 EDT
Feature implemented upstream in commit 022b926
Comment 2 Mikolaj Izdebski 2013-09-12 01:33:23 EDT
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 01:33:40 EDT
Fixed in javapackages-tools-3.0.3-1
Comment 4 Mikolaj Izdebski 2013-09-12 01:41:20 EDT
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

Note You need to log in before you can comment on or make changes to this bug.