This change fixes the issue where the sources and javadoc artifacts were not built and included with the publish. Signed-off-by: Rabi Panda <adnapibar@gmail.com>
This commit is contained in:
parent
f73e66e5e7
commit
07a57d9bbb
|
@ -121,13 +121,19 @@ public class PublishPlugin implements Plugin<Project> {
|
|||
});
|
||||
});
|
||||
|
||||
// Add git origin info to generated POM files
|
||||
publishing.getPublications().withType(MavenPublication.class, publication -> {
|
||||
// Add git origin info to generated POM files
|
||||
publication.getPom().withXml(PublishPlugin::addScmInfo);
|
||||
|
||||
// have to defer this until archivesBaseName is set
|
||||
project.afterEvaluate(p -> publication.setArtifactId(getArchivesBaseName(project)));
|
||||
|
||||
// publish sources and javadoc for Java projects.
|
||||
if (project.getPluginManager().hasPlugin("opensearch.java")) {
|
||||
publication.artifact(project.getTasks().getByName("sourcesJar"));
|
||||
publication.artifact(project.getTasks().getByName("javadocJar"));
|
||||
}
|
||||
|
||||
generatePomTask.configure(
|
||||
t -> t.dependsOn(String.format("generatePomFileFor%sPublication", Util.capitalize(publication.getName())))
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue