❗
|
This plugin is still WIP. The described functionality should work, but the plugin is not yet published to the Gradle Plugin Portal. So the only way to currently use it is by a custom plugin repository. |
This Gradle plugin sets basic ODS conventions when applied to a project.
It captures the required minimum of the settings to make a Gradle based build "work with ODS out of the box" as long as it is a java-ish build - that means it should work for e.g. Kotlin projects and other projects as well that depend on the Java plugin already.
At this time it contains the basic settings you would otherwise have in your build script after creating the ODS Spring Boot Quickstarter.
One of the advantages of this plugin is that in the best case you do not need to care about the specific settings and would benefit from simply updating the plugin version in case ODS changes internals. So in the best case it reduces the ODS specific configuration to:
plugins {
id 'org.opendevstack.gradle.conventions' version 'x.y.z'
}
plugins {
id("org.opendevstack.gradle.conventions") version "x.y.z"
}
In theory, you can also apply it to any existing Gradle project and by that make it compatible with ODS or replace the existing ODS specific configuration.
The following plugins are automatically applied to your project when you apply this plugin:
The Java Plugin is applied to your project without further customization.
The Jacoco Plugin is applied to your project.
-
The
jacocoTestReport
task of the Jacoco Plugin will be executed automatically after you run tests. -
The
xml.required
property of the Jacoco reports will be set totrue
.
By default, the plugin will configure a repository manager / proxy for you according to the config options table below.
The repository manager will be used to configure the following maven repositories using the configured credentials:
-
$nexus_url/repository/jcenter/
, -
$nexus_url/repository/maven-public/
, -
$nexus_url/repository/atlassian_public/
,
Property | Environment variable |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
The settings are either picked up as a gradle project property or as an environment variable, the latter one latest when you run your build during CI by ODS on jenkins / ods-pipelines.
For configuring the settings for local development you usually would put them in the gradle.properties
file in your Gradle user home directory by that configuring it for all your Gradle projects to be accessible, or in the Project root directory to keep it local to your project.
# no_nexus=true # to disable repo manager
nexus_url=https://your-nexus-instance.com/
nexus_user=john.doe
nexus_pw=superpassword
nexus_folder_releases=releases
nexus_folder_snapshots=snapshots
Setting the property no_nexus
or environment variable NO_NEXUS
, disables the use of the repository manager in effect only configuring the public mavenCentral() as your repository.