Search in sources :

Example 1 with MavenPublishPlugin

use of org.gradle.api.publish.maven.plugins.MavenPublishPlugin in project spring-security by spring-projects.

the class PublishLocalPlugin method apply.

@Override
public void apply(Project project) {
    project.getPlugins().withType(MavenPublishPlugin.class).all(new Action<MavenPublishPlugin>() {

        @Override
        public void execute(MavenPublishPlugin mavenPublish) {
            PublishingExtension publishing = project.getExtensions().getByType(PublishingExtension.class);
            publishing.getRepositories().maven(new Action<MavenArtifactRepository>() {

                @Override
                public void execute(MavenArtifactRepository maven) {
                    maven.setName("local");
                    maven.setUrl(new File(project.getRootProject().getBuildDir(), "publications/repos"));
                }
            });
        }
    });
}
Also used : Action(org.gradle.api.Action) MavenPublishPlugin(org.gradle.api.publish.maven.plugins.MavenPublishPlugin) MavenArtifactRepository(org.gradle.api.artifacts.repositories.MavenArtifactRepository) File(java.io.File) PublishingExtension(org.gradle.api.publish.PublishingExtension)

Aggregations

File (java.io.File)1 Action (org.gradle.api.Action)1 MavenArtifactRepository (org.gradle.api.artifacts.repositories.MavenArtifactRepository)1 PublishingExtension (org.gradle.api.publish.PublishingExtension)1 MavenPublishPlugin (org.gradle.api.publish.maven.plugins.MavenPublishPlugin)1