You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Evgeny Goldin (JIRA)" <ji...@codehaus.org> on 2011/03/01 01:03:22 UTC
[jira] Created: (MNG-5030) Provide a way to get a raw
XML for plugin to read
Provide a way to get a raw <configuration> XML for plugin to read
-----------------------------------------------------------------
Key: MNG-5030
URL: http://jira.codehaus.org/browse/MNG-5030
Project: Maven 2 & 3
Issue Type: New Feature
Components: Plugin API
Affects Versions: 3.0.2
Reporter: Evgeny Goldin
As a plugin author I may need to read its *{{<configuration>}}* slightly different than Maven does it. It would be very nice to get a raw XML as an alternative to standard fields injection.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (MNG-5030) Provide a way to get a raw
XML for plugin to read
Posted by "Evgeny Goldin (JIRA)" <ji...@codehaus.org>.
[ https://jira.codehaus.org/browse/MNG-5030?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=275223#comment-275223 ]
Evgeny Goldin commented on MNG-5030:
------------------------------------
Another use case that can be *very* helpful to plugin authors is knowing a line number of raw XML data. So first, plugin <configuration> can be validated and if error is found a message can be displayed specifying the line where user made a mistake in configuring a plugin.
> Provide a way to get a raw <configuration> XML for plugin to read
> -----------------------------------------------------------------
>
> Key: MNG-5030
> URL: https://jira.codehaus.org/browse/MNG-5030
> Project: Maven 2 & 3
> Issue Type: New Feature
> Components: Plugin API
> Affects Versions: 3.0.2
> Reporter: Evgeny Goldin
>
> As a plugin author I may need to read its *{{<configuration>}}* slightly different than Maven does it. It would be very nice to get a raw XML as an alternative to standard fields injection.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (MNG-5030) Provide a way to get a raw
XML for plugin to read
Posted by "Evgeny Goldin (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-5030?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=258353#action_258353 ]
Evgeny Goldin commented on MNG-5030:
------------------------------------
Good, thanks! But it only works with maven 3, right? If I have an adder - Maven 2 will ignore it?
> Provide a way to get a raw <configuration> XML for plugin to read
> -----------------------------------------------------------------
>
> Key: MNG-5030
> URL: http://jira.codehaus.org/browse/MNG-5030
> Project: Maven 2 & 3
> Issue Type: New Feature
> Components: Plugin API
> Affects Versions: 3.0.2
> Reporter: Evgeny Goldin
>
> As a plugin author I may need to read its *{{<configuration>}}* slightly different than Maven does it. It would be very nice to get a raw XML as an alternative to standard fields injection.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (MNG-5030) Provide a way to get a raw
XML for plugin to read
Posted by "Evgeny Goldin (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-5030?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=258043#action_258043 ]
Evgeny Goldin commented on MNG-5030:
------------------------------------
Sure. In my plugins I [http://evgeny-goldin.com/wiki/Maven-copy-plugin#.3Cconfiguration.3E don't like] wrapping single tag with a plural option:
{code}
<configuration>
<tags>
<tag>data</tag>
</tags>
</configuration>
{code}
When there is a single tag, one can specify it:
{code}
<configuration>
<tag>data</tag>
</configuration>
{code}
I achieve this by [https://github.com/evgeny-goldin/maven-plugins/blob/0.2.1/maven-copy-plugin/src/main/groovy/com/goldin/plugins/copy/CopyMojo.groovy#L83 having]
{code}
String tag
String[] tags
{code}
in my POJO and then [https://github.com/evgeny-goldin/maven-plugins/blob/0.2.1/maven-copy-plugin/src/main/groovy/com/goldin/plugins/copy/CopyMojo.groovy#L88 analyze] what was actually set. The problem begins when a user does a mistake and forgets to wrap multiple tags:
{code}
<configuration>
<tag>data1</tag>
<tag>data2/tag>
<tag>data3</tag>
</configuration>
{code}
In this case Maven overrides each previous *{{<tag>}}* with the following one so in the end when *{{execute()}}* fires only *{{<tag>data3</tag>}}* is actually set while *{{<tag>data1</tag>}}* and *{{<tag>data2</tag>}}* are silently ignored.
If I had *{{<configuration>}}* XML I could check this case and throw an error.
In general, having _some_ way of injection control could be very helpful.
> Provide a way to get a raw <configuration> XML for plugin to read
> -----------------------------------------------------------------
>
> Key: MNG-5030
> URL: http://jira.codehaus.org/browse/MNG-5030
> Project: Maven 2 & 3
> Issue Type: New Feature
> Components: Plugin API
> Affects Versions: 3.0.2
> Reporter: Evgeny Goldin
>
> As a plugin author I may need to read its *{{<configuration>}}* slightly different than Maven does it. It would be very nice to get a raw XML as an alternative to standard fields injection.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (MNG-5030) Provide a way to get a raw
XML for plugin to read
Posted by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-5030?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=258356#action_258356 ]
Benjamin Bentmann commented on MNG-5030:
----------------------------------------
Yes, this is 3.0.3+ only, older versions will not look for the adder.
> Provide a way to get a raw <configuration> XML for plugin to read
> -----------------------------------------------------------------
>
> Key: MNG-5030
> URL: http://jira.codehaus.org/browse/MNG-5030
> Project: Maven 2 & 3
> Issue Type: New Feature
> Components: Plugin API
> Affects Versions: 3.0.2
> Reporter: Evgeny Goldin
>
> As a plugin author I may need to read its *{{<configuration>}}* slightly different than Maven does it. It would be very nice to get a raw XML as an alternative to standard fields injection.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Issue Comment Edited: (MNG-5030) Provide a way to get a raw
XML for plugin to read
Posted by "Evgeny Goldin (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-5030?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=258043#action_258043 ]
Evgeny Goldin edited comment on MNG-5030 at 2/28/11 6:20 PM:
-------------------------------------------------------------
Sure. In my plugins I [don't like|http://evgeny-goldin.com/wiki/Maven-copy-plugin#.3Cconfiguration.3E] wrapping single tag with a plural option:
{code}
<configuration>
<tags>
<tag>data</tag>
</tags>
</configuration>
{code}
When there is a single tag, one can specify it:
{code}
<configuration>
<tag>data</tag>
</configuration>
{code}
I achieve this by [having|https://github.com/evgeny-goldin/maven-plugins/blob/0.2.1/maven-copy-plugin/src/main/groovy/com/goldin/plugins/copy/CopyMojo.groovy#L83]
{code}
String tag
String[] tags
{code}
in my POJO and then [analyze|https://github.com/evgeny-goldin/maven-plugins/blob/0.2.1/maven-copy-plugin/src/main/groovy/com/goldin/plugins/copy/CopyMojo.groovy#L88] what was actually set. The problem begins when a user does a mistake and forgets to wrap multiple tags:
{code}
<configuration>
<tag>data1</tag>
<tag>data2/tag>
<tag>data3</tag>
</configuration>
{code}
In this case Maven overrides each previous *{{<tag>}}* with the following one so in the end when *{{execute()}}* fires only *{{<tag>data3</tag>}}* is actually set while *{{<tag>data1</tag>}}* and *{{<tag>data2</tag>}}* are silently ignored.
If I had *{{<configuration>}}* XML I could check this case and throw an error.
In general, having _some_ way of injection control could be very helpful.
was (Author: evgeny.goldin):
Sure. In my plugins I [http://evgeny-goldin.com/wiki/Maven-copy-plugin#.3Cconfiguration.3E don't like] wrapping single tag with a plural option:
{code}
<configuration>
<tags>
<tag>data</tag>
</tags>
</configuration>
{code}
When there is a single tag, one can specify it:
{code}
<configuration>
<tag>data</tag>
</configuration>
{code}
I achieve this by [https://github.com/evgeny-goldin/maven-plugins/blob/0.2.1/maven-copy-plugin/src/main/groovy/com/goldin/plugins/copy/CopyMojo.groovy#L83 having]
{code}
String tag
String[] tags
{code}
in my POJO and then [https://github.com/evgeny-goldin/maven-plugins/blob/0.2.1/maven-copy-plugin/src/main/groovy/com/goldin/plugins/copy/CopyMojo.groovy#L88 analyze] what was actually set. The problem begins when a user does a mistake and forgets to wrap multiple tags:
{code}
<configuration>
<tag>data1</tag>
<tag>data2/tag>
<tag>data3</tag>
</configuration>
{code}
In this case Maven overrides each previous *{{<tag>}}* with the following one so in the end when *{{execute()}}* fires only *{{<tag>data3</tag>}}* is actually set while *{{<tag>data1</tag>}}* and *{{<tag>data2</tag>}}* are silently ignored.
If I had *{{<configuration>}}* XML I could check this case and throw an error.
In general, having _some_ way of injection control could be very helpful.
> Provide a way to get a raw <configuration> XML for plugin to read
> -----------------------------------------------------------------
>
> Key: MNG-5030
> URL: http://jira.codehaus.org/browse/MNG-5030
> Project: Maven 2 & 3
> Issue Type: New Feature
> Components: Plugin API
> Affects Versions: 3.0.2
> Reporter: Evgeny Goldin
>
> As a plugin author I may need to read its *{{<configuration>}}* slightly different than Maven does it. It would be very nice to get a raw XML as an alternative to standard fields injection.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (MNG-5030) Provide a way to get a raw
XML for plugin to read
Posted by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-5030?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=258342#action_258342 ]
Benjamin Bentmann commented on MNG-5030:
----------------------------------------
bq. In my plugins I don't like wrapping single tag with a plural option:
This reminded to fill/track MNG-5033.
> Provide a way to get a raw <configuration> XML for plugin to read
> -----------------------------------------------------------------
>
> Key: MNG-5030
> URL: http://jira.codehaus.org/browse/MNG-5030
> Project: Maven 2 & 3
> Issue Type: New Feature
> Components: Plugin API
> Affects Versions: 3.0.2
> Reporter: Evgeny Goldin
>
> As a plugin author I may need to read its *{{<configuration>}}* slightly different than Maven does it. It would be very nice to get a raw XML as an alternative to standard fields injection.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (MNG-5030) Provide a way to get a raw
XML for plugin to read
Posted by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-5030?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=258040#action_258040 ]
Benjamin Bentmann commented on MNG-5030:
----------------------------------------
Could you describe an actual use case that calls for this?
> Provide a way to get a raw <configuration> XML for plugin to read
> -----------------------------------------------------------------
>
> Key: MNG-5030
> URL: http://jira.codehaus.org/browse/MNG-5030
> Project: Maven 2 & 3
> Issue Type: New Feature
> Components: Plugin API
> Affects Versions: 3.0.2
> Reporter: Evgeny Goldin
>
> As a plugin author I may need to read its *{{<configuration>}}* slightly different than Maven does it. It would be very nice to get a raw XML as an alternative to standard fields injection.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira