api / org.gradle.api.publish.maven / MavenPublication / from

from

abstract fun from(component: SoftwareComponent): Unit

Provides the software component that should be published.

Currently 2 types of component are supported: 'components.java' (added by the JavaPlugin) and 'components.web' (added by the WarPlugin). For any individual MavenPublication, only a single component can be provided in this way. The following example demonstrates how to publish the 'java' component to a Maven repository.
 apply plugin: "java" apply plugin: "maven-publish" publishing { publications { maven(MavenPublication) { from components.java } } } 

Parameters

component - The software component to publish.