Skip to content
Permalink
Browse files

[JENKINS-42310] GitRef Lint defect support Maven and Matrix projects

  • Loading branch information...
v1v committed Feb 25, 2017
1 parent 57f1fd6 commit ece383c0fca8267db54c6c7dc907920e77471a63
Showing with 5 additions and 5 deletions.
  1. +5 −5 src/main/java/org/jenkins/ci/plugins/jenkinslint/check/GitRefChecker.java
@@ -1,7 +1,7 @@
package org.jenkins.ci.plugins.jenkinslint.check;

import hudson.model.Item;
import hudson.model.Project;
import hudson.model.AbstractProject;
import jenkins.model.Jenkins;
import org.jenkins.ci.plugins.jenkinslint.model.AbstractCheck;

@@ -22,14 +22,14 @@ public GitRefChecker() {
}

public boolean executeCheck(Item item) {
if (item instanceof Project) {
if (item instanceof AbstractProject) {
PluginWrapper plugin = Jenkins.getInstance().pluginManager.getPlugin("git");
if (plugin!=null && !plugin.getVersionNumber().isOlderThan(new hudson.util.VersionNumber("2.0"))) {
if (((Project) item).getScm().getClass().getName().endsWith("GitSCM")) {
if (((AbstractProject) item).getScm().getClass().getName().endsWith("GitSCM")) {
boolean status = true;
try {
Method method = ((Project) item).getScm().getClass().getMethod("getExtensions", null);
Object extensionsList = method.invoke( ((Project) item).getScm());
Method method = ((AbstractProject) item).getScm().getClass().getMethod("getExtensions", null);
Object extensionsList = method.invoke( ((AbstractProject) item).getScm());
if (extensionsList instanceof AbstractList) {
for (Object extension : ((AbstractList) extensionsList) ) {
if (extension.getClass().getName().endsWith("CloneOption")) {

0 comments on commit ece383c

Please sign in to comment.
You can’t perform that action at this time.