Bug 1033664

Summary: tomcat-juli.jar isn't resolved by xmvn-subst
Product: [Fedora] Fedora Reporter: Robert Rati <rrati>
Component: tomcatAssignee: Mikolaj Izdebski <mizdebsk>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: ivan.afonichev, java-sig-commits, sochotni
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 7.0.47-3 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-01-21 14:32:11 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 Robert Rati 2013-11-22 14:48:34 UTC
Description of problem:
The tomcat-juli.jar isn't resolved by xmvn-subst.  The jar resides in _datadir/tomcat/bin but is symlinked to from _javadir/tomcat.  The other tomcat jars are properly resolved, so I'd guess the tomcat-juli.jar is missing the metadata for resolution or is overwritten in the tomcat packaging.

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


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Stanislav Ochotnicky 2013-11-22 15:10:24 UTC
I'll explain a bit more perhaps:
some time ago %add_maven_depmap has been modified to inject Maven metadata into the jar itself. This way xmvn-subst can then replace jars with symlinks even if the package hasn't been built with Maven.

Other tomcat jars have META-INF/maven/org.apache.tomcat/XXX/pom.properties file injected. juli doesn't (for some reason). It's possible some file juggling in the spec can overwrite the file with injected pom.properties?

Comment 2 Mikolaj Izdebski 2014-01-15 13:53:13 UTC
Fixed in tomcat-7.0.47-2

Comment 3 Mikolaj Izdebski 2014-01-15 14:29:44 UTC
Rebuilding the package didn't fix the problem.

It turns out that JAR which was used during call to %add_maven_depmap is being replaced with a symnlink.  The first JAR with injected pom.properties is lost.

%global libdir %{_javadir}/%{name}
...
%add_maven_depmap JPP.%{name}-tomcat-juli.pom %{name}/tomcat-juli.jar
...
# replace temporary copy with link
%{__ln_s} -f %{bindir}/tomcat-juli.jar ${RPM_BUILD_ROOT}%{libdir}/

Comment 4 Mikolaj Izdebski 2014-01-21 14:08:26 UTC
Commited the fix.

Verification:

$ rpm -q tomcat-lib
tomcat-lib-7.0.47-2.fc21.noarch
$ xmvn-subst tomcat-juli.jar 
[main] INFO org.fedoraproject.xmvn.tools.subst.ArtifactVisitor - Skipping file tomcat-juli.jar: No artifact definition found

$ rpm -q tomcat-lib
tomcat-lib-7.0.47-3.fc21.noarch
$ xmvn-subst tomcat-juli.jar 
[main] INFO org.fedoraproject.xmvn.tools.subst.ArtifactVisitor - Linked tomcat-juli.jar to /usr/share/java/tomcat/tomcat-juli.jar
$ readlink -f tomcat-juli.jar 
/usr/share/tomcat/bin/tomcat-juli.jar

Comment 5 Mikolaj Izdebski 2014-01-21 14:32:11 UTC
I believe that this bug is fixed in tomcat-7.0.47-3,
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=492693