Uploaded image for project: 'Maven Antrun Plugin'
  1. Maven Antrun Plugin
  2. MANTRUN-184

Echo does not display decoded properties



    • Bug
    • Status: Closed
    • Minor
    • Resolution: Not A Bug
    • 1.7
    • None
    • None
    • Windows / Linux


      This bug was reported on my project (https://bitbucket.org/mcmartins/maven-plugins/issue/1/passwords-in-antrun-vs-gmaven), although after debugging I noticed that Maven AntRun echo is not printing replaced properties.

      I have a question about using the plugin with the AntRun and GMaven plugins. If I create a test POM that executes the decode-password-plugin during the initialize phase, during later phases (for example, the compile phase) the AntRun plugin does not seem to pick up a decoded property value, whereas the GMaven plugin does.
      I've attached two files, test-security-settings.xml and test-pom-04.xml, that illustrate the issue. The test-security-settings.xml file should be installed into the $HOME/.m2 directory, and the test-pom-04.xml file should be used as follows:
      mvn -f test-pom-04.xml compile
      The output is attached below. The project executes the decode-password-plugin during the initialize phase, then executes the AntRun and GMaven plugins during the compile phase. Both the AntRun and the GMaven plugin simply echo the value of an encoded property named "encrypted.passphrase". The AntRun plugin echoes the encrypted value, whereas the GMaven plugin echoes the decrypted value. The AntRun behavior is unexpected (at least to me), whereas the GMaven behavior is what I need for my Maven builds.
      So, I have three questions:
      0) Is this the correct forum in which to raise this issue, or should I try another venue like StackOverflow?
      1) Why does the AntRun plugin bind to the encrypted value of a property, as if the decode-password-plugin hasn't executed, whereas the GMaven plugin binds to the decrypted value?
      2) Is it possible to configure the AntRun plugin to bind to the decrypted value?
      Thanks in advance.

      [INFO] Scanning for projects...
      [INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
      [INFO] ------------------------------------------------------------------------
      [INFO] Building test 0.0.0-SNAPSHOT
      [INFO] ------------------------------------------------------------------------
      [INFO] --- decode-password-plugin:0.0.1:process (decode-passwords) @ test ---
      [INFO] Starting to process project properties...
      [INFO] Loading /Users/test/.m2/test-security-settings.xml
      [INFO] Processing property with key [encrypted.passphrase]
      [INFO] Finished processing project properties.
      [INFO] Merging properties...
      [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ test ---
      [INFO] Using 'UTF-8' encoding to copy filtered resources.
      [INFO] skip non existing resourceDirectory /Users/test/tmp/src/main/resources
      [INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ test ---
      [INFO] No sources to compile
      [INFO] --- maven-antrun-plugin:1.7:run (test-antrun) @ test ---
      [INFO] Executing tasks
           [echo] encrypted.passphrase: {oDKlevYkFQQHRbJFHY3mq+Hf0Af6j/nYau31JrQi1/g=}
      [INFO] Executed tasks
      [INFO] --- gmaven-plugin:1.3:execute (test-groovy) @ test ---
      encrypted.passphrase: yada-yada
      [INFO] ------------------------------------------------------------------------
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 3.490 s
      [INFO] Finished at: 2014-04-10T09:52:50-05:00
      [INFO] Final Memory: 16M/170M
      [INFO] ------------------------------------------------------------------------

      Line 412: RuntimeConfigurable.java -> Ant v1.8.2
      The third argument passed (String characters.substring(0)) contains the value parsed directly from the xml and not the one present in the first argument (Object Project (p.getProperty())).



        1. test-security-settings.xml
          0.1 kB
          Manuel Martins
        2. test-pom-04.xml
          3 kB
          Manuel Martins

        Issue Links



              Unassigned Unassigned
              mcmartins Manuel Martins
              0 Vote for this issue
              2 Start watching this issue