You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by sebb <se...@gmail.com> on 2019/08/15 10:40:18 UTC

[ALL] POM file standardisation of layout

I think it might be useful to try to work towards standardising the
order of sections within POMs.

This will make it easier to compare them across components.
(e.g. to see why one pom works and another fails!)
And should be easier to maintain.

In particular, I would like to move the developer and contributor
sections to the end.
They can be quite long, so they make it harder to read the pom.

Also to move properties near the beginning, as they are the most
likely to need change.
i.e. the main custom elements should be near the start.

I'm hoping that many poms will have a similar layout (probably many
were copied from another component).

Maybe start by extracting layouts from existing poms to create a few
skeleton poms.
Once a suitable layout has been agreed, components can be updated as
they are worked on.

Poms have a very regular structure, so it should be possible to
automate a lot of the work.

Thoughts?

I have had a look at the Maven Model [1] and Maven Code Style [2],
however I don't think they are suitable. The developer/contributor
sections are in the middle, which makes navigation harder.
Also the customised sections are scattered throughout.

Sebb.
[1] https://maven.apache.org/ref/3.6.1/maven-model/maven.html
[2] http://maven.apache.org/developers/conventions/code.html#POM_Code_Convention

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [ALL] POM file standardisation of layout

Posted by sebb <se...@gmail.com>.
On Sun, 18 Aug 2019 at 21:38, Karl Heinz Marbaise <kh...@gmx.de> wrote:
>
> Hi,
>
> you should take a look at:
>
> https://github.com/Ekryd/sortpom
>
> that allows customization...and has useful defaults.

I did, but it is not able to handle inline comments correctly.
Also it reformats text blocks.

Given that the work is once-off for each POM, and it's pretty easy to
re-order sections with a decent editor, I don't think it's worth
spending time configuring and testing an automated solution.

> Kind regards
> Karl Heinz Marbaise
>
> On 18.08.19 12:45, sebb wrote:
> > On Sun, 18 Aug 2019 at 10:19, Romain Manni-Bucau <rm...@gmail.com> wrote:
> >>
> >> Hi everyone,
> >>
> >> Why not using a plugin allowing to put it in parent pom instead of a
> >> script? >> <artifactId>tidy-maven-plugin</artifactId>
> >
> > I looked at Tidy, but it does not support customisation of the order.
> > Also it does not preserve comment placement, nor text layout within tags.
> >
> > There are other tools, but as I noted else-thread, automated tools
> > cannot guarantee correct comment placement.
> >
> > Humans are much better at this sort of task.
> >
> > BTW, if you want to check that you have not accidentally
> > dropped/duplicated any entries, a quick check is to compare the number
> > of lines before and after.
> > More detailed: compare the sorted poms (that will make it easier to
> > allow for blank line adjustments)
> >
> >> Le dim. 18 août 2019 à 10:59, Gilles Sadowski <gi...@gmail.com> a
> >> écrit :
> >>
> >>> 2019-08-15 23:54 UTC+02:00, sebb <se...@gmail.com>:
> >>>> I've produced a draft layout on the Wiki.
> >>>> Comments welcome!
> >>>> https://cwiki.apache.org/confluence/x/yg94Bw
> >>>>
> >>>> On Thu, 15 Aug 2019 at 14:43, Matt Sicker <bo...@gmail.com> wrote:
> >>>>>
> >>>>> The layout you propose sounds reasonable to me.
> >>>>>
> >>>>> On Thu, Aug 15, 2019 at 08:32, sebb <se...@gmail.com> wrote:
> >>>>>
> >>>>>> The Ruby tool and some sample output:
> >>>>>>
> >>>>>> http://svn.apache.org/repos/asf/commons/scripts/
> >>>>>> examples/
> >>>>>> pomskel.rb
> >>>
> >>> Could you make the script highlight which sections must be moved?
> >>>
> >>> Thanks,
> >>> Gilles
> >>>
> >>>>>> [...]
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> >>> For additional commands, e-mail: dev-help@commons.apache.org
> >>>
> >>>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> > For additional commands, e-mail: dev-help@commons.apache.org
> >
> >

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [ALL] POM file standardisation of layout

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

you should take a look at:

https://github.com/Ekryd/sortpom

that allows customization...and has useful defaults.

Kind regards
Karl Heinz Marbaise

On 18.08.19 12:45, sebb wrote:
> On Sun, 18 Aug 2019 at 10:19, Romain Manni-Bucau <rm...@gmail.com> wrote:
>>
>> Hi everyone,
>>
>> Why not using a plugin allowing to put it in parent pom instead of a
>> script? >> <artifactId>tidy-maven-plugin</artifactId>
>
> I looked at Tidy, but it does not support customisation of the order.
> Also it does not preserve comment placement, nor text layout within tags.
>
> There are other tools, but as I noted else-thread, automated tools
> cannot guarantee correct comment placement.
>
> Humans are much better at this sort of task.
>
> BTW, if you want to check that you have not accidentally
> dropped/duplicated any entries, a quick check is to compare the number
> of lines before and after.
> More detailed: compare the sorted poms (that will make it easier to
> allow for blank line adjustments)
>
>> Le dim. 18 août 2019 à 10:59, Gilles Sadowski <gi...@gmail.com> a
>> écrit :
>>
>>> 2019-08-15 23:54 UTC+02:00, sebb <se...@gmail.com>:
>>>> I've produced a draft layout on the Wiki.
>>>> Comments welcome!
>>>> https://cwiki.apache.org/confluence/x/yg94Bw
>>>>
>>>> On Thu, 15 Aug 2019 at 14:43, Matt Sicker <bo...@gmail.com> wrote:
>>>>>
>>>>> The layout you propose sounds reasonable to me.
>>>>>
>>>>> On Thu, Aug 15, 2019 at 08:32, sebb <se...@gmail.com> wrote:
>>>>>
>>>>>> The Ruby tool and some sample output:
>>>>>>
>>>>>> http://svn.apache.org/repos/asf/commons/scripts/
>>>>>> examples/
>>>>>> pomskel.rb
>>>
>>> Could you make the script highlight which sections must be moved?
>>>
>>> Thanks,
>>> Gilles
>>>
>>>>>> [...]
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>> For additional commands, e-mail: dev-help@commons.apache.org
>>>
>>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [ALL] POM file standardisation of layout

Posted by sebb <se...@gmail.com>.
On Sun, 18 Aug 2019 at 10:19, Romain Manni-Bucau <rm...@gmail.com> wrote:
>
> Hi everyone,
>
> Why not using a plugin allowing to put it in parent pom instead of a
> script? >> <artifactId>tidy-maven-plugin</artifactId>

I looked at Tidy, but it does not support customisation of the order.
Also it does not preserve comment placement, nor text layout within tags.

There are other tools, but as I noted else-thread, automated tools
cannot guarantee correct comment placement.

Humans are much better at this sort of task.

BTW, if you want to check that you have not accidentally
dropped/duplicated any entries, a quick check is to compare the number
of lines before and after.
More detailed: compare the sorted poms (that will make it easier to
allow for blank line adjustments)

> Le dim. 18 août 2019 à 10:59, Gilles Sadowski <gi...@gmail.com> a
> écrit :
>
> > 2019-08-15 23:54 UTC+02:00, sebb <se...@gmail.com>:
> > > I've produced a draft layout on the Wiki.
> > > Comments welcome!
> > > https://cwiki.apache.org/confluence/x/yg94Bw
> > >
> > > On Thu, 15 Aug 2019 at 14:43, Matt Sicker <bo...@gmail.com> wrote:
> > >>
> > >> The layout you propose sounds reasonable to me.
> > >>
> > >> On Thu, Aug 15, 2019 at 08:32, sebb <se...@gmail.com> wrote:
> > >>
> > >> > The Ruby tool and some sample output:
> > >> >
> > >> > http://svn.apache.org/repos/asf/commons/scripts/
> > >> > examples/
> > >> > pomskel.rb
> >
> > Could you make the script highlight which sections must be moved?
> >
> > Thanks,
> > Gilles
> >
> > >> > [...]
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> > For additional commands, e-mail: dev-help@commons.apache.org
> >
> >

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [ALL] POM file standardisation of layout

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi everyone,

Why not using a plugin allowing to put it in parent pom instead of a
script? >> <artifactId>tidy-maven-plugin</artifactId>

Le dim. 18 août 2019 à 10:59, Gilles Sadowski <gi...@gmail.com> a
écrit :

> 2019-08-15 23:54 UTC+02:00, sebb <se...@gmail.com>:
> > I've produced a draft layout on the Wiki.
> > Comments welcome!
> > https://cwiki.apache.org/confluence/x/yg94Bw
> >
> > On Thu, 15 Aug 2019 at 14:43, Matt Sicker <bo...@gmail.com> wrote:
> >>
> >> The layout you propose sounds reasonable to me.
> >>
> >> On Thu, Aug 15, 2019 at 08:32, sebb <se...@gmail.com> wrote:
> >>
> >> > The Ruby tool and some sample output:
> >> >
> >> > http://svn.apache.org/repos/asf/commons/scripts/
> >> > examples/
> >> > pomskel.rb
>
> Could you make the script highlight which sections must be moved?
>
> Thanks,
> Gilles
>
> >> > [...]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>

Re: [ALL] POM file standardisation of layout

Posted by sebb <se...@gmail.com>.
On Sun, 18 Aug 2019 at 09:59, Gilles Sadowski <gi...@gmail.com> wrote:
>
> 2019-08-15 23:54 UTC+02:00, sebb <se...@gmail.com>:
> > I've produced a draft layout on the Wiki.
> > Comments welcome!
> > https://cwiki.apache.org/confluence/x/yg94Bw
> >
> > On Thu, 15 Aug 2019 at 14:43, Matt Sicker <bo...@gmail.com> wrote:
> >>
> >> The layout you propose sounds reasonable to me.
> >>
> >> On Thu, Aug 15, 2019 at 08:32, sebb <se...@gmail.com> wrote:
> >>
> >> > The Ruby tool and some sample output:
> >> >
> >> > http://svn.apache.org/repos/asf/commons/scripts/
> >> > examples/
> >> > pomskel.rb
>
> Could you make the script highlight which sections must be moved?

The new pomline.rb script does that.

E.g. for MATH:

 1 parent
 0 modelVersion ?
 2 groupId
 3 artifactId
 4 version
 6 name
 9 inceptionYear
 7 description ?
 8 url
17 issueManagement
16 scm ?
19 distributionManagement
27 developers
28 contributors
21 dependencies ?
12 properties ?
24 build
25 reporting
26 profiles
Found 5 errors

The ones with ? are misplaced.
This shows that modelVersion should be moved up one; description
belongs after name, etc.

Quite easy to do in an editor if it is able to collapse the sections.

> Thanks,
> Gilles
>
> >> > [...]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [ALL] POM file standardisation of layout

Posted by Gilles Sadowski <gi...@gmail.com>.
2019-08-15 23:54 UTC+02:00, sebb <se...@gmail.com>:
> I've produced a draft layout on the Wiki.
> Comments welcome!
> https://cwiki.apache.org/confluence/x/yg94Bw
>
> On Thu, 15 Aug 2019 at 14:43, Matt Sicker <bo...@gmail.com> wrote:
>>
>> The layout you propose sounds reasonable to me.
>>
>> On Thu, Aug 15, 2019 at 08:32, sebb <se...@gmail.com> wrote:
>>
>> > The Ruby tool and some sample output:
>> >
>> > http://svn.apache.org/repos/asf/commons/scripts/
>> > examples/
>> > pomskel.rb

Could you make the script highlight which sections must be moved?

Thanks,
Gilles

>> > [...]

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [ALL] POM file standardisation of layout

Posted by sebb <se...@gmail.com>.
I've produced a draft layout on the Wiki.
Comments welcome!
https://cwiki.apache.org/confluence/x/yg94Bw

On Thu, 15 Aug 2019 at 14:43, Matt Sicker <bo...@gmail.com> wrote:
>
> The layout you propose sounds reasonable to me.
>
> On Thu, Aug 15, 2019 at 08:32, sebb <se...@gmail.com> wrote:
>
> > The Ruby tool and some sample output:
> >
> > http://svn.apache.org/repos/asf/commons/scripts/
> > examples/
> > pomskel.rb
> >
> > On Thu, 15 Aug 2019 at 14:08, sebb <se...@gmail.com> wrote:
> > >
> > > On Thu, 15 Aug 2019 at 13:06, Claude Warren <cl...@xenei.com> wrote:
> > > >
> > > > Since the POM is an XML document how about a simple XSLT that will
> > convert
> > > > them all to the same format.
> > >
> > > Unfortunately I don't think it's simple.
> > >
> > > Comments on their own line apply to the following tag -- but not always.
> > > And a comment at the end of a line applies to the line it is on, but
> > > appears after it in the DOM.
> > > There may be some white-space issues as well.
> > >
> > > > Alternatively an XML diff could be performed where each leaf node is
> > > > contextualized by generating the the path from the root to the leaf,
> > the
> > > > can be sorted and a standard diff performed to determine where they are
> > > > different.
> > >
> > > I've written a simple Ruby script to produce a skeleton file showing
> > > the major components.
> > > This can be used to analyse the existing layouts.
> > > Once a standard has been chosen, the tool can show which sections need
> > > to be moved.
> > >
> > > > The above being said, having a standard POM format makes sense to me.
> > >
> > > Great.
> > >
> > > > Claude
> > > >
> > > > On Thu, Aug 15, 2019 at 11:40 AM sebb <se...@gmail.com> wrote:
> > > >
> > > > > I think it might be useful to try to work towards standardising the
> > > > > order of sections within POMs.
> > > > >
> > > > > This will make it easier to compare them across components.
> > > > > (e.g. to see why one pom works and another fails!)
> > > > > And should be easier to maintain.
> > > > >
> > > > > In particular, I would like to move the developer and contributor
> > > > > sections to the end.
> > > > > They can be quite long, so they make it harder to read the pom.
> > > > >
> > > > > Also to move properties near the beginning, as they are the most
> > > > > likely to need change.
> > > > > i.e. the main custom elements should be near the start.
> > > > >
> > > > > I'm hoping that many poms will have a similar layout (probably many
> > > > > were copied from another component).
> > > > >
> > > > > Maybe start by extracting layouts from existing poms to create a few
> > > > > skeleton poms.
> > > > > Once a suitable layout has been agreed, components can be updated as
> > > > > they are worked on.
> > > > >
> > > > > Poms have a very regular structure, so it should be possible to
> > > > > automate a lot of the work.
> > > > >
> > > > > Thoughts?
> > > > >
> > > > > I have had a look at the Maven Model [1] and Maven Code Style [2],
> > > > > however I don't think they are suitable. The developer/contributor
> > > > > sections are in the middle, which makes navigation harder.
> > > > > Also the customised sections are scattered throughout.
> > > > >
> > > > > Sebb.
> > > > > [1] https://maven.apache.org/ref/3.6.1/maven-model/maven.html
> > > > > [2]
> > > > >
> > http://maven.apache.org/developers/conventions/code.html#POM_Code_Convention
> > > > >
> > > > > ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> > > > > For additional commands, e-mail: dev-help@commons.apache.org
> > > > >
> > > > >
> > > >
> > > > --
> > > > I like: Like Like - The likeliest place on the web
> > > > <http://like-like.xenei.com>
> > > > LinkedIn: http://www.linkedin.com/in/claudewarren
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> > For additional commands, e-mail: dev-help@commons.apache.org
> >
> > --
> Matt Sicker <bo...@gmail.com>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [ALL] POM file standardisation of layout

Posted by Matt Sicker <bo...@gmail.com>.
The layout you propose sounds reasonable to me.

On Thu, Aug 15, 2019 at 08:32, sebb <se...@gmail.com> wrote:

> The Ruby tool and some sample output:
>
> http://svn.apache.org/repos/asf/commons/scripts/
> examples/
> pomskel.rb
>
> On Thu, 15 Aug 2019 at 14:08, sebb <se...@gmail.com> wrote:
> >
> > On Thu, 15 Aug 2019 at 13:06, Claude Warren <cl...@xenei.com> wrote:
> > >
> > > Since the POM is an XML document how about a simple XSLT that will
> convert
> > > them all to the same format.
> >
> > Unfortunately I don't think it's simple.
> >
> > Comments on their own line apply to the following tag -- but not always.
> > And a comment at the end of a line applies to the line it is on, but
> > appears after it in the DOM.
> > There may be some white-space issues as well.
> >
> > > Alternatively an XML diff could be performed where each leaf node is
> > > contextualized by generating the the path from the root to the leaf,
> the
> > > can be sorted and a standard diff performed to determine where they are
> > > different.
> >
> > I've written a simple Ruby script to produce a skeleton file showing
> > the major components.
> > This can be used to analyse the existing layouts.
> > Once a standard has been chosen, the tool can show which sections need
> > to be moved.
> >
> > > The above being said, having a standard POM format makes sense to me.
> >
> > Great.
> >
> > > Claude
> > >
> > > On Thu, Aug 15, 2019 at 11:40 AM sebb <se...@gmail.com> wrote:
> > >
> > > > I think it might be useful to try to work towards standardising the
> > > > order of sections within POMs.
> > > >
> > > > This will make it easier to compare them across components.
> > > > (e.g. to see why one pom works and another fails!)
> > > > And should be easier to maintain.
> > > >
> > > > In particular, I would like to move the developer and contributor
> > > > sections to the end.
> > > > They can be quite long, so they make it harder to read the pom.
> > > >
> > > > Also to move properties near the beginning, as they are the most
> > > > likely to need change.
> > > > i.e. the main custom elements should be near the start.
> > > >
> > > > I'm hoping that many poms will have a similar layout (probably many
> > > > were copied from another component).
> > > >
> > > > Maybe start by extracting layouts from existing poms to create a few
> > > > skeleton poms.
> > > > Once a suitable layout has been agreed, components can be updated as
> > > > they are worked on.
> > > >
> > > > Poms have a very regular structure, so it should be possible to
> > > > automate a lot of the work.
> > > >
> > > > Thoughts?
> > > >
> > > > I have had a look at the Maven Model [1] and Maven Code Style [2],
> > > > however I don't think they are suitable. The developer/contributor
> > > > sections are in the middle, which makes navigation harder.
> > > > Also the customised sections are scattered throughout.
> > > >
> > > > Sebb.
> > > > [1] https://maven.apache.org/ref/3.6.1/maven-model/maven.html
> > > > [2]
> > > >
> http://maven.apache.org/developers/conventions/code.html#POM_Code_Convention
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> > > > For additional commands, e-mail: dev-help@commons.apache.org
> > > >
> > > >
> > >
> > > --
> > > I like: Like Like - The likeliest place on the web
> > > <http://like-like.xenei.com>
> > > LinkedIn: http://www.linkedin.com/in/claudewarren
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
> --
Matt Sicker <bo...@gmail.com>

Re: [ALL] POM file standardisation of layout

Posted by sebb <se...@gmail.com>.
The Ruby tool and some sample output:

http://svn.apache.org/repos/asf/commons/scripts/
examples/
pomskel.rb

On Thu, 15 Aug 2019 at 14:08, sebb <se...@gmail.com> wrote:
>
> On Thu, 15 Aug 2019 at 13:06, Claude Warren <cl...@xenei.com> wrote:
> >
> > Since the POM is an XML document how about a simple XSLT that will convert
> > them all to the same format.
>
> Unfortunately I don't think it's simple.
>
> Comments on their own line apply to the following tag -- but not always.
> And a comment at the end of a line applies to the line it is on, but
> appears after it in the DOM.
> There may be some white-space issues as well.
>
> > Alternatively an XML diff could be performed where each leaf node is
> > contextualized by generating the the path from the root to the leaf, the
> > can be sorted and a standard diff performed to determine where they are
> > different.
>
> I've written a simple Ruby script to produce a skeleton file showing
> the major components.
> This can be used to analyse the existing layouts.
> Once a standard has been chosen, the tool can show which sections need
> to be moved.
>
> > The above being said, having a standard POM format makes sense to me.
>
> Great.
>
> > Claude
> >
> > On Thu, Aug 15, 2019 at 11:40 AM sebb <se...@gmail.com> wrote:
> >
> > > I think it might be useful to try to work towards standardising the
> > > order of sections within POMs.
> > >
> > > This will make it easier to compare them across components.
> > > (e.g. to see why one pom works and another fails!)
> > > And should be easier to maintain.
> > >
> > > In particular, I would like to move the developer and contributor
> > > sections to the end.
> > > They can be quite long, so they make it harder to read the pom.
> > >
> > > Also to move properties near the beginning, as they are the most
> > > likely to need change.
> > > i.e. the main custom elements should be near the start.
> > >
> > > I'm hoping that many poms will have a similar layout (probably many
> > > were copied from another component).
> > >
> > > Maybe start by extracting layouts from existing poms to create a few
> > > skeleton poms.
> > > Once a suitable layout has been agreed, components can be updated as
> > > they are worked on.
> > >
> > > Poms have a very regular structure, so it should be possible to
> > > automate a lot of the work.
> > >
> > > Thoughts?
> > >
> > > I have had a look at the Maven Model [1] and Maven Code Style [2],
> > > however I don't think they are suitable. The developer/contributor
> > > sections are in the middle, which makes navigation harder.
> > > Also the customised sections are scattered throughout.
> > >
> > > Sebb.
> > > [1] https://maven.apache.org/ref/3.6.1/maven-model/maven.html
> > > [2]
> > > http://maven.apache.org/developers/conventions/code.html#POM_Code_Convention
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> > > For additional commands, e-mail: dev-help@commons.apache.org
> > >
> > >
> >
> > --
> > I like: Like Like - The likeliest place on the web
> > <http://like-like.xenei.com>
> > LinkedIn: http://www.linkedin.com/in/claudewarren

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [ALL] POM file standardisation of layout

Posted by sebb <se...@gmail.com>.
On Thu, 15 Aug 2019 at 13:06, Claude Warren <cl...@xenei.com> wrote:
>
> Since the POM is an XML document how about a simple XSLT that will convert
> them all to the same format.

Unfortunately I don't think it's simple.

Comments on their own line apply to the following tag -- but not always.
And a comment at the end of a line applies to the line it is on, but
appears after it in the DOM.
There may be some white-space issues as well.

> Alternatively an XML diff could be performed where each leaf node is
> contextualized by generating the the path from the root to the leaf, the
> can be sorted and a standard diff performed to determine where they are
> different.

I've written a simple Ruby script to produce a skeleton file showing
the major components.
This can be used to analyse the existing layouts.
Once a standard has been chosen, the tool can show which sections need
to be moved.

> The above being said, having a standard POM format makes sense to me.

Great.

> Claude
>
> On Thu, Aug 15, 2019 at 11:40 AM sebb <se...@gmail.com> wrote:
>
> > I think it might be useful to try to work towards standardising the
> > order of sections within POMs.
> >
> > This will make it easier to compare them across components.
> > (e.g. to see why one pom works and another fails!)
> > And should be easier to maintain.
> >
> > In particular, I would like to move the developer and contributor
> > sections to the end.
> > They can be quite long, so they make it harder to read the pom.
> >
> > Also to move properties near the beginning, as they are the most
> > likely to need change.
> > i.e. the main custom elements should be near the start.
> >
> > I'm hoping that many poms will have a similar layout (probably many
> > were copied from another component).
> >
> > Maybe start by extracting layouts from existing poms to create a few
> > skeleton poms.
> > Once a suitable layout has been agreed, components can be updated as
> > they are worked on.
> >
> > Poms have a very regular structure, so it should be possible to
> > automate a lot of the work.
> >
> > Thoughts?
> >
> > I have had a look at the Maven Model [1] and Maven Code Style [2],
> > however I don't think they are suitable. The developer/contributor
> > sections are in the middle, which makes navigation harder.
> > Also the customised sections are scattered throughout.
> >
> > Sebb.
> > [1] https://maven.apache.org/ref/3.6.1/maven-model/maven.html
> > [2]
> > http://maven.apache.org/developers/conventions/code.html#POM_Code_Convention
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> > For additional commands, e-mail: dev-help@commons.apache.org
> >
> >
>
> --
> I like: Like Like - The likeliest place on the web
> <http://like-like.xenei.com>
> LinkedIn: http://www.linkedin.com/in/claudewarren

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [ALL] POM file standardisation of layout

Posted by Claude Warren <cl...@xenei.com>.
Since the POM is an XML document how about a simple XSLT that will convert
them all to the same format.

Alternatively an XML diff could be performed where each leaf node is
contextualized by generating the the path from the root to the leaf, the
can be sorted and a standard diff performed to determine where they are
different.

The above being said, having a standard POM format makes sense to me.

Claude

On Thu, Aug 15, 2019 at 11:40 AM sebb <se...@gmail.com> wrote:

> I think it might be useful to try to work towards standardising the
> order of sections within POMs.
>
> This will make it easier to compare them across components.
> (e.g. to see why one pom works and another fails!)
> And should be easier to maintain.
>
> In particular, I would like to move the developer and contributor
> sections to the end.
> They can be quite long, so they make it harder to read the pom.
>
> Also to move properties near the beginning, as they are the most
> likely to need change.
> i.e. the main custom elements should be near the start.
>
> I'm hoping that many poms will have a similar layout (probably many
> were copied from another component).
>
> Maybe start by extracting layouts from existing poms to create a few
> skeleton poms.
> Once a suitable layout has been agreed, components can be updated as
> they are worked on.
>
> Poms have a very regular structure, so it should be possible to
> automate a lot of the work.
>
> Thoughts?
>
> I have had a look at the Maven Model [1] and Maven Code Style [2],
> however I don't think they are suitable. The developer/contributor
> sections are in the middle, which makes navigation harder.
> Also the customised sections are scattered throughout.
>
> Sebb.
> [1] https://maven.apache.org/ref/3.6.1/maven-model/maven.html
> [2]
> http://maven.apache.org/developers/conventions/code.html#POM_Code_Convention
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>

-- 
I like: Like Like - The likeliest place on the web
<http://like-like.xenei.com>
LinkedIn: http://www.linkedin.com/in/claudewarren