Generate scrambled build parameters using Maven plugin

On the wiki page https://confluence.jetbrains.com/display/TCD10/Kotlin+DSL#KotlinDSL-Passwords-RelatedQuestions the usage of the teamcity-configs-maven-plugin Maven plugin is described. However, the output is always the same, even when specifying another value for the text parameter:

e.g.

$ mvn -Dtext="mysecret" org.jetbrains.teamcity:teamcity-configs-maven-plugin:scramble
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Config DSL Script 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- teamcity-configs-maven-plugin:10.0.3:scramble (default-cli) @ ahp_buildserver_dsl ---
[INFO] Scrambled text:
[INFO] zxx98ecc0a185d2556f
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.964 s
[INFO] Finished at: 2018-07-02T14:50:04+02:00
[INFO] Final Memory: 11M/241M
[INFO] ------------------------------------------------------------------------
$ mvn org.jetbrains.teamcity:teamcity-configs-maven-plugin:scramble
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Config DSL Script 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- teamcity-configs-maven-plugin:10.0.3:scramble (default-cli) @ ahp_buildserver_dsl ---
[INFO] Scrambled text:
[INFO] zxx98ecc0a185d2556f
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.939 s
[INFO] Finished at: 2018-07-02T14:50:13+02:00
[INFO] Final Memory: 11M/241M
[INFO] ------------------------------------------------------------------------

Can someone explain me how to use the Maven plugin?

Cheers,

Jan

0
1 comment

I have to say that I don't know how you managed to succeed without the -Dtext parameter. If I try it I get a failure because the parameter is expected to be non-null. Maybe you are using an older version that didn't check for null values.

In any case, I've tested with multiple different texts and it produces a different output each time, although the output always starts with "zxx", the rest of the characters do change. This is done to mark scrambled values.

Also, as mentioned in the link you copied, please use tokens instead of passwords. If you aren't on 2017.1 already, we'd strongly recommend to upgrade.

0

Please sign in to leave a comment.