maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Guillaume Boué (JIRA) <j...@apache.org>
Subject [jira] [Commented] (MANTRUN-184) Echo does not display decoded properties
Date Sat, 17 Jun 2017 15:38:00 GMT

    [ https://issues.apache.org/jira/browse/MANTRUN-184?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16052883#comment-16052883
] 

Guillaume Boué commented on MANTRUN-184:
----------------------------------------

This is not a bug with the plugin, but the way the effective model is built, see also MANTRUN-172.
The expression {{$&#123;encrypted.passphrase&#125;}} is replaced during model building,
which happens before any plugin has run. As a work-around, the {{echo}} can be moved to an
external Ant build file, called within the plugin configuration.

> Echo does not display decoded properties
> ----------------------------------------
>
>                 Key: MANTRUN-184
>                 URL: https://issues.apache.org/jira/browse/MANTRUN-184
>             Project: Maven Antrun Plugin
>          Issue Type: Bug
>    Affects Versions: 1.7
>         Environment: Windows / Linux
>            Reporter: Manuel Martins
>            Priority: Minor
>         Attachments: test-pom-04.xml, test-security-settings.xml
>
>
> 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.
> "
> {code:xml}
> [INFO] Scanning for projects...
> [INFO] 
> [INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder
with a thread count of 1
> [INFO]                                                                         
> [INFO] ------------------------------------------------------------------------
> [INFO] Building test 0.0.0-SNAPSHOT
> [INFO] ------------------------------------------------------------------------
> [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] 
> [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] 
> [INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ test ---
> [INFO] No sources to compile
> [INFO] 
> [INFO] --- maven-antrun-plugin:1.7:run (test-antrun) @ test ---
> [INFO] Executing tasks
> main:
>      [echo] encrypted.passphrase: {oDKlevYkFQQHRbJFHY3mq+Hf0Af6j/nYau31JrQi1/g=}
> [INFO] Executed tasks
> [INFO] 
> [INFO] --- gmaven-plugin:1.3:execute (test-groovy) @ test ---
> Start...
> encrypted.passphrase: yada-yada
> ...Finished
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD SUCCESS
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 3.490 s
> [INFO] Finished at: 2014-04-10T09:52:50-05:00
> [INFO] Final Memory: 16M/170M
> [INFO] ------------------------------------------------------------------------
> {code}
> *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())).
> Thanks.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message