title: Using exec-maven-plugin to run external program with secured token from azure pipeline
body: <p>There are a number of questions on exec-maven-plugin here but this is different. I'm trying to run an external program using exec-maven-plugin with exec goal in maven. One of the arguments to be passes is a secured token defined on azure pipeline.</p>
  <p>The issue is that if I hardcode the token, meaning the actual token value without securing it and I run the mvn exec:exec command, it works. But when I pass the secured token from azure pipeline, it fails to communicate with the external program.</p>
  <p>Is there a way to decrypt this secure token before passing it as an argument in the exec-maven-plugin or is there any other way to get this to work?</p>
  <p>Relevant part of the pom is:</p>
  <pre><code>&lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
                &lt;artifactId&gt;exec-maven-plugin&lt;/artifactId&gt;
                &lt;version&gt;3.0.0&lt;/version&gt;
                &lt;executions&gt;
                    &lt;execution&gt;
                        &lt;phase&gt;package&lt;/phase&gt;
                        &lt;goals&gt;
                            &lt;goal&gt;exec&lt;/goal&gt;
                        &lt;/goals&gt;
                    &lt;/execution&gt;
                &lt;/executions&gt;
                &lt;configuration&gt;
                    &lt;executable&gt;java&lt;/executable&gt;
                    &lt;arguments&gt;
                        &lt;argument&gt;-Djavax.net.ssl.trustStore=$(env.MAVEN_TRUST_STORE)&lt;/argument&gt;
                        &lt;argument&gt;-jar&lt;/argument&gt;
                        &lt;argument&gt;                            ${settings.localRepository}/com/github/externalprogram/ddd/$(ddd.version)/ddd-$(ddd.version).jar
                        &lt;/argument&gt;
                        &lt;argument&gt;--externalprogram.url=https://xxxx.yyyy.com/&lt;/argument&gt;
                        &lt;argument&gt;--externalprogram.proxy.host=${someproxy}&lt;/argument&gt;
                        &lt;argument&gt;--externalprogram.proxy.port=0000&lt;/argument&gt;
                        &lt;argument&gt;--externalprogram.api.token=$**(secure-token)**&lt;/argument&gt;
                        &lt;argument&gt;--detect.maven.path=$(env.M2_HOME)/bin/$(mvn)&lt;/argument&gt;
                        &lt;argument&gt;--detect.maven.include.plugins=true&lt;/argument&gt;
                        &lt;argument&gt;--detect.maven.build.command=-s $(env.MAVEN_SETTINGS_XML) -Djavax.net.ssl.trustStore=$(env.MAVEN_TRUST_STORE)
                        &lt;/argument&gt;
                        &lt;argument&gt;--detect.included.detector.types=maven,pip,npm&lt;/argument&gt;
                        &lt;argument&gt;
                            --detect.externalprogram.signature.scanner.exclusion.name.patterns=*target*,*/target,*\target
                        &lt;/argument&gt;
                        &lt;argument&gt;--detect.bdio2.enabled=false&lt;/argument&gt;
                        &lt;argument&gt;--detect.project.version.phase=$(versionPhase)&lt;/argument&gt;
                        &lt;argument&gt;--detect.code.location.name=${project.version}&lt;/argument&gt;
                    &lt;/arguments&gt;
                &lt;/configuration&gt;
            &lt;/plugin&gt;
  </code></pre>
  <p>So if I replace the secure-token with the actual value, it works. But when I use the secured value it fails with error: Fails to communicate with external program. Not authorized...</p>