# Maven Repository<no value>
// <!-- Required for asciidoctor -->
:toc:
// Set toclevels to be at least your hugo [markup.tableOfContents.endLevel] config key
:toclevels: 4

[cols="1^,1^,1^",options=header]
|===
| source | condition | target
| &#10004; | &#10004; | &#10007;
|===

== Description

**source**

The maven "source" retrieves the latest version from a maven repository

**condition**

The maven "condition" tests if a version exist on a maven repository.

== Parameters

{{< resourceparameters "sources" "maven" >}}

NOTE: `repository` can contain Basic Auth credentials following the standard notation: `username:password@hostname`

== Example

[source,yaml]
----
# updatecli.yaml
{{<include "assets/code_example/docs/plugins/resources/maven/updatecli.d/default.yaml">}}
----

What it says:

**Sources**

Retrieve the version from a Maven source for the artifactID "jenkins-war" from the group "org.jenkins-ci.org"
in the repository "releases" located on "repo.jenkins-ci.org"
  => 2.264
Append "jdk11" to it
  => 2.264-jdk11

**Conditions**

Then it tests two conditions:

. Do we have a docker image published on Dockerhub for the "jenkins/jenkins" using the tag "2.264-jdk11"? Yes, proceed, No then abort
. Do we have a the key jenkins.master.image set to the value "jenkins/jenkins" from the file "charts/jenkins/values.yaml" located on the git repository "git@github.com:olblak/charts.git"?
      => Yes, proceed, No then abort

**Targets**

If conditions are all met then updatecli updates, if necessary, the key
"jenkins.master.imageTag" to "2.264-jdk11" for the file "charts/jenkins/values.yaml"
from the git repository "git@github.com:olblak/charts.git" then commit the change to the
branch master.
