Gradle Software Components: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 3: Line 3:
=Overview=
=Overview=


The [[Gradle_Java_Plugin#Component|Java plugin]] adds a software component.
A software components may be added by a [[#Plugin|plugin]]. For example the [[Gradle_Java_Plugin#Overview|Java plugin]] adds a "java" component, accessible via components.java. The artifact associated with the Java component is the generated JAR file, and the dependencies are those of the [[Gradle_Java_Plugin#runtime|runtime]] configurations. The [[Gradle_War_Plugin|War plugin]] adds a "web" software component whose artifact is the generated WAR file, with no dependencies.
 
The available components can be displayed with:
 
<syntaxhighlight lang='groovy'>
task util {
 
    components.each { println it.name }
}
</syntaxhighlight>

Revision as of 19:02, 23 April 2021

Internal

Overview

A software components may be added by a plugin. For example the Java plugin adds a "java" component, accessible via components.java. The artifact associated with the Java component is the generated JAR file, and the dependencies are those of the runtime configurations. The War plugin adds a "web" software component whose artifact is the generated WAR file, with no dependencies.

The available components can be displayed with:

task util {

    components.each { println it.name }
}