You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Roland Huss <ro...@gmail.com> on 2016/06/01 19:57:40 UTC

Status on namespace support for POM Elements ?

Hi,

I tried to use a namespace different than the default one for POM
elements and failed. After some research through various JIRA tickets
its seems that this is a quite old topic, but I couldn't find a
statement whether namespace it is now planned or not. It's not that I
would expect any special namespace related feature, but merely to be
able to use specify a namespace like in

<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://maven.apache.org/POM/4.0.0"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
                             http://maven.apache.org/POM/4.0.0">

 ....
 <plugin>
    ....
    <m:configuration xmlns:m="http://maven.apache.org/POM/4.0.0"
                     xmlns="http://fabric8.io/fabric8-maven-plugin">
       <myConfig>.....</myConfig>
    </m:configuration>
 </plugin>
 ....
</project>

This also my use case, namely to introduce an XSD for a plugin
configuration. Thus works with IDEA autocompletion and doc support, but
only when not switching the default namespace.

I don't know why, but I was unable to create a new issue on JIRA.
Therefore I 'hijacked' an old one because I think this is ticket is
still valid-->
https://issues.apache.org/jira/browse/MNG-2715?focusedCommentId=15307347&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-15307347

So, the question is whether there is some for namespace support to land
in Maven land ?

cheers ...
... roland

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


Re: Status on namespace support for POM Elements ?

Posted by Karl Heinz Marbaise <kh...@gmx.de>.
Hi,

On 6/1/16 9:57 PM, Roland Huss wrote:
> Hi,
>
> I tried to use a namespace different than the default one for POM
> elements and failed. After some research through various JIRA tickets
> its seems that this is a quite old topic, but I couldn't find a
> statement whether namespace it is now planned or not. It's not that I
> would expect any special namespace related feature, but merely to be
> able to use specify a namespace like in
>
> <project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>          xmlns="http://maven.apache.org/POM/4.0.0"
>          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
>                              http://maven.apache.org/POM/4.0.0">
>
>  ....
>  <plugin>
>     ....
>     <m:configuration xmlns:m="http://maven.apache.org/POM/4.0.0"
>                      xmlns="http://fabric8.io/fabric8-maven-plugin">
>        <myConfig>.....</myConfig>
>     </m:configuration>
>  </plugin>
>  ....
> </project>
>
> This also my use case, namely to introduce an XSD for a plugin
> configuration. Thus works with IDEA autocompletion and doc support, but
> only when not switching the default namespace.
>


> I don't know why, but I was unable to create a new issue on JIRA.
> Therefore I 'hijacked' an old one because I think this is ticket is
> still valid-->
> https://issues.apache.org/jira/browse/MNG-2715?focusedCommentId=15307347&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-15307347

Really bad idea to hijack an existing jira issue..
Please open a new one or if you have problems creating an issue please 
ask here on the users list first...


Kind regards
Karl Heinz Marbaise

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


Re: Status on namespace support for POM Elements ?

Posted by Roland Huss <ro...@gmail.com>.
 > With eclipse we do autocompletion for nested elements using
reflection, if
> type information is available (e.g. generics are used for List and Map
> elements) in almost the same as in Maven (almost - because maven takes
> config and tries to apply each separate value, while from the editor we
> need to discover what the model is overall - this might lead to
> inconsistencies in some corner cases). 

Sounds good :) Is it also possible to use enum values for autcompletion
when within a tag referencing an enum value ? That would be awesome.

> Also it's worth to note that maven
> doesn't look at @Parameter annotations in nested elements, it's all
> reflection.

Ah, didn't know this. So its not possible to specify default values
and/or whether a (inner) config parameter is required. An XSD based
implementation could automatically insert tags for required values here,
too (is the XSD is prepared accordinglingly with a minOccurs=1).

... roland

> 2016-06-05 23:23 GMT+03:00 Roland Huss <ro...@gmail.com>:
> 
>>
>>> Just on a side note, eclipse m2e pom editor does have an autocomplete for
>>> plugin configuration based on the plugin descriptor and the classes that
>>> are used.
>>> +1 to namespace support though, since it could be used to provide
>>> autocomplete for parts that cannot be deduced by looking at the model
>>> (xpp3dom elements, maps, etc.)
>>
>> That's true for IDEA as well. Autocompletion works nicely on top-level
>> configuration elements, however for nested structures like lists and
>> maps it doesn't work so well. I.e. deducing the element name of a
>> list-element it e.g. not possible by an IDE since in Maven afaik any
>> name is allowed for a list-element's tag. In my case
>> (docker-maven-plugin) I have configuration which is nested up to four
>> levels. That's one of the reason wgy I'm looking for IDE support here
>> (which as I said seems to work only on the top-level in IDEA).
>>
>> How is the situation in Eclipse ? Is it possible to do autocompletion on
>> list elements (and their @Parameter), too ?
>>
>> In general I have the feeling that support for XSD based autocompletion
>> is much more matured in IDEs.
>>
>> ... roland
>>
>>
>>> 2016-06-05 12:32 GMT+03:00 Stian Soiland-Reyes <st...@apache.org>:
>>>
>>>> +1 to ALLOW (but not require) the second use case of <configuration
>>>> xmlns=..>, this let you have autocomplete say in Eclipse's XML editor.
>>>> However I believe a xsi schemalocation would then still be needed per
>>>> plugin unless a catalogue is accessible out of bands, so it would still
>> be
>>>> a bit verbose.
>>>>
>>>> (I never understood why the default xsi schemalocation can't be the
>>>> namespace)
>>>> On 5 Jun 2016 8:38 a.m., "Roland Huss" <ro...@gmail.com> wrote:
>>>>
>>>>>> Do you really think introducing XML namespaces would make the handling
>>>>>> of the pom better ? In particular if you have a separate namespace for
>>>>>> every plugin? (At apache maven project we have 49 plugins ? This would
>>>>>> mean in consequence 49 namespaces? And at mojohaus there are about
>>>>>> another 50 plugins? So this means having to use the configuration
>>>>>> parameters for all the plugins and on top you need to do namespace
>>>>>> configuration in your pom file? I'm the opinion this would make things
>>>>>> worse than better...(There are some things which are better)...
>>>>>
>>>>> I don't request to *require* the use of namespaces, but not to break if
>>>>> a namespace is used. It would be competely sufficient when Maven would
>>>>> ignore namespaces. The <configuration> element is specified having a
>>>>> <xs:any> content anyway.
>>>>>
>>>>> BTW, you don't have to specify the namespace on top, but can do at
>>>>> directly on the enclosing element itself.
>>>>>
>>>>> Here's my use case: I'm writing a Maven plugin which has an XSD for its
>>>>> configuration. This is useful for rich autocompletion and inline
>>>>> documentation tooltips in a decent IDE.
>>>>>
>>>>> There are two ways how you could use this xsd:
>>>>>
>>>>> * You can declare a namespace with prefix in the preamble of your
>>>>> pom.xml but then have to use the prefix for all your configuration
>>>>> options (which is quite a lot in my use case). You are not required to
>>>>> use a namespace, though (because of the <xs:any> type of a
>> configuration)
>>>>>
>>>>> * Or, the better, more elegant way is to switch to the default
>> namespace
>>>>> to your plugin int the <configuration> element :
>>>>>
>>>>> <project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>>>          xmlns="http://maven.apache.org/POM/4.0.0"
>>>>>          xsi:schemaLocation="....">
>>>>> ...
>>>>>     <plugin>
>>>>>        ....
>>>>>        <m:configuration
>>>>>             xmlns:m="http://maven.apache.org/POM/4.0.0"
>>>>>             xmlns="https://myplugin.org/v1">
>>>>>
>>>>>           <myOption>bla</myOption>
>>>>>            ....
>>>>>        </m:configuration>
>>>>>     </plugin>
>>>>> ...
>>>>> </project>
>>>>>
>>>>> Both usage patterns are currently broken in Maven 3.3.9
>>>>>
>>>>>> In general pom changes in any way could only become part of pom model
>> 5
>>>>>> (Maven 4/5 in line)  cause it would break to many things...You can
>> take
>>>>>> a deep look into the jira for Maven 4..
>>>>>>
>>>>>
>>>>
>> https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12316922&version=12330198
>>>>>
>>>>> There is no change in the pom syntax required at all (i.e. the Schema
>> is
>>>>> exactly the same as defined in http://maven.apache.org/POM/4.0.0), its
>>>>> only about the proper XML parsing of a pom model 4 with namespaces
>>>>> (which btw each decent XML parser is capable of).
>>>>>
>>>>> But even then, is the document
>>>>>
>>>>>
>>>>
>> https://cwiki.apache.org/confluence/display/MAVEN/Moving+forward+with+the+POM+data+model
>>>>> obsolete /wrt to XML namespaces ? Or what is the status of namespace
>>>>> support for the next major Maven version ? (sorry, couldn't find any
>>>>> information about this).
>>>>>
>>>>> cheers ...
>>>>> ... roland
>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> Kind regards
>>>>>> Karl Heinz Marbaise
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>>
>>>>>
>>>>
>>>
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
> 
> 

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


Re: Status on namespace support for POM Elements ?

Posted by Anton Tanasenko <at...@gmail.com>.
With eclipse we do autocompletion for nested elements using reflection, if
type information is available (e.g. generics are used for List and Map
elements) in almost the same as in Maven (almost - because maven takes
config and tries to apply each separate value, while from the editor we
need to discover what the model is overall - this might lead to
inconsistencies in some corner cases). Also it's worth to note that maven
doesn't look at @Parameter annotations in nested elements, it's all
reflection.

2016-06-05 23:23 GMT+03:00 Roland Huss <ro...@gmail.com>:

>
> > Just on a side note, eclipse m2e pom editor does have an autocomplete for
> > plugin configuration based on the plugin descriptor and the classes that
> > are used.
> > +1 to namespace support though, since it could be used to provide
> > autocomplete for parts that cannot be deduced by looking at the model
> > (xpp3dom elements, maps, etc.)
>
> That's true for IDEA as well. Autocompletion works nicely on top-level
> configuration elements, however for nested structures like lists and
> maps it doesn't work so well. I.e. deducing the element name of a
> list-element it e.g. not possible by an IDE since in Maven afaik any
> name is allowed for a list-element's tag. In my case
> (docker-maven-plugin) I have configuration which is nested up to four
> levels. That's one of the reason wgy I'm looking for IDE support here
> (which as I said seems to work only on the top-level in IDEA).
>
> How is the situation in Eclipse ? Is it possible to do autocompletion on
> list elements (and their @Parameter), too ?
>
> In general I have the feeling that support for XSD based autocompletion
> is much more matured in IDEs.
>
> ... roland
>
>
> > 2016-06-05 12:32 GMT+03:00 Stian Soiland-Reyes <st...@apache.org>:
> >
> >> +1 to ALLOW (but not require) the second use case of <configuration
> >> xmlns=..>, this let you have autocomplete say in Eclipse's XML editor.
> >> However I believe a xsi schemalocation would then still be needed per
> >> plugin unless a catalogue is accessible out of bands, so it would still
> be
> >> a bit verbose.
> >>
> >> (I never understood why the default xsi schemalocation can't be the
> >> namespace)
> >> On 5 Jun 2016 8:38 a.m., "Roland Huss" <ro...@gmail.com> wrote:
> >>
> >>>> Do you really think introducing XML namespaces would make the handling
> >>>> of the pom better ? In particular if you have a separate namespace for
> >>>> every plugin? (At apache maven project we have 49 plugins ? This would
> >>>> mean in consequence 49 namespaces? And at mojohaus there are about
> >>>> another 50 plugins? So this means having to use the configuration
> >>>> parameters for all the plugins and on top you need to do namespace
> >>>> configuration in your pom file? I'm the opinion this would make things
> >>>> worse than better...(There are some things which are better)...
> >>>
> >>> I don't request to *require* the use of namespaces, but not to break if
> >>> a namespace is used. It would be competely sufficient when Maven would
> >>> ignore namespaces. The <configuration> element is specified having a
> >>> <xs:any> content anyway.
> >>>
> >>> BTW, you don't have to specify the namespace on top, but can do at
> >>> directly on the enclosing element itself.
> >>>
> >>> Here's my use case: I'm writing a Maven plugin which has an XSD for its
> >>> configuration. This is useful for rich autocompletion and inline
> >>> documentation tooltips in a decent IDE.
> >>>
> >>> There are two ways how you could use this xsd:
> >>>
> >>> * You can declare a namespace with prefix in the preamble of your
> >>> pom.xml but then have to use the prefix for all your configuration
> >>> options (which is quite a lot in my use case). You are not required to
> >>> use a namespace, though (because of the <xs:any> type of a
> configuration)
> >>>
> >>> * Or, the better, more elegant way is to switch to the default
> namespace
> >>> to your plugin int the <configuration> element :
> >>>
> >>> <project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> >>>          xmlns="http://maven.apache.org/POM/4.0.0"
> >>>          xsi:schemaLocation="....">
> >>> ...
> >>>     <plugin>
> >>>        ....
> >>>        <m:configuration
> >>>             xmlns:m="http://maven.apache.org/POM/4.0.0"
> >>>             xmlns="https://myplugin.org/v1">
> >>>
> >>>           <myOption>bla</myOption>
> >>>            ....
> >>>        </m:configuration>
> >>>     </plugin>
> >>> ...
> >>> </project>
> >>>
> >>> Both usage patterns are currently broken in Maven 3.3.9
> >>>
> >>>> In general pom changes in any way could only become part of pom model
> 5
> >>>> (Maven 4/5 in line)  cause it would break to many things...You can
> take
> >>>> a deep look into the jira for Maven 4..
> >>>>
> >>>
> >>
> https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12316922&version=12330198
> >>>
> >>> There is no change in the pom syntax required at all (i.e. the Schema
> is
> >>> exactly the same as defined in http://maven.apache.org/POM/4.0.0), its
> >>> only about the proper XML parsing of a pom model 4 with namespaces
> >>> (which btw each decent XML parser is capable of).
> >>>
> >>> But even then, is the document
> >>>
> >>>
> >>
> https://cwiki.apache.org/confluence/display/MAVEN/Moving+forward+with+the+POM+data+model
> >>> obsolete /wrt to XML namespaces ? Or what is the status of namespace
> >>> support for the next major Maven version ? (sorry, couldn't find any
> >>> information about this).
> >>>
> >>> cheers ...
> >>> ... roland
> >>>
> >>>>
> >>>>
> >>>>
> >>>> Kind regards
> >>>> Karl Heinz Marbaise
> >>>>
> >>>> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >>>> For additional commands, e-mail: users-help@maven.apache.org
> >>>>
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >>> For additional commands, e-mail: users-help@maven.apache.org
> >>>
> >>>
> >>
> >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Regards,
Anton.

Re: Status on namespace support for POM Elements ?

Posted by Roland Huss <ro...@gmail.com>.
> Just on a side note, eclipse m2e pom editor does have an autocomplete for
> plugin configuration based on the plugin descriptor and the classes that
> are used.
> +1 to namespace support though, since it could be used to provide
> autocomplete for parts that cannot be deduced by looking at the model
> (xpp3dom elements, maps, etc.)

That's true for IDEA as well. Autocompletion works nicely on top-level
configuration elements, however for nested structures like lists and
maps it doesn't work so well. I.e. deducing the element name of a
list-element it e.g. not possible by an IDE since in Maven afaik any
name is allowed for a list-element's tag. In my case
(docker-maven-plugin) I have configuration which is nested up to four
levels. That's one of the reason wgy I'm looking for IDE support here
(which as I said seems to work only on the top-level in IDEA).

How is the situation in Eclipse ? Is it possible to do autocompletion on
list elements (and their @Parameter), too ?

In general I have the feeling that support for XSD based autocompletion
is much more matured in IDEs.

... roland


> 2016-06-05 12:32 GMT+03:00 Stian Soiland-Reyes <st...@apache.org>:
> 
>> +1 to ALLOW (but not require) the second use case of <configuration
>> xmlns=..>, this let you have autocomplete say in Eclipse's XML editor.
>> However I believe a xsi schemalocation would then still be needed per
>> plugin unless a catalogue is accessible out of bands, so it would still be
>> a bit verbose.
>>
>> (I never understood why the default xsi schemalocation can't be the
>> namespace)
>> On 5 Jun 2016 8:38 a.m., "Roland Huss" <ro...@gmail.com> wrote:
>>
>>>> Do you really think introducing XML namespaces would make the handling
>>>> of the pom better ? In particular if you have a separate namespace for
>>>> every plugin? (At apache maven project we have 49 plugins ? This would
>>>> mean in consequence 49 namespaces? And at mojohaus there are about
>>>> another 50 plugins? So this means having to use the configuration
>>>> parameters for all the plugins and on top you need to do namespace
>>>> configuration in your pom file? I'm the opinion this would make things
>>>> worse than better...(There are some things which are better)...
>>>
>>> I don't request to *require* the use of namespaces, but not to break if
>>> a namespace is used. It would be competely sufficient when Maven would
>>> ignore namespaces. The <configuration> element is specified having a
>>> <xs:any> content anyway.
>>>
>>> BTW, you don't have to specify the namespace on top, but can do at
>>> directly on the enclosing element itself.
>>>
>>> Here's my use case: I'm writing a Maven plugin which has an XSD for its
>>> configuration. This is useful for rich autocompletion and inline
>>> documentation tooltips in a decent IDE.
>>>
>>> There are two ways how you could use this xsd:
>>>
>>> * You can declare a namespace with prefix in the preamble of your
>>> pom.xml but then have to use the prefix for all your configuration
>>> options (which is quite a lot in my use case). You are not required to
>>> use a namespace, though (because of the <xs:any> type of a configuration)
>>>
>>> * Or, the better, more elegant way is to switch to the default namespace
>>> to your plugin int the <configuration> element :
>>>
>>> <project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>          xmlns="http://maven.apache.org/POM/4.0.0"
>>>          xsi:schemaLocation="....">
>>> ...
>>>     <plugin>
>>>        ....
>>>        <m:configuration
>>>             xmlns:m="http://maven.apache.org/POM/4.0.0"
>>>             xmlns="https://myplugin.org/v1">
>>>
>>>           <myOption>bla</myOption>
>>>            ....
>>>        </m:configuration>
>>>     </plugin>
>>> ...
>>> </project>
>>>
>>> Both usage patterns are currently broken in Maven 3.3.9
>>>
>>>> In general pom changes in any way could only become part of pom model 5
>>>> (Maven 4/5 in line)  cause it would break to many things...You can take
>>>> a deep look into the jira for Maven 4..
>>>>
>>>
>> https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12316922&version=12330198
>>>
>>> There is no change in the pom syntax required at all (i.e. the Schema is
>>> exactly the same as defined in http://maven.apache.org/POM/4.0.0), its
>>> only about the proper XML parsing of a pom model 4 with namespaces
>>> (which btw each decent XML parser is capable of).
>>>
>>> But even then, is the document
>>>
>>>
>> https://cwiki.apache.org/confluence/display/MAVEN/Moving+forward+with+the+POM+data+model
>>> obsolete /wrt to XML namespaces ? Or what is the status of namespace
>>> support for the next major Maven version ? (sorry, couldn't find any
>>> information about this).
>>>
>>> cheers ...
>>> ... roland
>>>
>>>>
>>>>
>>>>
>>>> Kind regards
>>>> Karl Heinz Marbaise
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>>
>>>
>>
> 
> 
> 

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


Re: Status on namespace support for POM Elements ?

Posted by Anton Tanasenko <at...@gmail.com>.
Just on a side note, eclipse m2e pom editor does have an autocomplete for
plugin configuration based on the plugin descriptor and the classes that
are used.
+1 to namespace support though, since it could be used to provide
autocomplete for parts that cannot be deduced by looking at the model
(xpp3dom elements, maps, etc.)

2016-06-05 12:32 GMT+03:00 Stian Soiland-Reyes <st...@apache.org>:

> +1 to ALLOW (but not require) the second use case of <configuration
> xmlns=..>, this let you have autocomplete say in Eclipse's XML editor.
> However I believe a xsi schemalocation would then still be needed per
> plugin unless a catalogue is accessible out of bands, so it would still be
> a bit verbose.
>
> (I never understood why the default xsi schemalocation can't be the
> namespace)
> On 5 Jun 2016 8:38 a.m., "Roland Huss" <ro...@gmail.com> wrote:
>
> > > Do you really think introducing XML namespaces would make the handling
> > > of the pom better ? In particular if you have a separate namespace for
> > > every plugin? (At apache maven project we have 49 plugins ? This would
> > > mean in consequence 49 namespaces? And at mojohaus there are about
> > > another 50 plugins? So this means having to use the configuration
> > > parameters for all the plugins and on top you need to do namespace
> > > configuration in your pom file? I'm the opinion this would make things
> > > worse than better...(There are some things which are better)...
> >
> > I don't request to *require* the use of namespaces, but not to break if
> > a namespace is used. It would be competely sufficient when Maven would
> > ignore namespaces. The <configuration> element is specified having a
> > <xs:any> content anyway.
> >
> > BTW, you don't have to specify the namespace on top, but can do at
> > directly on the enclosing element itself.
> >
> > Here's my use case: I'm writing a Maven plugin which has an XSD for its
> > configuration. This is useful for rich autocompletion and inline
> > documentation tooltips in a decent IDE.
> >
> > There are two ways how you could use this xsd:
> >
> > * You can declare a namespace with prefix in the preamble of your
> > pom.xml but then have to use the prefix for all your configuration
> > options (which is quite a lot in my use case). You are not required to
> > use a namespace, though (because of the <xs:any> type of a configuration)
> >
> > * Or, the better, more elegant way is to switch to the default namespace
> > to your plugin int the <configuration> element :
> >
> > <project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> >          xmlns="http://maven.apache.org/POM/4.0.0"
> >          xsi:schemaLocation="....">
> > ...
> >     <plugin>
> >        ....
> >        <m:configuration
> >             xmlns:m="http://maven.apache.org/POM/4.0.0"
> >             xmlns="https://myplugin.org/v1">
> >
> >           <myOption>bla</myOption>
> >            ....
> >        </m:configuration>
> >     </plugin>
> > ...
> > </project>
> >
> > Both usage patterns are currently broken in Maven 3.3.9
> >
> > > In general pom changes in any way could only become part of pom model 5
> > > (Maven 4/5 in line)  cause it would break to many things...You can take
> > > a deep look into the jira for Maven 4..
> > >
> >
> https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12316922&version=12330198
> >
> > There is no change in the pom syntax required at all (i.e. the Schema is
> > exactly the same as defined in http://maven.apache.org/POM/4.0.0), its
> > only about the proper XML parsing of a pom model 4 with namespaces
> > (which btw each decent XML parser is capable of).
> >
> > But even then, is the document
> >
> >
> https://cwiki.apache.org/confluence/display/MAVEN/Moving+forward+with+the+POM+data+model
> > obsolete /wrt to XML namespaces ? Or what is the status of namespace
> > support for the next major Maven version ? (sorry, couldn't find any
> > information about this).
> >
> > cheers ...
> > ... roland
> >
> > >
> > >
> > >
> > > Kind regards
> > > Karl Heinz Marbaise
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > For additional commands, e-mail: users-help@maven.apache.org
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>



-- 
Regards,
Anton.

Re: Status on namespace support for POM Elements ?

Posted by Roland Huss <ro...@gmail.com>.
> +1 to ALLOW (but not require) the second use case of <configuration
> xmlns=..>, this let you have autocomplete say in Eclipse's XML editor.
> However I believe a xsi schemalocation would then still be needed per
> plugin unless a catalogue is accessible out of bands, so it would still be
> a bit verbose.

That's true, the schema location would need to be specified for the
plugins where you intend to use autocompletion. But as you said, for all
the default plugins, if they would provide an XSD for their
configuration, one could establish an internal default catalog. But most
plugins are probably not that complicated to justify the effort.

However, there exist more complex setups like e.g. our
docker-maven-plugin (here's an example:
https://github.com/fabric8io/docker-maven-plugin/blob/master/samples/data-jolokia-demo/pom.xml#L292-L340).


I don't know if that's the typical use case, but I know that people for
similar use cases often go away from configuring things within a pom.xml
and refer to external e.g. YAML files, which leads imo to sub-optimal
developer experience because of the 'media break' and even less IDE support.

... roland

> (I never understood why the default xsi schemalocation can't be the
> namespace)
> On 5 Jun 2016 8:38 a.m., "Roland Huss" <ro...@gmail.com> wrote:
> 
>>> Do you really think introducing XML namespaces would make the handling
>>> of the pom better ? In particular if you have a separate namespace for
>>> every plugin? (At apache maven project we have 49 plugins ? This would
>>> mean in consequence 49 namespaces? And at mojohaus there are about
>>> another 50 plugins? So this means having to use the configuration
>>> parameters for all the plugins and on top you need to do namespace
>>> configuration in your pom file? I'm the opinion this would make things
>>> worse than better...(There are some things which are better)...
>>
>> I don't request to *require* the use of namespaces, but not to break if
>> a namespace is used. It would be competely sufficient when Maven would
>> ignore namespaces. The <configuration> element is specified having a
>> <xs:any> content anyway.
>>
>> BTW, you don't have to specify the namespace on top, but can do at
>> directly on the enclosing element itself.
>>
>> Here's my use case: I'm writing a Maven plugin which has an XSD for its
>> configuration. This is useful for rich autocompletion and inline
>> documentation tooltips in a decent IDE.
>>
>> There are two ways how you could use this xsd:
>>
>> * You can declare a namespace with prefix in the preamble of your
>> pom.xml but then have to use the prefix for all your configuration
>> options (which is quite a lot in my use case). You are not required to
>> use a namespace, though (because of the <xs:any> type of a configuration)
>>
>> * Or, the better, more elegant way is to switch to the default namespace
>> to your plugin int the <configuration> element :
>>
>> <project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>          xmlns="http://maven.apache.org/POM/4.0.0"
>>          xsi:schemaLocation="....">
>> ...
>>     <plugin>
>>        ....
>>        <m:configuration
>>             xmlns:m="http://maven.apache.org/POM/4.0.0"
>>             xmlns="https://myplugin.org/v1">
>>
>>           <myOption>bla</myOption>
>>            ....
>>        </m:configuration>
>>     </plugin>
>> ...
>> </project>
>>
>> Both usage patterns are currently broken in Maven 3.3.9
>>
>>> In general pom changes in any way could only become part of pom model 5
>>> (Maven 4/5 in line)  cause it would break to many things...You can take
>>> a deep look into the jira for Maven 4..
>>>
>> https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12316922&version=12330198
>>
>> There is no change in the pom syntax required at all (i.e. the Schema is
>> exactly the same as defined in http://maven.apache.org/POM/4.0.0), its
>> only about the proper XML parsing of a pom model 4 with namespaces
>> (which btw each decent XML parser is capable of).
>>
>> But even then, is the document
>>
>> https://cwiki.apache.org/confluence/display/MAVEN/Moving+forward+with+the+POM+data+model
>> obsolete /wrt to XML namespaces ? Or what is the status of namespace
>> support for the next major Maven version ? (sorry, couldn't find any
>> information about this).
>>
>> cheers ...
>> ... roland
>>
>>>
>>>
>>>
>>> Kind regards
>>> Karl Heinz Marbaise
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
> 

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


Re: Status on namespace support for POM Elements ?

Posted by Stian Soiland-Reyes <st...@apache.org>.
+1 to ALLOW (but not require) the second use case of <configuration
xmlns=..>, this let you have autocomplete say in Eclipse's XML editor.
However I believe a xsi schemalocation would then still be needed per
plugin unless a catalogue is accessible out of bands, so it would still be
a bit verbose.

(I never understood why the default xsi schemalocation can't be the
namespace)
On 5 Jun 2016 8:38 a.m., "Roland Huss" <ro...@gmail.com> wrote:

> > Do you really think introducing XML namespaces would make the handling
> > of the pom better ? In particular if you have a separate namespace for
> > every plugin? (At apache maven project we have 49 plugins ? This would
> > mean in consequence 49 namespaces? And at mojohaus there are about
> > another 50 plugins? So this means having to use the configuration
> > parameters for all the plugins and on top you need to do namespace
> > configuration in your pom file? I'm the opinion this would make things
> > worse than better...(There are some things which are better)...
>
> I don't request to *require* the use of namespaces, but not to break if
> a namespace is used. It would be competely sufficient when Maven would
> ignore namespaces. The <configuration> element is specified having a
> <xs:any> content anyway.
>
> BTW, you don't have to specify the namespace on top, but can do at
> directly on the enclosing element itself.
>
> Here's my use case: I'm writing a Maven plugin which has an XSD for its
> configuration. This is useful for rich autocompletion and inline
> documentation tooltips in a decent IDE.
>
> There are two ways how you could use this xsd:
>
> * You can declare a namespace with prefix in the preamble of your
> pom.xml but then have to use the prefix for all your configuration
> options (which is quite a lot in my use case). You are not required to
> use a namespace, though (because of the <xs:any> type of a configuration)
>
> * Or, the better, more elegant way is to switch to the default namespace
> to your plugin int the <configuration> element :
>
> <project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>          xmlns="http://maven.apache.org/POM/4.0.0"
>          xsi:schemaLocation="....">
> ...
>     <plugin>
>        ....
>        <m:configuration
>             xmlns:m="http://maven.apache.org/POM/4.0.0"
>             xmlns="https://myplugin.org/v1">
>
>           <myOption>bla</myOption>
>            ....
>        </m:configuration>
>     </plugin>
> ...
> </project>
>
> Both usage patterns are currently broken in Maven 3.3.9
>
> > In general pom changes in any way could only become part of pom model 5
> > (Maven 4/5 in line)  cause it would break to many things...You can take
> > a deep look into the jira for Maven 4..
> >
> https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12316922&version=12330198
>
> There is no change in the pom syntax required at all (i.e. the Schema is
> exactly the same as defined in http://maven.apache.org/POM/4.0.0), its
> only about the proper XML parsing of a pom model 4 with namespaces
> (which btw each decent XML parser is capable of).
>
> But even then, is the document
>
> https://cwiki.apache.org/confluence/display/MAVEN/Moving+forward+with+the+POM+data+model
> obsolete /wrt to XML namespaces ? Or what is the status of namespace
> support for the next major Maven version ? (sorry, couldn't find any
> information about this).
>
> cheers ...
> ... roland
>
> >
> >
> >
> > Kind regards
> > Karl Heinz Marbaise
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Status on namespace support for POM Elements ?

Posted by Roland Huss <ro...@gmail.com>.
> Do you really think introducing XML namespaces would make the handling
> of the pom better ? In particular if you have a separate namespace for
> every plugin? (At apache maven project we have 49 plugins ? This would
> mean in consequence 49 namespaces? And at mojohaus there are about
> another 50 plugins? So this means having to use the configuration
> parameters for all the plugins and on top you need to do namespace
> configuration in your pom file? I'm the opinion this would make things
> worse than better...(There are some things which are better)...

I don't request to *require* the use of namespaces, but not to break if
a namespace is used. It would be competely sufficient when Maven would
ignore namespaces. The <configuration> element is specified having a
<xs:any> content anyway.

BTW, you don't have to specify the namespace on top, but can do at
directly on the enclosing element itself.

Here's my use case: I'm writing a Maven plugin which has an XSD for its
configuration. This is useful for rich autocompletion and inline
documentation tooltips in a decent IDE.

There are two ways how you could use this xsd:

* You can declare a namespace with prefix in the preamble of your
pom.xml but then have to use the prefix for all your configuration
options (which is quite a lot in my use case). You are not required to
use a namespace, though (because of the <xs:any> type of a configuration)

* Or, the better, more elegant way is to switch to the default namespace
to your plugin int the <configuration> element :

<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://maven.apache.org/POM/4.0.0"
         xsi:schemaLocation="....">
...
    <plugin>
       ....
       <m:configuration
            xmlns:m="http://maven.apache.org/POM/4.0.0"
            xmlns="https://myplugin.org/v1">

          <myOption>bla</myOption>
           ....
       </m:configuration>
    </plugin>
...
</project>

Both usage patterns are currently broken in Maven 3.3.9

> In general pom changes in any way could only become part of pom model 5
> (Maven 4/5 in line)  cause it would break to many things...You can take
> a deep look into the jira for Maven 4..
> https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12316922&version=12330198

There is no change in the pom syntax required at all (i.e. the Schema is
exactly the same as defined in http://maven.apache.org/POM/4.0.0), its
only about the proper XML parsing of a pom model 4 with namespaces
(which btw each decent XML parser is capable of).

But even then, is the document
https://cwiki.apache.org/confluence/display/MAVEN/Moving+forward+with+the+POM+data+model
obsolete /wrt to XML namespaces ? Or what is the status of namespace
support for the next major Maven version ? (sorry, couldn't find any
information about this).

cheers ...
... roland

> 
> 
> 
> Kind regards
> Karl Heinz Marbaise
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 

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


Re: Status on namespace support for POM Elements ?

Posted by Karl Heinz Marbaise <kh...@gmx.de>.
Hi,

On 6/5/16 7:22 AM, Roland Huss wrote:
> Hi Karl Heinz,
>
>> Really bad idea to hijack an existing jira issue..
>> Please open a new one or if you have problems creating an issue please
>> ask here on the users list first...
>
> Agreed, but I really couldn't create a new ticket at that time (only
> service desk ticket were enabled) so that what my last ressort. Sorry,
> very likely my fault, since I could open a ticket today -->
> https://issues.apache.org/jira/browse/MNG-6036

So if you couldn't open a new ticket than you should have asked first 
and waited untill someone has ansered and helped you which you 
didn't...and changed things without a need...I have removed the comment 
in MNG-2716..


Do you really think introducing XML namespaces would make the handling 
of the pom better ? In particular if you have a separate namespace for 
every plugin? (At apache maven project we have 49 plugins ? This would 
mean in consequence 49 namespaces? And at mojohaus there are about 
another 50 plugins? So this means having to use the configuration 
parameters for all the plugins and on top you need to do namespace 
configuration in your pom file? I'm the opinion this would make things 
worse than better...(There are some things which are better)...

In general pom changes in any way could only become part of pom model 5 
(Maven 4/5 in line)  cause it would break to many things...You can take 
a deep look into the jira for Maven 4..
https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12316922&version=12330198



Kind regards
Karl Heinz Marbaise

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


Re: Status on namespace support for POM Elements ?

Posted by Roland Huss <ro...@gmail.com>.
Hi Karl Heinz,

> Really bad idea to hijack an existing jira issue..
> Please open a new one or if you have problems creating an issue please
> ask here on the users list first...

Agreed, but I really couldn't create a new ticket at that time (only
service desk ticket were enabled) so that what my last ressort. Sorry,
very likely my fault, since I could open a ticket today -->
https://issues.apache.org/jira/browse/MNG-6036

Beside this, and idea or opinion on when namespace were supported as
described in
https://cwiki.apache.org/confluence/display/MAVEN/Moving+forward+with+the+POM+data+model
or even in a very lighweight way with simply ignoring namespaces ? That
should even work with a plain parser by simply stripping out any
namespace prefix before processing tags.

thanks ...
... roland

> Hi,
>
> I tried to use a namespace different than the default one for POM
> elements and failed. After some research through various JIRA tickets
> its seems that this is a quite old topic, but I couldn't find a
> statement whether namespace it is now planned or not. It's not that I
> would expect any special namespace related feature, but merely to be
> able to use specify a namespace like in
>
> <project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>          xmlns="http://maven.apache.org/POM/4.0.0"
>          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
>                              http://maven.apache.org/POM/4.0.0">
>
>  ....
>  <plugin>
>     ....
>     <m:configuration xmlns:m="http://maven.apache.org/POM/4.0.0"
>                      xmlns="http://fabric8.io/fabric8-maven-plugin">
>        <myConfig>.....</myConfig>
>     </m:configuration>
>  </plugin>
>  ....
> </project>
>
> This also my use case, namely to introduce an XSD for a plugin
> configuration. Thus works with IDEA autocompletion and doc support, but
> only when not switching the default namespace.
>
> I don't know why, but I was unable to create a new issue on JIRA.
> Therefore I 'hijacked' an old one because I think this is ticket is
> still valid-->
>
https://issues.apache.org/jira/browse/MNG-2715?focusedCommentId=15307347&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-15307347


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