You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Elliotte Rusty Harold (Jira)" <ji...@apache.org> on 2019/12/16 12:13:00 UTC

[jira] [Updated] (MNG-6005) not able to pass map kind of variables to maven goal through command line

     [ https://issues.apache.org/jira/browse/MNG-6005?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Elliotte Rusty Harold updated MNG-6005:
---------------------------------------
    Issue Type: New Feature  (was: Bug)

> not able to pass map kind of variables to maven goal through command line
> -------------------------------------------------------------------------
>
>                 Key: MNG-6005
>                 URL: https://issues.apache.org/jira/browse/MNG-6005
>             Project: Maven
>          Issue Type: New Feature
>          Components: Command Line
>    Affects Versions: 3.2.1
>         Environment: java 7, maven 3.2.1,Mac Yosimite,
>            Reporter: gangadhar mamillapalli
>            Priority: Critical
>              Labels: command-line, commandline, maven3,
>
> am trying to pass Map kind of parameters to my maven plugin through command line. Here is how i tried,
> bq. $mvn -U -X sample.plugin:hello-maven-plugin:1.0-SNAPSHOT:sayhi -Dsayhi.myMap=key1=value1
> bq. $mvn -U -X sample.plugin:hello-maven-plugin:1.0-SNAPSHOT:sayhi -Dsayhi.myMap={key1=value1}
> None of these are working and getting following error:
> {color:red}
> Caused by:
> org.codehaus.plexus.component.configurator.ComponentConfigurationException:
> Cannot assign configuration entry 'myMap' with value '${sayhi.myMap}' of type
> java.lang.String to property of type java.util.Map
> {color:red}
> Here is my parameter in Mojo:
> {quote}
> /**
>  * My Map.
>  */
> @Parameter(property = "sayhi.myMap", required = false)
> private Map<String,String> myMap = new HashMap<String, String>();
> {quote}
> followed instructions at ==> https://maven.apache.org/guides/mini/guide-configuring-plugins.html#Mapping_Collections, but no luck., i think am missing something very small. am working on maven v3.2.1
> is am missing anything here ? am blocked on this.
> i have also posted same question stackoverflow.
> http://stackoverflow.com/questions/36678630/not-able-to-pass-map-kind-of-variables-to-maven-goal-through-command-line
> thanks 
> Gangadhar M



--
This message was sent by Atlassian Jira
(v8.3.4#803005)