Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #14 from cjo9900/JENKINS-15977
[FIXED JENKINS-15977] ClassNotFound is maven plugin not installed
  • Loading branch information
ikedam committed Feb 4, 2014
2 parents 7df40f1 + 6cd2d83 commit d00c855
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/main/java/hudson/plugins/copyartifact/CopyArtifact.java
Expand Up @@ -277,7 +277,8 @@ public boolean perform(AbstractBuild<?,?> build, Launcher launcher, BuildListene

Copier copier = Jenkins.getInstance().getExtensionList(Copier.class).get(0).clone();

if (src instanceof MavenModuleSetBuild) {
if (Hudson.getInstance().getPlugin("maven-plugin") != null && (src instanceof MavenModuleSetBuild) ) {
// use classes in the "maven-plugin" plugin as might not be installed
// Copy artifacts from the build (ArchiveArtifacts build step)
boolean ok = perform(src, build, expandedFilter, targetDir, baseTargetDir, copier, console);
// Copy artifacts from all modules of this Maven build (automatic archiving)
Expand Down Expand Up @@ -377,11 +378,13 @@ public FormValidation doCheckProjectName(
FormValidation result;
Item item = Jenkins.getInstance().getItem(value, anc.getParent());
if (item != null)
result = item instanceof MavenModuleSet
? FormValidation.warning(Messages.CopyArtifact_MavenProject())
: (item instanceof MatrixProject
if (Hudson.getInstance().getPlugin("maven-plugin") != null && item instanceof MavenModuleSet) {
result = FormValidation.warning(Messages.CopyArtifact_MavenProject());
} else {
result = (item instanceof MatrixProject)
? FormValidation.warning(Messages.CopyArtifact_MatrixProject())
: FormValidation.ok());
: FormValidation.ok();
}
else if (value.indexOf('$') >= 0)
result = FormValidation.warning(Messages.CopyArtifact_ParameterizedName());
else
Expand Down

0 comments on commit d00c855

Please sign in to comment.