Bug 977984

Summary: javapackages-tools: maven_depmap.py should record information about installed JAR files
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: high    
Version: rawhideCC: java-sig-commits, mizdebsk, msrb, sochotni, tradej
Target Milestone: ---Keywords: FutureFeature, Triaged, Upstream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 2.0.0-1 Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-08-09 11:40:38 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 18:07:44 UTC
%add_maven_depmap (maven_depmap.py) should record more detailed information about JAR files it adds depmaps for.

Description of problem:
Currently XMvn Subst relies on pom.properties to identify artifact files, but this solution has limitations. JARs not build with Maven don't have pom.properties and thus cannot be identified and are not processed by XMvn Subst.

XMVn Subst has 2 main uses: (1) replacing bundled upstream binary JARs with system libraries and (2) creating symlink structure in packages that ship JAR repositories (like maven or jboss-as).  We can't so much about the first case, but in the second case all JARs should be coming from RPM packages so the situation can be improved signifficantly.  I have 2 proposed solutions:

1) maven_depmap.py would inject pom.properties (preferred solution).  It has knowledge about gId, aId and version so it would only have to open the JAR file and add pom.properties if it's missing. In case pom.properties is present its correctness should be verified and if it doesn't match the POM the build should be aborted.

2) maven_depmap.py would store JAR file hash (like MD5) into fragment file. To identify JAR file XMvn Subst would calculate hash of binary JAR and look it up in fragment files.  This solution is worse and should IMO be implemented only if there are any problems with injecting pom.properties (solution nr 1).

If this reature is implemented then (after rebuild of all packages) XMvn Subst will be able to create symlink structure for any combination of artifacts, as long as they all are in Maven repository.

Comment 1 Mikolaj Izdebski 2013-06-25 18:38:15 UTC
Additional notes:

1) this feature is especially important for automating installation of OSGi bundles, which often contain lib/ directory with dependencies

2) this feature should be implemented before F-20 mass rebuild so that all JARs in distribution have pom.properties injected in Fedora 20

Comment 2 Mikolaj Izdebski 2013-08-09 11:40:38 UTC
This feature was implemented in upstream version 2.0.0 (commit 32cd45e).