Skip to content

Commit

Permalink
Bugfix for JENKINS-30578.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jochen A. Fürbacher committed Apr 18, 2016
1 parent 0b97aaa commit eb4622b
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 eb4622b

Please sign in to comment.