Search in sources :

Example 1 with JavaLibraryPlugin

use of org.gradle.api.plugins.JavaLibraryPlugin in project spring-boot by spring-projects.

the class MavenRepositoryPlugin method setUpProjectRepository.

private void setUpProjectRepository(Project project, Task publishTask, File repositoryLocation) {
    publishTask.doFirst(new CleanAction(repositoryLocation));
    Configuration projectRepository = project.getConfigurations().create(MAVEN_REPOSITORY_CONFIGURATION_NAME);
    project.getArtifacts().add(projectRepository.getName(), repositoryLocation, (artifact) -> artifact.builtBy(publishTask));
    DependencySet target = projectRepository.getDependencies();
    project.getPlugins().withType(JavaPlugin.class).all((javaPlugin) -> addMavenRepositoryDependencies(project, JavaPlugin.IMPLEMENTATION_CONFIGURATION_NAME, target));
    project.getPlugins().withType(JavaLibraryPlugin.class).all((javaLibraryPlugin) -> addMavenRepositoryDependencies(project, JavaPlugin.API_CONFIGURATION_NAME, target));
    project.getPlugins().withType(JavaPlatformPlugin.class).all((javaPlugin) -> addMavenRepositoryDependencies(project, JavaPlatformPlugin.API_CONFIGURATION_NAME, target));
}
Also used : Configuration(org.gradle.api.artifacts.Configuration) DependencySet(org.gradle.api.artifacts.DependencySet) JavaPlugin(org.gradle.api.plugins.JavaPlugin) JavaLibraryPlugin(org.gradle.api.plugins.JavaLibraryPlugin) JavaPlatformPlugin(org.gradle.api.plugins.JavaPlatformPlugin)

Aggregations

Configuration (org.gradle.api.artifacts.Configuration)1 DependencySet (org.gradle.api.artifacts.DependencySet)1 JavaLibraryPlugin (org.gradle.api.plugins.JavaLibraryPlugin)1 JavaPlatformPlugin (org.gradle.api.plugins.JavaPlatformPlugin)1 JavaPlugin (org.gradle.api.plugins.JavaPlugin)1