Description of problem: Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info:
Sorry, pushed enter accidentally. Currently for packaging maven artifacts we are using %add_to_maven_depmap macro. We need to supply a lot of information to it and it gives us a lot of places to make mistakes. Attached patch adds new macro (%add_maven_depmap) that only needs one to three parameters depending on the use. It reads original groupId/artifactId/version from pom file itself. That's why this was implemented in python, to have a proper xml parser available. Install depmap for parent/main pom without jar (pom needs to exist in mavenpomdir): %add_maven_depmap JPP-xbean.pom # install depmap and verify that pom filename and jar filename are compatible # jar file needs to exist in javadir %add_maven_depmap JPP.xbean-xbean-reflect.pom xbean/xbean-reflect.jar For example this would fail because of incompatible filenames: %add_maven_depmap JPP.xbean-reflect.pom xbean/xbean-reflect.jar And finally when we want more groupIds/artifactIds resolve to same jar file: %add_maven_depmap JPP.xbean-reflect.pom xbean/reflect.jar com.google:reflect,org.sf.xml:reflect Previous call adds normal depmap + 2 more custom depmaps resolving to same jar file.
Created attachment 463950 [details] Patch adding new macro
Created attachment 464014 [details] Added new options Added two optional parameters to macro: -f ADD : adds "ADD" to fragment name therefore creating %{name}-ADD -a custom depmaps are added like this ("gid1:aid1,gid2:aid2"
Hmm, I am sorry. Not sure how this got missed :/ Can you attach the maven_func.py file as well please? Also, can you post the patch as applicable to the jpackage-utils tree?
Patch I added was actually against jpackage package in fedora. There seems to be a bug in bugzilla that will prevent you from seeing file additions. If you look at https://bugzilla.redhat.com/attachment.cgi?id=464014 you can see the proper patch, other links are not showing the maven_func.py for some reason. Applying the patch would give you fixed spec & patch that would be applied to jpackage during build. Nevertheless I am including separate patch against jpackage (minus the maven_func.py since you want it separate).
Created attachment 492156 [details] Add new macro Patch without addition of maven_func.py
Created attachment 492157 [details] Python file implementing pom parsing for automatic depmap generation
Looks fine to me. The -f doesn't seem have an accompanying help message like -a does though. Is this intentional?
Well, that's because the "-f" is handled by rpm macro, whereas "-a" is handled by the python script. The "-f" never reaches the python script. I could modify behaviour of macro to move that functionality to python script I guess. Also I should document the maven_func.py a bit more one way or the other. I first wanted to get input on the general idea so I wouldn't spend too much time polishing something that will get thrown out the window :-)
After discussion with Andrew Overholt during SIG meeting, we decided to do it a bit differently. We created javapackages project on fedorahosted as a separate project[1,2]. I added release of this project as a separate source. It's going to be easier to maintain and jpackage guys can easily take our changes (that's why we chose BSD license as well). I'll update jpackage-utils in a few hours in rawhide. If you find any problems with it let me know. [1] https://fedorahosted.org/javapackages/ [2] https://fedorahosted.org/released/javapackages/