Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-6005

not able to pass map kind of variables to maven goal through command line

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 3.2.1
    • None
    • Command Line
    • java 7, maven 3.2.1,Mac Yosimite,

    Description

      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<String,String> myMap = new HashMap<String, String>();

      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

      Attachments

        Activity

          People

            Unassigned Unassigned
            gangadharonweb gangadhar mamillapalli
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: