Short answer is +1, provide a solution fast, and stay backward compatible.
Longer answer: I do not see how this could really cause an issue when we
need to completely review xar packaging. Maybe we would even change them
fully, and this would be no more a xar, but this could not be discussed
during 4.2, and it could maybe even wait 5.x . In the meantime, we need a
solution, and Thomas propose a smooth and cheap solution, even if I agree
with Vincent that it is not so nice... but the xar format is not so nice,
and we all agree that it need to be refactored.
About the more general debate: How the Maven Repository use pom information
is perfect IMO and should not be changed, since this is the maven way. Each
kind of a repository may have their own way to provide information about
their packages. All Vincent said is valid to be discussed in that context,
and may be different supported way to convey the needed informations, these
are not necessarily mutually exclusives.
On Tue, Aug 28, 2012 at 5:07 PM, Thomas Mortagne
<thomas.mortagne(a)xwiki.com>wrote;wrote:
On Tue, Aug 28, 2012 at 5:02 PM, Vincent Massol
<vincent(a)massol.net>
wrote:
On Aug 28, 2012, at 4:55 PM, Thomas Mortagne <thomas.mortagne(a)xwiki.com>
wrote:
> On Tue, Aug 28, 2012 at 4:37 PM, Vincent Massol <vincent(a)massol.net>
wrote:
>>
>> On Aug 28, 2012, at 4:26 PM, Thomas Mortagne <
thomas.mortagne(a)xwiki.com> wrote:
>>
>>> On Tue, Aug 28, 2012 at 4:20 PM, Vincent Massol <vincent(a)massol.net>
wrote:
>>>>
>>>> On Aug 28, 2012, at 3:44 PM, Thomas Mortagne <
thomas.mortagne(a)xwiki.com> wrote:
>>>>
>>>>> On Tue, Aug 28, 2012 at 3:35 PM, Vincent Massol
<vincent(a)massol.net>
wrote:
>>>>>>
>>>>>> On Aug 28, 2012, at 3:31 PM, Thomas Mortagne <
thomas.mortagne(a)xwiki.com> wrote:
>>>>>>
>>>>>>> On Tue, Aug 28, 2012 at 3:23 PM, Thomas Mortagne
>>>>>>> <thomas.mortagne(a)xwiki.com> wrote:
>>>>>>>> On Tue, Aug 28, 2012 at 3:18 PM, Vincent Massol <
vincent(a)massol.net> wrote:
>>>>>>>>>
>>>>>>>>> On Aug 28, 2012, at 2:50 PM, Thomas Mortagne <
thomas.mortagne(a)xwiki.com> wrote:
>>>>>>>>>
>>>>>>>>>> On Tue, Aug 28, 2012 at 1:37 PM, Vincent Massol
<
vincent(a)massol.net> wrote:
>>>>>>>>>>>
>>>>>>>>>>> On Aug 28, 2012, at 1:15 PM, Thomas Mortagne
<
thomas.mortagne(a)xwiki.com> wrote:
>>>>>>>>>>>
>>>>>>>>>>>> Hi guys,
>>>>>>>>>>>>
>>>>>>>>>>>> I would like to modify a bit the Maven
XAR plugin to add in
the
>>>>>>>>>>>>
package.xml some extension related informations like the
extension id
>>>>>>>>>>>>
and version at the very least.
>>>>>>>>>>>
>>>>>>>>>>> Why not package the pom.xml instead in
META-INF/maven/* as
it's done by the Maven JAR plugin?
>>>>>>>>>>
>>>>>>>>>> Because it's not supposed as part of XAR
format by existing XAR
>>>>>>>>>> parser, you will get an error because it will
fail to parse it
as a
>>>>>>>>>> document.
The proposal here is to use something that already
exists,
>>>>>>>>>> does not
break anything and is very easy to do.
>>>>>>>>>
>>>>>>>>> I personally much prefer to add META-INF support over
changing
the package.xml format because it's much better aligned with all
other
formats like JAR, EAR, WAR, etc and with the way we handle JAR extensions.
>>>>>>>>
>>>>>>>> I think you don't understand what I mean here. The
issue is not
that
>>>>>>>> it's complex
to support it, adding support in 4.2 for META-INF
will
>>>>>>>> not change the
fact that you will get an error in older version
with
>>>>>>>> your XAR.
>>>>>>>>
>>>>>>>>>
>>>>>>>>> It doesn't look complex to add either, it's a
matter of
excluding META-INF files from the parser and to use the Maven Archiver
(see
http://maven.apache.org/shared/maven-archiver/).
>>>>>>>
>>>>>>> Making the XAR format depends on Maven is not exactly
something
>>>>>>> generic or even very nice. Core extension scanner is looking
at
the
>>>>>>> pom located in jar
file among other things in order to find as
much as
>>>>>>> it can but lets not
forget that this is a hack and nothing else.
>>>>>>
>>>>>> Whatever the solution we need consistency IMO. If your proposal
is
to create an extension.xml file located in META-INF/xwiki and that we would
put in all our extension types then I'm all for it too.
>>>>>>
>>>>>> I don't like mixing extension information with packaging
information. For me package.xml shouldn't contain extension information.
>>>>>
>>>>> It's exactly the same thing. The package.xml file is the XAR way
to
>>>>> provide informations about the file and is generated from the
pom.xml.
>>>>> It already provide the a
subset of extension informations (name,
>>>>> version, license, etc.) so the proposal here is about adding more
>>>>> things.
>>>>
>>>> For me the package.xml should probably even be removed or at least a
lot of information should be removed. There's no point in listing the files
explicitly for example. Same for whether it's a backup pack or not.
>>>>
>>>> And a lot of the information currently in package.xml should be
moved to META-INF/xwiki/extension.xml such as author, license, version,
name, description.
>>>>
>>>> So I'm definitely with you about creating a XWiki-specific
descriptor (not tied to maven) located in META-INF/xwiki/extension.xml for
all our extensions, but beefing up package.xml goes in the wrong direction
IMO.
>>>>
>>>> At the very least I'd like that we agree about where we'd like to
go
(I've made a proposal with META-INF/xwiki/extension.xml) and then discuss
how to get there and what it takes. If it means going through intermediary
steps, then fine, the important part for me being to agree on where we want
to go.
>>>
>>> Maybe but that's a different subject and IMO it sounds like creating a
>>> new packaging format for wiki pages.
>>
>> There are 2 topics:
>> * Create a generic format for all xwiki extensions (the
META-INF/xwiki/extension.xml), nothing to do with wiki pages
>> * Modify the existing XAR format
descriptor (package.xml) to remove
stuff that are 1) not needed (like the list of
files and 2) can be found in
the extension information (i.e. in META-INF/xwiki/extension.xml)
>>
>> So far you/we have decided that the xwiki extension format will be the
pom.xml format which is why we are using it in our JAR file to discover
extensions.
We never decided such thing.
It's a de facto choice since this is currently how our artifacts provide
extension information for the Extension Manager (we even have custom pom
properties for that).
No it's not, it's how Maven Repository provide extension information
for Extension Manager. When you install an extension from XWiki
Repository there is not a single line of code reading at any pom.xml.
Again the core extension scanner try to
find all it can from the jar located and among other things it check
if there is pom.xml because that's a format in which it can find
extension informations usually but there is others and for some JAR it
does not exists. The only other thing that look at pom.xml is the
Maven Reposirory handler (and I actually plan to move the core scanner
part which looks at pom descriptor to the Maven handler when I get
some time). Extension Manager in general does not officially depends
in any way on Maven, you don't have to build you extension with Maven
for it to be supported by Extension Manager and I hope you will never
have to.
So if you want to start designing a new packaging format no problem
and it's actually listed in
http://dev.xwiki.org/xwiki/bin/view/Design/ExtensionManageXWikiPackage
but it's a totally different subject and in no way a priority. The way
standard to provide informations about the package in a XAR is
package.xml so I'm just proposing to add one more informations. You
are talking about packing format that does not have anything to do
with XAR, the fact that you change everything and still call it XAR is
only you point of view.
I know you're on a tight schedule for 4.2 and I don't want to block you
so
I'm going to vote +0 for now but I'm still of the view that it isn't the
right place for the future. Let's hope it doesn't cause us more harm (but
it should be ok because removing one or several properties in the future is
going to be roughly the same cost).
Thanks
-Vincent
>> Based on that it's not logical to invent a new way to add extension
information even if the existing package.xml contains already some
information that happens (by pure coincidence) to be the same as the one
needed by the extension manager (for ex the version in package.xml could be
a completely different version than the extension version).
>>
>> Based on this the logic is to add the pom.xml file to the XAR.
>>
>> Now you said that you didn't think using the Maven format is good.
Fine. This is a change from what we had decided so far and I'm ready to
accept that we may want to dissociate from Maven; hence my proposal about
the META-INF/xwiki/extension.xml file.
>>
>> So we have 2 choices for me:
>> * continue with the current rule of using pom.xml files as containing
extension information
>> * decide to bite the bullet and invent a
new format for holding
extension information
>>
>> Those are the 2 *good* choices for me. Ofc we need to handle backward
compat as best as we can but that's doable.
>>
>> You'd like to do the 3rd choice which IMO is a quick and dirty
solution. I'd accept it but only as a quick hack for 4.2 and that we would
need to correct ASAP.
>>
>>> I need something for 4.2 and
>>> adding the id in package.xml along with the other existing extension
>>> informations is quick, easy, fully retro compatible and does not
>>> really introduce anything new.
>>
>> Sure but it does introduce something new: the new information you add
to
package.xml. And this is exactly like a public API; once it's there we
have to support it and be retro compatible. So we have to be careful
because it's a pain to change after.
>>
>> I'm curious to know what others think about this.
>>
>> Thanks
>> -Vincent
>>
>>>> Thanks
>>>> -Vincent
>>>>
>>>>>> Thanks
>>>>>> -Vincent
>>>>>>
>>>>>>>>> Thanks
>>>>>>>>> -Vincent
>>>>>>>>>
>>>>>>>>>>> It would be more generic and similar to how
JARs are handled.
>>>>>>>>>>>
>>>>>>>>>>> Thanks
>>>>>>>>>>> -Vincent
>>>>>>>>>>>
>>>>>>>>>>>> The idea is to be able to know what a XAR
is exactly like we
have the
>>>>>>>>>>>>
pom.xml packaged with the jar file for example.
>>>>>>>>>>>>
>>>>>>>>>>>> Among other things it will cover the
following use cases:
>>>>>>>>>>>> * when someone import a XAR with the
standard UI,
automatically
>>>>>>>>>>>>
register it in the extension index if it happen to be an
extension
>>>>>>>>>>>>
(i.e. if we find extension informations in its package.xml)
>>>>>>>>>>>> * wiki manager and workspaces can
properly register actual
extension
>>>>>>>>>>>>
when creating their default template from a XAR the first
time (this
>>>>>>>>>>>>
is for example required to be able to upgrade a farm with EM
where
>>>>>>>>>>>>
pretty much all the wiki as been created from this default
template)
>>>>>>>>>>>>
>>>>>>>>>>>> In both cases the idea is to support as
much current
behaviours as we
>>>>>>>>>>>>
can and still be able to use the full power of Extension
Manager.
>>>>>>>>>>>>
>>>>>>>>>>>> There should not be any backward
compatibility issue here
since it
>>>>>>>>>> does not
really change anything in the XAR structure.
>>>>>>>>>>
>>>>>>>>>> WDYT ?
>>>>>>>>>>
>>>>>>>>>> Here is my +1
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs
--
Thomas Mortagne
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs
--
Thomas Mortagne
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs