Skip to content

Commit

Permalink
SECURITY-2973
Browse files Browse the repository at this point in the history
  • Loading branch information
Dohbedoh committed Jan 3, 2023
1 parent b462d97 commit c67a898
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<properties>
<jenkins.version>1.625.3</jenkins.version>
<java.level>7</java.level>
<java.level>8</java.level>
</properties>

<artifactId>semantic-versioning-plugin</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,13 @@

import hudson.Extension;
import hudson.FilePath;
import hudson.FilePath.FileCallable;
import hudson.model.Descriptor;
import hudson.remoting.VirtualChannel;

import jenkins.MasterToSlaveFileCallable;
import org.jenkinsci.plugins.SemanticVersioning.AppVersion;
import org.jenkinsci.plugins.SemanticVersioning.InvalidBuildFileFormatException;
import org.jenkinsci.plugins.SemanticVersioning.Messages;
import org.jenkinsci.remoting.RoleChecker;
import org.w3c.dom.Document;
import org.xml.sax.SAXException;

Expand All @@ -54,6 +53,7 @@ public class PomParser extends AbstractBuildDefinitionParser {
public PomParser() {
}

@Override
public AppVersion extractAppVersion(FilePath workspace, PrintStream logger)
throws IOException, InvalidBuildFileFormatException {
String version = null;
Expand Down Expand Up @@ -86,7 +86,7 @@ private Document getPom(FilePath workspace)

Document pomDocument;
try {
pomDocument = pom.act(new FileCallable<Document>() {
pomDocument = pom.act(new MasterToSlaveFileCallable<Document>() {
private static final long serialVersionUID = 1L;

public Document invoke(File pom, VirtualChannel channel)
Expand All @@ -98,20 +98,13 @@ public Document invoke(File pom, VirtualChannel channel)
.newDocumentBuilder();
return documentBuilder.parse(pom);

} catch (SAXException e) {
throw new InterruptedException(pom
.getAbsolutePath()
+ " is not a valid POM file.");
} catch (ParserConfigurationException e) {
} catch (SAXException | ParserConfigurationException e) {
throw new InterruptedException(pom
.getAbsolutePath()
+ " is not a valid POM file.");
}
}

public void checkRoles(RoleChecker arg0) throws SecurityException {
}

});
} catch (InterruptedException e) {
throw new InvalidBuildFileFormatException(e.getMessage());
Expand Down

0 comments on commit c67a898

Please sign in to comment.