Skip to content
Permalink
Browse files

[JENKINS-57244] AbstractMavenJavadocArchiver improperly tried to save…

… a FilePath to build.xml.
  • Loading branch information...
jglick authored and olamy committed May 3, 2019
1 parent abdf2e7 commit d4329eca316ba531218724675aa93f5ce4244bef
@@ -1 +1 @@
buildPlugin platforms: ['linux'], jenkinsVersions: [null, '2.164.2']
buildPlugin platforms: ['linux'], jenkinsVersions: [null, '2.164.2', /* verifying JENKINS-57244 */ '2.175']
@@ -46,12 +46,6 @@
*/
public abstract class AbstractMavenJavadocArchiver extends MavenReporter {


private boolean aggregated = false;

private FilePath target;


/**
* return true if this mojo is a javadoc one sources or test sources
* @param mojo
@@ -65,6 +59,7 @@ public boolean postExecute(MavenBuildProxy build, MavenProject pom, MojoInfo moj
if (!checkIsJavadocMojo(mojo)) return true;

File destDir;
boolean aggregated;
try {
aggregated = mojo.getConfigurationValue("aggregate",Boolean.class, Boolean.FALSE) || mojo.getGoal().equals("aggregate")
|| mojo.getGoal().equals("test-aggregate");
@@ -82,8 +77,10 @@ public boolean postExecute(MavenBuildProxy build, MavenProject pom, MojoInfo moj

if(destDir != null && destDir.exists()) {
// javadoc:javadoc just skips itself when the current project is not a java project

FilePath target;
if(aggregated) {
// store at MavenModuleSet level.
// store at MavenModuleSet level.
listener.getLogger().println("[JENKINS] Archiving aggregated javadoc");
target = build.getModuleSetRootDir();
} else {
@@ -126,8 +123,8 @@ public boolean reportGenerated(MavenBuildProxy build, MavenProject pom, MavenRep

public abstract Action getAggregatedProjectAction(MavenModuleSet project);

public FilePath getTarget() {
return target;
protected final FilePath getTarget(AbstractMavenProject<?, ?> project) {
return new FilePath(project.getRootDir()).child(getArchiveTargetPath());
}

protected static class MavenJavadocAction extends JavadocAction {
@@ -43,7 +43,7 @@


public Collection<? extends Action> getProjectActions(MavenModule project) {
return Collections.singletonList(new MavenJavadocAction(project,getTarget(),"Javadoc","javadoc"
return Collections.singletonList(new MavenJavadocAction(project, getTarget(project), "Javadoc","javadoc"
,"Javadoc"));
}

@@ -53,7 +53,7 @@ public String getArchiveTargetPath() {
}

public Action getAggregatedProjectAction(MavenModuleSet project) {
return new MavenJavadocAction(project,getTarget(),"Javadoc","javadoc"
return new MavenJavadocAction(project, getTarget(project), "Javadoc","javadoc"
,"Javadoc");
}

@@ -43,7 +43,7 @@


public Collection<? extends Action> getProjectActions(MavenModule project) {
return Collections.singletonList(new MavenJavadocAction(project,getTarget(),"Test Javadoc","test-javadoc"
return Collections.singletonList(new MavenJavadocAction(project, getTarget(project), "Test Javadoc","test-javadoc"
,"Test Javadoc"));
}

@@ -53,7 +53,7 @@ public String getArchiveTargetPath() {
}

public Action getAggregatedProjectAction(MavenModuleSet project) {
return new MavenJavadocAction(project,getTarget(),"Test Javadoc","test-javadoc"
return new MavenJavadocAction(project, getTarget(project), "Test Javadoc","test-javadoc"
,"Test Javadoc");
}

0 comments on commit d4329ec

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