[MNG-6005] not able to pass map kind of variables to maven goal through command line
- Dominant language
- Java
- Stars
- 5.3k
- Forks
- 3.1k
- Avg merge
- 20h 42m
- Merged PRs (30d)
- 297
Description
**[gangadhar mamillapalli](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=gangadharonweb)** opened **[MNG-6005](https://issues.apache.org/jira/browse/MNG-6005?redirect=false)** and commented
am trying to pass Map kind of parameters to my maven plugin through command line. Here is how i tried,
> $mvn -U -X sample.plugin:hello-maven-plugin:1.0-SNAPSHOT:sayhi -Dsayhi.myMap=key1=value1
> $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:
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
Here is my parameter in Mojo:
> /**
> * My Map.
> */
> `@Parameter`(property = "sayhi.myMap", required = false)
> private Map myMap = new HashMap();
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
---
**Affects:** 3.2.1
Contributor guide
Assessment
This issue has not been assessed yet.