Skip to content

Commit

Permalink
[FIXED JENKINS-17724] /about was not showing licenses.
Browse files Browse the repository at this point in the history
A recent Stapler update caused the Jelly facet to ignore *.xml.
So need to use raw j:include (as plugins were doing), not st:include (as core did).(cherry picked from commit 0bf4348)

Conflicts:
	changelog.html
	core/src/main/resources/hudson/AboutJenkins/index.jelly
  • Loading branch information
jglick authored and vjuranek committed May 17, 2013
1 parent 3662fb1 commit 45699fe
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 3 deletions.
3 changes: 3 additions & 0 deletions changelog.html
Expand Up @@ -61,6 +61,9 @@
<li class=bug>
<code>StringIndexOutOfBoundsException</code> in <code>PackageResult.findCorrespondingResult</code>.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-17721">issue 17721</a>)
<li class=bug>
Third-party license display for core was broken since 1.506.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-17724">issue 17724</a>)
</ul>
</div><!--=TRUNK-END=-->

Expand Down
9 changes: 9 additions & 0 deletions core/src/main/java/hudson/AboutJenkins.java
@@ -1,6 +1,9 @@
package hudson;

import hudson.model.ManagementLink;
import java.net.URL;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.NoExternalUse;

/**
* Show "About Jenkins" link.
Expand All @@ -27,4 +30,10 @@ public String getDisplayName() {
public String getDescription() {
return Messages.AboutJenkins_Description();
}

@Restricted(NoExternalUse.class)
public URL getLicensesURL() {
return AboutJenkins.class.getResource("/META-INF/licenses.xml");
}

}
31 changes: 28 additions & 3 deletions core/src/main/resources/hudson/AboutJenkins/index.jelly
Expand Up @@ -35,9 +35,34 @@ THE SOFTWARE.
<p>
${%dependencies}
</p>
<t:thirdPartyLicenses>
<st:include page="/META-INF/licenses.xml" optional="true" />
</t:thirdPartyLicenses>
<j:set var="uri" value="${it.licensesURL}"/>
<j:choose>
<j:when test="${uri != null}">
<t:thirdPartyLicenses>
<j:include uri="${uri}"/>
</t:thirdPartyLicenses>
</j:when>
<j:otherwise>
<p>${%No information recorded}</p>
</j:otherwise>
</j:choose>
<p>${%plugin.dependencies}</p>
<ul>
<j:forEach var="p" items="${app.pluginManager.plugins}"> <!-- XXX sort -->
<li>
<a href="${rootURL}/pluginManager/plugin/${p.shortName}/thirdPartyLicenses">
<j:choose>
<j:when test="${p.active}">
${p.displayName}
</j:when>
<j:otherwise>
<strike>${p.displayName}</strike>
</j:otherwise>
</j:choose>
</a>
</li>
</j:forEach>
</ul>
</l:main-panel>
</l:layout>
</j:jelly>

2 comments on commit 45699fe

@jglick
Copy link
Member Author

@jglick jglick commented on 45699fe May 17, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vjuranek: the first block is actually the bug fix; the second block is a new feature introduced in a separate trunk commit. Not sure if you intended to cherry-pick both.

@vjuranek
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jglick: thanks for spotting it! Of course this wasn't intended, I wrongly resolved merge conflict. Fixed in 6767bad

Please sign in to comment.