Depend all GenerateMavenPom tasks on fetch all contributors
@@ -6,6 +6,7 @@ import org.gradle.api.Project;
import org.gradle.api.Task;
import org.gradle.api.logging.Logger;
import org.gradle.api.logging.Logging;
+import org.gradle.api.publish.maven.tasks.GenerateMavenPom;
import org.gradle.api.tasks.Exec;
import org.mockito.release.gradle.BumpVersionFileTask;
import org.mockito.release.gradle.ReleaseConfiguration;
@@ -14,7 +15,6 @@ import org.mockito.release.internal.gradle.configuration.LazyConfiguration;
import org.mockito.release.internal.gradle.util.TaskMaker;
import org.mockito.release.version.VersionInfo;
-import static org.mockito.release.internal.gradle.BaseJavaLibraryPlugin.POM_TASK;
/**
* Opinionated continuous delivery plugin.
* Applies following plugins and preconfigures tasks provided by those plugins:
@@ -50,8 +50,13 @@ public class ContinuousDeliveryPlugin implements Plugin<Project> {
subproject.getPlugins().withType(BaseJavaLibraryPlugin.class, new Action<BaseJavaLibraryPlugin>() {
@Override
public void execute(BaseJavaLibraryPlugin p) {
- Task fetcher = project.getTasks().getByName(ContributorsPlugin.FETCH_CONTRIBUTORS_TASK);
- subproject.getTasks().getByName(POM_TASK).dependsOn(fetcher);
+ final Task fetcher = project.getTasks().getByName(ContributorsPlugin.FETCH_CONTRIBUTORS_TASK);
+ subproject.getTasks().withType(GenerateMavenPom.class, new Action<GenerateMavenPom>() {
+ @Override
+ public void execute(GenerateMavenPom generateMavenPom) {
+ generateMavenPom.dependsOn(fetcher);
+ }
+ });
}
});
}
