Skip to content

Commit

Permalink
Merge pull request #56 from Jochen-A-Fuerbacher/JENKINS-30578
Browse files Browse the repository at this point in the history
[JENKINS-30578] Bugfix
  • Loading branch information
Jochen-A-Fuerbacher committed Apr 18, 2016
2 parents 0b97aaa + eb4622b commit f270b1c
Showing 1 changed file with 9 additions and 1 deletion.
Expand Up @@ -350,7 +350,15 @@ private SortedMap<String, HistoryDescr> getRevisions(final File historiesDir, fi
public XmlFile getOldRevision(final AbstractItem item, final String identifier) {
final File configFile = item.getConfigFile().getFile();
final File historyDir = new File(getHistoryDir(configFile), identifier);
if (item instanceof MavenModule) {
boolean isMavenModuleAvailable = false;
try {
Class.forName("hudson.maven.MavenModule");
isMavenModuleAvailable = true;
} catch (ClassNotFoundException ex) {
LOG.log(Level.FINEST, "MavenModule not available. JobConfigHistory needs MavenModule. ", ex);
isMavenModuleAvailable = false;
}
if (isMavenModuleAvailable && item instanceof MavenModule) {
final String path = historyDir + ((MavenModule) item).getParent().getFullName().replace("/", "/jobs/") + "/modules/"
+ ((MavenModule) item).getModuleName().toFileSystemName() + "/" + identifier;
return new XmlFile(getConfigFile(new File(path)));
Expand Down

0 comments on commit f270b1c

Please sign in to comment.