You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Alexander Kriegisch <al...@kriegisch.name> on 2024/01/13 03:41:03 UTC

Can plugin.xml contain information about complex parameter types?

I tried web search, mailing list search and generative AI before asking
here:

Not being experienced in Maven plugin development, I have created a
plugin from scratch, which soon I intend to publish. I have something
like this in my mojo:

  @Parameter(required = true)
  protected List<JavaAgent> javaAgents;

JavaAgent is basically a Java Bean with several properties. It would be
nice for users to get typing help in their respective IDEs when
configuring the plugin. There is "intelli-sense" up to this point:

  <configuration>
    <javaAgents>
      <javaAgent></javaAgent>
    </javaAgents>
  </configuration>

But now inside 'javaAgent', the user is on her own, because in
plugin.xml there is only:

  <parameter>
    <name>javaAgents</name>
    <type>java.util.List</type>
    <required>true</required>
    <editable>true</editable>
    <description>some description</description>
  </parameter>

In the transitory plugin-enhanced.xml, at least there is:

  <parameter>
    <name>javaAgents</name>
    <type>java.util.List&lt;dev.aspectj.maven.agent_embedder.JavaAgent&gt;</type>
    <required>true</required>
    <editable>true</editable>
    <description>some description</description>
  </parameter>

So, the list type is more specific. But in the built plugin, this extra
information is gone.

Is there any way to add more specific type information to plugin.xml,
something that could help an IDE to figure out which properties there
are for list element types? Of course, I can a lengthy javadoc, which
then can be displayed in the help goal or in the IDE as a pop-up, but
XML code completon would be much nicer and less error-prone.

Regards
-- 
Alexander Kriegisch
https://scrum-master.de

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org