[Proposal] Pom Code Style (WAS svn commit: r670264 - /maven/plugins/trunk/maven-site-plugin/pom.xml)

classic Classic list List threaded Threaded
34 messages Options
12
Reply | Threaded
Open this post in threaded view
|

[Proposal] Pom Code Style (WAS svn commit: r670264 - /maven/plugins/trunk/maven-site-plugin/pom.xml)

Vincent Siveton-2
Hi,

I propose to improve [1] to add a code style for our pom files. As the
following tags are required: modelVersion, groupId, artifactId and
version (see [2]),  I see the following in this order.

<project>
  <modelVersion/>

  <parent/> if required

  <groupId/>
  <artifactId/>
  <version/>

  <name/>
  <description/>

  <prerequisites/>  if required

  <scm/>

  <issueManagement/>

  <dependencies/>

  <build/>  if required

  <reporting/>  if required

  <profiles/>  if required

  <properties/> if required
</project>

My reasoning is mainly based on the consistency and the maintenance.

WDYT?

Vincent

[1] http://maven.apache.org/guides/development/guide-m2-development.html
[2] http://maven.apache.org/guides/introduction/introduction-to-the-pom.html#Minimal_POM

---------- Forwarded message ----------
From:  <[hidden email]>
Date: 2008/6/21
Subject: svn commit: r670264 - /maven/plugins/trunk/maven-site-plugin/pom.xml
To: [hidden email]


Author: dennisl
Date: Sat Jun 21 15:00:07 2008
New Revision: 670264

URL: http://svn.apache.org/viewvc?rev=670264&view=rev
Log:
o Reorder POM elements.

Modified:
   maven/plugins/trunk/maven-site-plugin/pom.xml

Modified: maven/plugins/trunk/maven-site-plugin/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/pom.xml?rev=670264&r1=670263&r2=670264&view=diff
==============================================================================
--- maven/plugins/trunk/maven-site-plugin/pom.xml (original)
+++ maven/plugins/trunk/maven-site-plugin/pom.xml Sat Jun 21 15:00:07 2008
@@ -19,18 +19,17 @@
 -->

 <project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
-  <modelVersion>4.0.0</modelVersion>
-
  <parent>
    <artifactId>maven-plugins</artifactId>
    <groupId>org.apache.maven.plugins</groupId>
    <version>11</version>
  </parent>

+  <modelVersion>4.0.0</modelVersion>
  <artifactId>maven-site-plugin</artifactId>
-  <version>2.0-beta-7-SNAPSHOT</version>
  <packaging>maven-plugin</packaging>
  <name>Maven Site Plugin</name>
+  <version>2.0-beta-7-SNAPSHOT</version>
  <description>
    The Maven Site Plugin is a plugin that generates a site for the
current project.
  </description>
@@ -148,6 +147,64 @@
    <url>http://svn.apache.org/viewvc/maven/plugins/trunk/maven-site-plugin/</url>
  </scm>

+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-plugin-plugin</artifactId>
+        <version>2.4.2-SNAPSHOT</version>
+      </plugin>
+      <plugin>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <version>2.3</version>
+      </plugin>
+    </plugins>
+  </build>
+
+  <profiles>
+    <profile>
+      <id>integration-tests</id>
+      <activation>
+        <property>
+          <name>maven.test.skip</name>
+          <value>!true</value>
+        </property>
+      </activation>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-invoker-plugin</artifactId>
+            <version>1.2</version>
+            <configuration>
+              <projectsDirectory>src/it</projectsDirectory>
+              <pomIncludes>
+                <pomInclude>**/**/pom.xml</pomInclude>
+              </pomIncludes>
+              <postBuildHookScript>verify.bsh</postBuildHookScript>
+              <localRepositoryPath>${basedir}/target/local-repo</localRepositoryPath>
+              <goals>
+                <goal>clean</goal>
+
<goal>${project.groupId}:${project.artifactId}:${project.version}:site</goal>
+              </goals>
+              <settingsFile>src/it/settings.xml</settingsFile>
+            </configuration>
+            <executions>
+              <execution>
+                <id>integration-test</id>
+                <phase>integration-test</phase>
+                <goals>
+                  <goal>install</goal>
+                  <goal>run</goal>
+                </goals>
+              </execution>
+           </executions>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+  </profiles>
+
  <dependencies>
    <!-- Maven -->
    <dependency>
@@ -286,70 +343,6 @@
    </dependency>
  </dependencies>

-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-plugin-plugin</artifactId>
-        <version>2.4.2-SNAPSHOT</version>
-      </plugin>
-      <plugin>
-        <artifactId>maven-surefire-plugin</artifactId>
-        <version>2.3</version>
-      </plugin>
-    </plugins>
-  </build>
-
-  <profiles>
-    <profile>
-      <id>integration-tests</id>
-      <activation>
-        <property>
-          <name>maven.test.skip</name>
-          <value>!true</value>
-        </property>
-      </activation>
-      <build>
-        <plugins>
-          <plugin>
-            <groupId>org.apache.maven.plugins</groupId>
-            <artifactId>maven-invoker-plugin</artifactId>
-            <version>1.2</version>
-            <configuration>
-              <projectsDirectory>src/it</projectsDirectory>
-              <pomIncludes>
-                <pomInclude>**/**/pom.xml</pomInclude>
-              </pomIncludes>
-              <postBuildHookScript>verify.bsh</postBuildHookScript>
-              <localRepositoryPath>${basedir}/target/local-repo</localRepositoryPath>
-              <goals>
-                <goal>clean</goal>
-
<goal>${project.groupId}:${project.artifactId}:${project.version}:site</goal>
-              </goals>
-              <settingsFile>src/it/settings.xml</settingsFile>
-            </configuration>
-            <executions>
-              <execution>
-                <id>integration-test</id>
-                <phase>integration-test</phase>
-                <goals>
-                  <goal>install</goal>
-                  <goal>run</goal>
-                </goals>
-              </execution>
-           </executions>
-          </plugin>
-        </plugins>
-      </build>
-    </profile>
-  </profiles>
-
-  <properties>
-    <doxiaVersion>1.0-alpha-11</doxiaVersion>
-    <doxiaSitetoolsVersion>1.0-alpha-11</doxiaSitetoolsVersion>
-    <wagonVersion>1.0-beta-2</wagonVersion>
-  </properties>
-
  <reporting>
    <plugins>
      <plugin>
@@ -381,4 +374,10 @@
      </plugin>
    </plugins>
  </reporting>
+
+  <properties>
+    <doxiaVersion>1.0-alpha-11</doxiaVersion>
+    <doxiaSitetoolsVersion>1.0-alpha-11</doxiaSitetoolsVersion>
+    <wagonVersion>1.0-beta-2</wagonVersion>
+  </properties>
 </project>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [Proposal] Pom Code Style (WAS svn commit: r670264 - /maven/plugins/trunk/maven-site-plugin/pom.xml)

Benjamin Bentmann
Vincent Siveton schrieb:

> I propose to improve [1] to add a code style for our pom files.

+1 for some convention (which is documented as such).

> I see the following in this order.

Considering other POMs like parent POMs and Mojo, your proposal should
finally cover all POM elements (e.g. <packaging>, <url>, <licenses>,
<developers> etc.).

Whatever we agree upon, we might want to update the Maven Model
Reference [0], too. I guess that was the ordering Dennis has chosen.

If not already written down, the indentation style (2 spaces) should be
mentioned, too.

> <project>
>   ...
> </project>

I find your proposed ordering more intuitive than the current Model Ref.


Benjamin


[0] http://maven.apache.org/ref/current/maven-model/maven.html

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [Proposal] Pom Code Style (WAS svn commit: r670264 - /maven/plugins/trunk/maven-site-plugin/pom.xml)

jdcasey
It would probably be a good idea to reorder the fields in the maven.mdo
file inside the maven-model project, to reflect the preferred style.
This should have the effect of reordering the generated reference
documentation and will also affect the ordering achieved when a POM is
written programmatically using the xpp3 writer (I think).

-john

Benjamin Bentmann wrote:

> Vincent Siveton schrieb:
>
>> I propose to improve [1] to add a code style for our pom files.
>
> +1 for some convention (which is documented as such).
>
>> I see the following in this order.
>
> Considering other POMs like parent POMs and Mojo, your proposal should
> finally cover all POM elements (e.g. <packaging>, <url>, <licenses>,
> <developers> etc.).
>
> Whatever we agree upon, we might want to update the Maven Model
> Reference [0], too. I guess that was the ordering Dennis has chosen.
>
> If not already written down, the indentation style (2 spaces) should
> be mentioned, too.
>
>> <project>
>>   ...
>> </project>
>
> I find your proposed ordering more intuitive than the current Model Ref.
>
>
> Benjamin
>
>
> [0] http://maven.apache.org/ref/current/maven-model/maven.html
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>

--
John Casey
Developer, PMC Member - Apache Maven (http://maven.apache.org)
Blog: http://www.ejlife.net/blogs/buildchimp/


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [Proposal] Pom Code Style (WAS svn commit: r670264 - /maven/plugins/trunk/maven-site-plugin/pom.xml)

Raphaël Piéroni-4
Hi folks,

As i lazy user, i would like the automatic ordering to write things
in a specific order: first come the things that have the greater
chance to be changed/read,
and then go to the end of the file with things that are not relevant
for a reader/modifier
ending with modelVersion.

my 2 cents

Raphaël

2008/6/24 John Casey <[hidden email]>:

> It would probably be a good idea to reorder the fields in the maven.mdo file
> inside the maven-model project, to reflect the preferred style. This should
> have the effect of reordering the generated reference documentation and will
> also affect the ordering achieved when a POM is written programmatically
> using the xpp3 writer (I think).
>
> -john
>
> Benjamin Bentmann wrote:
>>
>> Vincent Siveton schrieb:
>>
>>> I propose to improve [1] to add a code style for our pom files.
>>
>> +1 for some convention (which is documented as such).
>>
>>> I see the following in this order.
>>
>> Considering other POMs like parent POMs and Mojo, your proposal should
>> finally cover all POM elements (e.g. <packaging>, <url>, <licenses>,
>> <developers> etc.).
>>
>> Whatever we agree upon, we might want to update the Maven Model Reference
>> [0], too. I guess that was the ordering Dennis has chosen.
>>
>> If not already written down, the indentation style (2 spaces) should be
>> mentioned, too.
>>
>>> <project>
>>>  ...
>>> </project>
>>
>> I find your proposed ordering more intuitive than the current Model Ref.
>>
>>
>> Benjamin
>>
>>
>> [0] http://maven.apache.org/ref/current/maven-model/maven.html
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>
> --
> John Casey
> Developer, PMC Member - Apache Maven (http://maven.apache.org)
> Blog: http://www.ejlife.net/blogs/buildchimp/
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: [Proposal] Pom Code Style (WAS svn commit: r670264 - /maven/plugins/trunk/maven-site-plugin/pom.xml)

jdcasey
Does that mean plugin configurations come first? That could be pretty
hard to wade through...

Raphaël Piéroni wrote:

> Hi folks,
>
> As i lazy user, i would like the automatic ordering to write things
> in a specific order: first come the things that have the greater
> chance to be changed/read,
> and then go to the end of the file with things that are not relevant
> for a reader/modifier
> ending with modelVersion.
>
> my 2 cents
>
> Raphaël
>
> 2008/6/24 John Casey <[hidden email]>:
>  
>> It would probably be a good idea to reorder the fields in the maven.mdo file
>> inside the maven-model project, to reflect the preferred style. This should
>> have the effect of reordering the generated reference documentation and will
>> also affect the ordering achieved when a POM is written programmatically
>> using the xpp3 writer (I think).
>>
>> -john
>>
>> Benjamin Bentmann wrote:
>>    
>>> Vincent Siveton schrieb:
>>>
>>>      
>>>> I propose to improve [1] to add a code style for our pom files.
>>>>        
>>> +1 for some convention (which is documented as such).
>>>
>>>      
>>>> I see the following in this order.
>>>>        
>>> Considering other POMs like parent POMs and Mojo, your proposal should
>>> finally cover all POM elements (e.g. <packaging>, <url>, <licenses>,
>>> <developers> etc.).
>>>
>>> Whatever we agree upon, we might want to update the Maven Model Reference
>>> [0], too. I guess that was the ordering Dennis has chosen.
>>>
>>> If not already written down, the indentation style (2 spaces) should be
>>> mentioned, too.
>>>
>>>      
>>>> <project>
>>>>  ...
>>>> </project>
>>>>        
>>> I find your proposed ordering more intuitive than the current Model Ref.
>>>
>>>
>>> Benjamin
>>>
>>>
>>> [0] http://maven.apache.org/ref/current/maven-model/maven.html
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [hidden email]
>>> For additional commands, e-mail: [hidden email]
>>>
>>>      
>> --
>> John Casey
>> Developer, PMC Member - Apache Maven (http://maven.apache.org)
>> Blog: http://www.ejlife.net/blogs/buildchimp/
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>>    

--
John Casey
Developer, PMC Member - Apache Maven (http://maven.apache.org)
Blog: http://www.ejlife.net/blogs/buildchimp/


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [Proposal] Pom Code Style (WAS svn commit: r670264 - /maven/plugins/trunk/maven-site-plugin/pom.xml)

Raphaël Piéroni-4
i would say
first the definition of the module (parent, packaging, name, groupid,
artifactid)
latest modelVersion, issuemanagment, scm, deployment

in the middle, i am not sure

Raphaël

2008/6/24 John Casey <[hidden email]>:

> Does that mean plugin configurations come first? That could be pretty hard
> to wade through...
>
> Raphaël Piéroni wrote:
>>
>> Hi folks,
>>
>> As i lazy user, i would like the automatic ordering to write things
>> in a specific order: first come the things that have the greater
>> chance to be changed/read,
>> and then go to the end of the file with things that are not relevant
>> for a reader/modifier
>> ending with modelVersion.
>>
>> my 2 cents
>>
>> Raphaël
>>
>> 2008/6/24 John Casey <[hidden email]>:
>>
>>>
>>> It would probably be a good idea to reorder the fields in the maven.mdo
>>> file
>>> inside the maven-model project, to reflect the preferred style. This
>>> should
>>> have the effect of reordering the generated reference documentation and
>>> will
>>> also affect the ordering achieved when a POM is written programmatically
>>> using the xpp3 writer (I think).
>>>
>>> -john
>>>
>>> Benjamin Bentmann wrote:
>>>
>>>>
>>>> Vincent Siveton schrieb:
>>>>
>>>>
>>>>>
>>>>> I propose to improve [1] to add a code style for our pom files.
>>>>>
>>>>
>>>> +1 for some convention (which is documented as such).
>>>>
>>>>
>>>>>
>>>>> I see the following in this order.
>>>>>
>>>>
>>>> Considering other POMs like parent POMs and Mojo, your proposal should
>>>> finally cover all POM elements (e.g. <packaging>, <url>, <licenses>,
>>>> <developers> etc.).
>>>>
>>>> Whatever we agree upon, we might want to update the Maven Model
>>>> Reference
>>>> [0], too. I guess that was the ordering Dennis has chosen.
>>>>
>>>> If not already written down, the indentation style (2 spaces) should be
>>>> mentioned, too.
>>>>
>>>>
>>>>>
>>>>> <project>
>>>>>  ...
>>>>> </project>
>>>>>
>>>>
>>>> I find your proposed ordering more intuitive than the current Model Ref.
>>>>
>>>>
>>>> Benjamin
>>>>
>>>>
>>>> [0] http://maven.apache.org/ref/current/maven-model/maven.html
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: [hidden email]
>>>> For additional commands, e-mail: [hidden email]
>>>>
>>>>
>>>
>>> --
>>> John Casey
>>> Developer, PMC Member - Apache Maven (http://maven.apache.org)
>>> Blog: http://www.ejlife.net/blogs/buildchimp/
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [hidden email]
>>> For additional commands, e-mail: [hidden email]
>>>
>>>
>>>
>
> --
> John Casey
> Developer, PMC Member - Apache Maven (http://maven.apache.org)
> Blog: http://www.ejlife.net/blogs/buildchimp/
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: [Proposal] Pom Code Style (WAS svn commit: r670264 - /maven/plugins/trunk/maven-site-plugin/pom.xml)

Jason van Zyl
In reply to this post by jdcasey
+1

On 24-Jun-08, at 9:48 AM, John Casey wrote:

> It would probably be a good idea to reorder the fields in the  
> maven.mdo file inside the maven-model project, to reflect the  
> preferred style. This should have the effect of reordering the  
> generated reference documentation and will also affect the ordering  
> achieved when a POM is written programmatically using the xpp3  
> writer (I think).
>
> -john
>
> Benjamin Bentmann wrote:
>> Vincent Siveton schrieb:
>>
>>> I propose to improve [1] to add a code style for our pom files.
>>
>> +1 for some convention (which is documented as such).
>>
>>> I see the following in this order.
>>
>> Considering other POMs like parent POMs and Mojo, your proposal  
>> should finally cover all POM elements (e.g. <packaging>, <url>,  
>> <licenses>, <developers> etc.).
>>
>> Whatever we agree upon, we might want to update the Maven Model  
>> Reference [0], too. I guess that was the ordering Dennis has chosen.
>>
>> If not already written down, the indentation style (2 spaces)  
>> should be mentioned, too.
>>
>>> <project>
>>>  ...
>>> </project>
>>
>> I find your proposed ordering more intuitive than the current Model  
>> Ref.
>>
>>
>> Benjamin
>>
>>
>> [0] http://maven.apache.org/ref/current/maven-model/maven.html
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>
> --
> John Casey
> Developer, PMC Member - Apache Maven (http://maven.apache.org)
> Blog: http://www.ejlife.net/blogs/buildchimp/
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>

Thanks,

Jason

----------------------------------------------------------
Jason van Zyl
Founder,  Apache Maven
jason at sonatype dot com
----------------------------------------------------------

What matters is not ideas, but the people who have them. Good people  
can fix bad ideas, but good ideas can't save bad people.

  -- Paul Graham


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [Proposal] Pom Code Style (WAS svn commit: r670264 - /maven/plugins/trunk/maven-site-plugin/pom.xml)

Dennis Lundberg-2
In reply to this post by Benjamin Bentmann
Benjamin Bentmann wrote:
> Vincent Siveton schrieb:
>
>> I propose to improve [1] to add a code style for our pom files.
>
> +1 for some convention (which is documented as such).

Yep, +1 for a POM code style

>> I see the following in this order.
>
> Considering other POMs like parent POMs and Mojo, your proposal should
> finally cover all POM elements (e.g. <packaging>, <url>, <licenses>,
> <developers> etc.).
>
> Whatever we agree upon, we might want to update the Maven Model
> Reference [0], too. I guess that was the ordering Dennis has chosen.

I've always followed the ordering that is in the Model Reference.

I don't have a special preference for which order the elements should be
in and I'm happy with what we have now. If we change the order of the
elements in the POM, then there will be a lot of POMs to change. So I
say we apply the path of least resistance and just document that our
"style" is that POM elements should be ordered according to the order
they have in the POM reference and be done with it.


> If not already written down, the indentation style (2 spaces) should be
> mentioned, too.

+1 for that too

Additional things we could add:

- Line breaks, when to use them and how
- <project> element always on one line
- white space between sections/elements

>> <project>
>>   ...
>> </project>
>
> I find your proposed ordering more intuitive than the current Model Ref.
>
>
> Benjamin
>
>
> [0] http://maven.apache.org/ref/current/maven-model/maven.html
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


--
Dennis Lundberg

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [Proposal] Pom Code Style (WAS svn commit: r670264 - /maven/plugins/trunk/maven-site-plugin/pom.xml)

Jesse McConnell-2
+1, great idea

Not sure it was mentioned before or not but would also be nice to have
something like help:reformat goal for juggling things around in the
pom to the correct format.  Maybe it would be more appropriate to
clean up and finish off some of the things I had worked on with the
pom plugin in the sandbox and add this as a mojo in there.
pom:reformat would be pretty nice

cheers
jesse

On Wed, Jun 25, 2008 at 10:20 AM, Dennis Lundberg <[hidden email]> wrote:

> Benjamin Bentmann wrote:
>>
>> Vincent Siveton schrieb:
>>
>>> I propose to improve [1] to add a code style for our pom files.
>>
>> +1 for some convention (which is documented as such).
>
> Yep, +1 for a POM code style
>
>>> I see the following in this order.
>>
>> Considering other POMs like parent POMs and Mojo, your proposal should
>> finally cover all POM elements (e.g. <packaging>, <url>, <licenses>,
>> <developers> etc.).
>>
>> Whatever we agree upon, we might want to update the Maven Model Reference
>> [0], too. I guess that was the ordering Dennis has chosen.
>
> I've always followed the ordering that is in the Model Reference.
>
> I don't have a special preference for which order the elements should be in
> and I'm happy with what we have now. If we change the order of the elements
> in the POM, then there will be a lot of POMs to change. So I say we apply
> the path of least resistance and just document that our "style" is that POM
> elements should be ordered according to the order they have in the POM
> reference and be done with it.
>
>
>> If not already written down, the indentation style (2 spaces) should be
>> mentioned, too.
>
> +1 for that too
>
> Additional things we could add:
>
> - Line breaks, when to use them and how
> - <project> element always on one line
> - white space between sections/elements
>
>>> <project>
>>>  ...
>>> </project>
>>
>> I find your proposed ordering more intuitive than the current Model Ref.
>>
>>
>> Benjamin
>>
>>
>> [0] http://maven.apache.org/ref/current/maven-model/maven.html
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>
>
> --
> Dennis Lundberg
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>



--
jesse mcconnell
[hidden email]

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [Proposal] Pom Code Style (WAS svn commit: r670264 - /maven/plugins/trunk/maven-site-plugin/pom.xml)

Benjamin Bentmann
Jesse McConnell wrote:

> pom:reformat would be pretty nice

+1, cool idea. Might we worth to distinguish the use cases "reorder" and
"reformat", i.e. separate indentation stuff from element ordering.

BTW, Paul had once started a Pom Plugin [0], maybe there is something to
reuse/merge.


Benjamin


[0] http://jira.codehaus.org/browse/MOJO-928

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [Proposal] Pom Code Style (WAS svn commit: r670264 - /maven/plugins/trunk/maven-site-plugin/pom.xml)

Paul Gier
I originally just wrote some code because I wanted to put the dependencies in my
pom in alphabetical order and/or grouped by scope.  Then I was thinking that
there could be a general pom plugin to do things like sort the dependencies or
reformat etc [1].  I didn't realize that there was already a pom plugin in the
sandbox.  I'll take a look and maybe I can just add my mojo.

Anyway, I definitely like the idea of a pom plugin to do "pom:reformat" or
"pom:reorder" and maybe I can add a parameter about sorting the dependencies.

[1]http://jira.codehaus.org/browse/MOJO-928

Benjamin Bentmann wrote:

> Jesse McConnell wrote:
>
>> pom:reformat would be pretty nice
>
> +1, cool idea. Might we worth to distinguish the use cases "reorder" and
> "reformat", i.e. separate indentation stuff from element ordering.
>
> BTW, Paul had once started a Pom Plugin [0], maybe there is something to
> reuse/merge.
>
>
> Benjamin
>
>
> [0] http://jira.codehaus.org/browse/MOJO-928
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [Proposal] Pom Code Style (WAS svn commit: r670264 - /maven/plugins/trunk/maven-site-plugin/pom.xml)

Benjamin Bentmann
Paul Gier wrote:

> Anyway, I definitely like the idea of a pom plugin to do "pom:reformat"
> or "pom:reorder" and maybe I can add a parameter about sorting the
> dependencies.

Instead of a parameter, I believe sorting the dependencies should be a
distinct mojo. Otherwise, how to handle the use case of only sorting
dependencies, i.e. neither reformat nor reorder all the rest?


Benjamin

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [Proposal] Pom Code Style (WAS svn commit: r670264 - /maven/plugins/trunk/maven-site-plugin/pom.xml)

brettporter
Administrator
In reply to this post by Jesse McConnell-2
I agree with Dennis, though if any reordering is to be done I think  
the order proposed by Vincent makes sense.

I agree with Jesse and Paul about adding goals to the POM plugin to  
help adjust POMs.

Cheers,
Brett

On 26/06/2008, at 1:29 AM, Jesse McConnell wrote:

> +1, great idea
>
> Not sure it was mentioned before or not but would also be nice to have
> something like help:reformat goal for juggling things around in the
> pom to the correct format.  Maybe it would be more appropriate to
> clean up and finish off some of the things I had worked on with the
> pom plugin in the sandbox and add this as a mojo in there.
> pom:reformat would be pretty nice
>
> cheers
> jesse
>
> On Wed, Jun 25, 2008 at 10:20 AM, Dennis Lundberg  
> <[hidden email]> wrote:
>> Benjamin Bentmann wrote:
>>>
>>> Vincent Siveton schrieb:
>>>
>>>> I propose to improve [1] to add a code style for our pom files.
>>>
>>> +1 for some convention (which is documented as such).
>>
>> Yep, +1 for a POM code style
>>
>>>> I see the following in this order.
>>>
>>> Considering other POMs like parent POMs and Mojo, your proposal  
>>> should
>>> finally cover all POM elements (e.g. <packaging>, <url>, <licenses>,
>>> <developers> etc.).
>>>
>>> Whatever we agree upon, we might want to update the Maven Model  
>>> Reference
>>> [0], too. I guess that was the ordering Dennis has chosen.
>>
>> I've always followed the ordering that is in the Model Reference.
>>
>> I don't have a special preference for which order the elements  
>> should be in
>> and I'm happy with what we have now. If we change the order of the  
>> elements
>> in the POM, then there will be a lot of POMs to change. So I say we  
>> apply
>> the path of least resistance and just document that our "style" is  
>> that POM
>> elements should be ordered according to the order they have in the  
>> POM
>> reference and be done with it.
>>
>>
>>> If not already written down, the indentation style (2 spaces)  
>>> should be
>>> mentioned, too.
>>
>> +1 for that too
>>
>> Additional things we could add:
>>
>> - Line breaks, when to use them and how
>> - <project> element always on one line
>> - white space between sections/elements
>>
>>>> <project>
>>>> ...
>>>> </project>
>>>
>>> I find your proposed ordering more intuitive than the current  
>>> Model Ref.
>>>
>>>
>>> Benjamin
>>>
>>>
>>> [0] http://maven.apache.org/ref/current/maven-model/maven.html
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [hidden email]
>>> For additional commands, e-mail: [hidden email]
>>>
>>>
>>
>>
>> --
>> Dennis Lundberg
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>
>
>
> --
> jesse mcconnell
> [hidden email]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>

--
Brett Porter
[hidden email]
http://blogs.exist.com/bporter/


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [Proposal] Pom Code Style (WAS svn commit: r670264 - /maven/plugins/trunk/maven-site-plugin/pom.xml)

Vincent Siveton-2
In reply to this post by Vincent Siveton-2
Hi,

FYI I created MNG-3634 and you could see the result here:
http://people.apache.org/~vsiveton/MNG-3634/maven-2.0.x/site/maven.html

Comments are welcome!

Cheers,

Vincent

2008/6/23, Vincent Siveton <[hidden email]>:

> Hi,
>
>  I propose to improve [1] to add a code style for our pom files. As the
>  following tags are required: modelVersion, groupId, artifactId and
>  version (see [2]),  I see the following in this order.
>
>  <project>
>   <modelVersion/>
>
>   <parent/> if required
>
>   <groupId/>
>   <artifactId/>
>   <version/>
>
>   <name/>
>   <description/>
>
>   <prerequisites/>  if required
>
>   <scm/>
>
>   <issueManagement/>
>
>   <dependencies/>
>
>   <build/>  if required
>
>   <reporting/>  if required
>
>   <profiles/>  if required
>
>   <properties/> if required
>  </project>
>
>  My reasoning is mainly based on the consistency and the maintenance.
>
>  WDYT?
>
>  Vincent
>
>  [1] http://maven.apache.org/guides/development/guide-m2-development.html
>  [2] http://maven.apache.org/guides/introduction/introduction-to-the-pom.html#Minimal_POM
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [Proposal] Pom Code Style (WAS svn commit: r670264 - /maven/plugins/trunk/maven-site-plugin/pom.xml)

Benjamin Bentmann
Vincent Siveton wrote:

> FYI I created MNG-3634 and you could see the result here:
> http://people.apache.org/~vsiveton/MNG-3634/maven-2.0.x/site/maven.html
>
> Comments are welcome!

I prefer your initial suggestion, which might be looking like that after
incorporating the other elements:


   <modelVersion/>

   <parent/>

   <groupId/>
   <artifactId/>
   <version/>
   <packaging/>

   <name/>
   <description/>
   <url/>
   <inceptionYear/>
   <organization/>
   <licenses/>

   <prerequisites/>

   <modules/>

   <developers/>
   <contributors/>

   <scm/>
   <issueManagement/>
   <ciManagement/>
   <distributionManagement/>
   <mailingLists/>

   <dependencies/>
   <dependencyManagement/>

   <repositories/>
   <pluginRepositories/>

   <build/>

   <reporting/>

   <profiles/>

   <properties/>

When I was about to create a local maven.mdo reflecting this ordering, I
noticed that the boundaries imposed by the class hierarchy
(Model/ModelBase) make this impossible.

So I wonder whether it was sensible to choose the Modello generated
ordering as the reference ordering. Maybe we should define the preferred
ordering independently (i.e. as part of the document created by
MNGSITE-55) and just link to it from the Model Reference?


Benjamin

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [Proposal] Pom Code Style (WAS svn commit: r670264 - /maven/plugins/trunk/maven-site-plugin/pom.xml)

Paul Benedict
If you're going to reorder the POM, put <properties> before  <dependencies>
or even higher. I've seen them used to specify dependencies, build info, and
alot of other things. Properties aren't just left overs, they are an early
step in the build process and should be "early" in the POM too.

Paul

On Sun, Jun 29, 2008 at 4:35 AM, Benjamin Bentmann <
[hidden email]> wrote:

> Vincent Siveton wrote:
>
>  FYI I created MNG-3634 and you could see the result here:
>> http://people.apache.org/~vsiveton/MNG-3634/maven-2.0.x/site/maven.html<http://people.apache.org/%7Evsiveton/MNG-3634/maven-2.0.x/site/maven.html>
>>
>> Comments are welcome!
>>
>
> I prefer your initial suggestion, which might be looking like that after
> incorporating the other elements:
>
>
>  <modelVersion/>
>
>  <parent/>
>
>  <groupId/>
>  <artifactId/>
>  <version/>
>  <packaging/>
>
>  <name/>
>  <description/>
>  <url/>
>  <inceptionYear/>
>  <organization/>
>  <licenses/>
>
>  <prerequisites/>
>
>  <modules/>
>
>  <developers/>
>  <contributors/>
>
>  <scm/>
>  <issueManagement/>
>  <ciManagement/>
>  <distributionManagement/>
>  <mailingLists/>
>
>  <dependencies/>
>  <dependencyManagement/>
>
>  <repositories/>
>  <pluginRepositories/>
>
>  <build/>
>
>  <reporting/>
>
>  <profiles/>
>
>  <properties/>
>
> When I was about to create a local maven.mdo reflecting this ordering, I
> noticed that the boundaries imposed by the class hierarchy (Model/ModelBase)
> make this impossible.
>
> So I wonder whether it was sensible to choose the Modello generated
> ordering as the reference ordering. Maybe we should define the preferred
> ordering independently (i.e. as part of the document created by MNGSITE-55)
> and just link to it from the Model Reference?
>
>
> Benjamin
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: [Proposal] Pom Code Style (WAS svn commit: r670264 - /maven/plugins/trunk/maven-site-plugin/pom.xml)

Vincent Siveton-2
In reply to this post by Benjamin Bentmann
Hi,

2008/6/29, Benjamin Bentmann <[hidden email]>:

> Vincent Siveton wrote:
>
>
> > FYI I created MNG-3634 and you could see the result here:
> >
> http://people.apache.org/~vsiveton/MNG-3634/maven-2.0.x/site/maven.html
> >
> > Comments are welcome!
> >
>
>  I prefer your initial suggestion, which might be looking like that after
> incorporating the other elements:
>
>
>   <modelVersion/>
>
>   <parent/>
>
>   <groupId/>
>   <artifactId/>
>   <version/>
>   <packaging/>
>
>   <name/>
>   <description/>
>   <url/>
>   <inceptionYear/>
>   <organization/>
>   <licenses/>
>
>   <prerequisites/>
>
>   <modules/>
>
>   <developers/>
>   <contributors/>
>

IMHO devs should be after licenses, since they describe more a project
than a build.

>   <scm/>
>   <issueManagement/>
>   <ciManagement/>
>   <distributionManagement/>
>   <mailingLists/>

same reasoning for ML.

>   <dependencies/>
>   <dependencyManagement/>

I propose to put dependencyManagement before dependencies to improve
the readingness.

>   <repositories/>
>   <pluginRepositories/>
>
>   <build/>
>
>   <reporting/>
>
>   <profiles/>
>
>   <properties/>
>
>  When I was about to create a local maven.mdo reflecting this ordering, I
> noticed that the boundaries imposed by the class hierarchy (Model/ModelBase)
> make this impossible.

Yes I already saw that.

>  So I wonder whether it was sensible to choose the Modello generated
> ordering as the reference ordering. Maybe we should define the preferred
> ordering independently (i.e. as part of the document created by MNGSITE-55)
> and just link to it from the Model Reference?

+1 Better option with more flexibility

Cheers,

Vincent

>
>  Benjamin
>
>
> ---------------------------------------------------------------------
>  To unsubscribe, e-mail: [hidden email]
>  For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [Proposal] Pom Code Style (WAS svn commit: r670264 - /maven/plugins/trunk/maven-site-plugin/pom.xml)

Benjamin Bentmann
Vincent Siveton wrote:

> IMHO devs should be after licenses, since they describe more a project
> than a build.
> [...]
> same reasoning for ML.
> [...]
> I propose to put dependencyManagement before dependencies to improve
> the readingness.

All fine with me. Also taking into account Paul Benedict's suggestion
about the <properties> which makes sense to me, I believe our current
sketch is

   <modelVersion/>

   <parent/>

   <groupId/>
   <artifactId/>
   <version/>
   <packaging/>

   <name/>
   <description/>
   <url/>
   <inceptionYear/>
   <organization/>
   <licenses/>

   <developers/>
   <contributors/>

   <mailingLists/>

   <prerequisites/>

   <modules/>

   <scm/>
   <issueManagement/>
   <ciManagement/>
   <distributionManagement/>

   <properties/>

   <dependencyManagement/>
   <dependencies/>

   <repositories/>
   <pluginRepositories/>

   <build/>

   <reporting/>

   <profiles/>


Benjamin

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [Proposal] Pom Code Style (WAS svn commit: r670264 - /maven/plugins/trunk/maven-site-plugin/pom.xml)

brettporter
Administrator
In reply to this post by Vincent Siveton-2
I've just reverted a portion of the change to distributionManagement  
as it was breaking CI (you can't move things between objects).

I also find a few things weird about the order. IMO,
- dependencies and repositories should be together
- dependencies and dependencyManagement should be together
- build should be after dependencies, etc
- profiles should be after everything else.

Cheers,
Brett

On 29/06/2008, at 12:21 AM, Vincent Siveton wrote:

> Hi,
>
> FYI I created MNG-3634 and you could see the result here:
> http://people.apache.org/~vsiveton/MNG-3634/maven-2.0.x/site/ 
> maven.html
>
> Comments are welcome!
>
> Cheers,
>
> Vincent
>
> 2008/6/23, Vincent Siveton <[hidden email]>:
>> Hi,
>>
>> I propose to improve [1] to add a code style for our pom files. As  
>> the
>> following tags are required: modelVersion, groupId, artifactId and
>> version (see [2]),  I see the following in this order.
>>
>> <project>
>>  <modelVersion/>
>>
>>  <parent/> if required
>>
>>  <groupId/>
>>  <artifactId/>
>>  <version/>
>>
>>  <name/>
>>  <description/>
>>
>>  <prerequisites/>  if required
>>
>>  <scm/>
>>
>>  <issueManagement/>
>>
>>  <dependencies/>
>>
>>  <build/>  if required
>>
>>  <reporting/>  if required
>>
>>  <profiles/>  if required
>>
>>  <properties/> if required
>> </project>
>>
>> My reasoning is mainly based on the consistency and the maintenance.
>>
>> WDYT?
>>
>> Vincent
>>
>> [1] http://maven.apache.org/guides/development/guide-m2-development.html
>> [2] http://maven.apache.org/guides/introduction/introduction-to-the-pom.html#Minimal_POM
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>

--
Brett Porter
[hidden email]
http://blogs.exist.com/bporter/

Reply | Threaded
Open this post in threaded view
|

Re: [Proposal] Pom Code Style (WAS svn commit: r670264 - /maven/plugins/trunk/maven-site-plugin/pom.xml)

jdcasey
In reply to this post by Benjamin Bentmann
Please keep in mind that the ordering of dependencies can (in some
cases) change which version of a particular transitive dependency is
used. If two direct dependencies both reference a third dependency - but
using different versions - then the current resolution technique keeps
the first one encountered, iff the two references happen at the same
"level" of transitivity (distance from the current POM). Therefore,
simply alphabetizing the dependencies list could change the transitive
dependency list used for your build.

-john

Benjamin Bentmann wrote:

> Paul Gier wrote:
>
>> Anyway, I definitely like the idea of a pom plugin to do
>> "pom:reformat" or "pom:reorder" and maybe I can add a parameter about
>> sorting the dependencies.
>
> Instead of a parameter, I believe sorting the dependencies should be a
> distinct mojo. Otherwise, how to handle the use case of only sorting
> dependencies, i.e. neither reformat nor reorder all the rest?
>
>
> Benjamin
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>

--
John Casey
Developer, PMC Member - Apache Maven (http://maven.apache.org)
Blog: http://www.ejlife.net/blogs/buildchimp/


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

12