package Ġcom . vv . life . publish Ċ Ċ import Ġorg . assertj . core . api . Assertions . assertThat Ċ import Ġorg . gradle . api . Project Ċ import Ġorg . gradle . test fixtures . Project Builder Ċ import Ġorg . junit . Ass ume . assume True Ċ import Ġorg . junit . Before Ċ import Ġorg . junit . Rule Ċ import Ġorg . junit . Test Ċ import Ġorg . junit . contrib . java . lang . system . Environment Variables Ċ Ċ class ĠMaven Publish Plugin Extension Test Ġ{ ĊĠ Ġ@ get : Rule Ġval Ġenvironment Variables Ġ= ĠEnvironment Variables () ĊĊĠ Ġprivate Ġlateinit Ġvar Ġproject : ĠProject ĊĊĠ Ġ@ Before Ġfun ĠsetUp () Ġ{ ĊĠĠĠ Ġproject Ġ= ĠProject Builder . builder (). with Name (" project "). build () ĊĠ Ġ} ĊĊĠ Ġ@ Test Ġfun Ġdefault Release Repository Url () Ġ{ ĊĠĠĠ ĠassertThat (_ root _ ide _ package _. com . vv . life . publish . Maven Publish Plugin Extension ( project ). upload Arch ives . release Repository Url ). isEqualTo (" https :// oss . son atype . org / service / local / staging / deploy / maven 2 /") ĊĠ Ġ} ĊĊĠ Ġ@ Test Ġfun Ġdefault Snapshot Repository Url () Ġ{ ĊĠĠĠ ĠassertThat (_ root _ ide _ package _. com . vv . life . publish . Maven Publish Plugin Extension ( project ). upload Arch ives . snapshot Repository Url ). isEqualTo (" https :// oss . son atype . org / content / repositories / snapshots /") ĊĠ Ġ} ĊĊĠ Ġ@ Test Ġfun Ġdefault Release Repository Url EnvironmentVariable () Ġ{ ĊĠĠĠ Ġenvironment Variables . set (" RELEASE _ REPOSITORY _ URL ", Ġ" https :// releases . fake /") ĊĠĠĠ ĠassertThat (_ root _ ide _ package _. com . vv . life . publish . Maven Publish Plugin Extension ( project ). upload Arch ives . release Repository Url ). isEqualTo (" https :// releases . fake /") ĊĠ Ġ} ĊĊĠ Ġ@ Test Ġfun Ġdefault Snapshot Repository Url EnvironmentVariable () Ġ{ ĊĠĠĠ Ġenvironment Variables . set (" SNAPSHOT _ REPOSITORY _ URL ", Ġ" https :// snapshots . fake /") ĊĠĠĠ ĠassertThat (_ root _ ide _ package _. com . vv . life . publish . Maven Publish Plugin Extension ( project ). upload Arch ives . snapshot Repository Url ). isEqualTo (" https :// snapshots . fake /") ĊĠ Ġ} ĊĊĠ Ġ@ Test Ġfun Ġdefault Repository Username EnvironmentVariable () Ġ{ ĊĠĠĠ Ġenvironment Variables . set (" SON AT YPE _ N EX US _ USERNAME ", Ġ" env ") ĊĠĠĠ ĠassertThat (_ root _ ide _ package _. com . vv . life . publish . Maven Publish Plugin Extension ( project ). upload Arch ives . repository Username ). isEqualTo (" env ") ĊĠ Ġ} ĊĊĠ Ġ@ Test Ġfun Ġdefault Repository Username Nothing () Ġ{ ĊĠĠĠ Ġassume True ( System . getenv (" TR AV IS ") Ġ!= Ġ" true ") Ġ// ĠDo Ġnot Ġrun Ġon Ġtravis Ġsince Ġwe Ġinject Ġthe Ġsame Ġvalues . ĊĠĠĠ ĠassertThat (_ root _ ide _ package _. com . vv . life . publish . Maven Publish Plugin Extension ( project ). upload Arch ives . repository Username ). isNull () ĊĠ Ġ} ĊĊĠ Ġ@ Test Ġfun Ġdefault Repository Password EnvironmentVariable () Ġ{ ĊĠĠĠ Ġenvironment Variables . set (" SON AT YPE _ N EX US _ PASSWORD ", Ġ" env ") ĊĠĠĠ ĠassertThat (_ root _ ide _ package _. com . vv . life . publish . Maven Publish Plugin Extension ( project ). upload Arch ives . repository Password ). isEqualTo (" env ") ĊĠ Ġ} ĊĊĠ Ġ@ Test Ġfun Ġdefault Repository Password Nothing () Ġ{ ĊĠĠĠ Ġassume True ( System . getenv (" TR AV IS ") Ġ!= Ġ" true ") Ġ// ĠDo Ġnot Ġrun Ġon Ġtravis Ġsince Ġwe Ġinject Ġthe Ġsame Ġvalues . ĊĠĠĠ ĠassertThat (_ root _ ide _ package _. com . vv . life . publish . Maven Publish Plugin Extension ( project ). upload Arch ives . repository Password ). isNull () ĊĠ Ġ} ĊĊĠ Ġprivate Ġval Ġ_ root _ ide _ package _. com . vv . life . publish . Maven Publish Plugin Extension . upload Arch ives Ġget () Ġ= Ġtargets . get ByName (" upload Arch ives ") Ċ } Ċ