On 14/10/2010 3:32 PM, Kenneth McDonald wrote:
On Oct 14, 2010, at 9:11 AM, Wayne Fay wrote:

As much fun as all this commentary is, unless Ken comes back and posts
a reply, I feel like we're simply the victims of a drive-by
trolling...

As such, I recommend letting this thread die, at least until Ken comes
back and adds something to the discussion... Ken???

Hi Wayne, I'll post one more response to your well-thought-out question.

Here is the pom file I'm currently using:

and just so you don't have to scroll all the way to the bottom to see the 
comments, I'll put them here :-)

- Is there _anything_ in the structure of this file which leads me to an "aha, 
I understand what the major
and minor parts of the file are all about" moment?

- Does the file get across what it means both concisely and clearly?

- Is the syntax of the file for the convenience of the programmer, or the 
convenience of the tools
that process it?

- Could someone well-versed in programming, but without an understanding of 
maven, make at
least some sense of this file?

IMHO, the answers are no, no, for the convenience of the tools, and no. In 
terms of readability,
this file (and all pom files I've seen) are simply disasters. In terms of 
semantics--OK, pretty good.
In terms of usability, what a piece of garbage!

But why would you ever see this?
Doesn't your IDE support Maven?
There is no reason why any of my guys would ever look at this as XML.
We use Eclipse/STS as an IDE and this simple POM would never require anyone to do anything in XML.

Hand editing POMs is not a reasonable thing to do in 2010 unless you are debugging Maven and want to break a POM to see what Maven does.

I will admit to occasionally cutting and pasting between XML files if I have a lot of duplicate sections but this is a "once in a project" thing that hardly ever happens
I am more likely to copy the whole POM and use the editor to finish.

You need to look at parent POMs to get rid of the clutter:

This goes in the project parent POM so you don't put it in a POM that generates an artifact:

    <developers>
        <developer>
            <id>kmcdonald</id>
            <name>Kenneth McDonald</name>
            <email>ykkenmcd [at] gmail com</email>
        </developer>
    </developers>

    <licenses>
        <license>
            <name>Lesser General Public License (LGPL)</name>
            <url>http://www.gnu.org/copyleft/lesser.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

All of this belongs in the parent as well since it will be the same for each 
module.

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.1</version>
            </plugin>
            <plugin>
                <groupId>org.scala-tools</groupId>
                <artifactId>maven-scala-plugin</artifactId>
                <version>2.14.1</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>compile</goal>
                            <goal>testCompile</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.6</version>
                <configuration>
                    <useManifestOnlyJar>false</useManifestOnlyJar>
                    <includes>
                        <include>**/*Test.*</include>
                        <include>**/*Suite.*</include>
                    </includes>
                </configuration>
            </plugin>
        </plugins>

As does this:
    <reporting>
        <plugins>
            <plugin>
                <groupId>org.scala-tools</groupId>
                <artifactId>maven-scala-plugin</artifactId>
                <version>2.14.1</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.1</version>
            </plugin>
        </plugins>
    </reporting>


Your POM gets pretty small and easy to edit using a POM editor once you move 
out the stuff that belongs elsewhere.

Non of this stuff is going to trouble the Eclipse POM editor even if you do not 
do it the smart way.


Ron

So I guess my comment is, decent internals, horrible externals.

<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>
     <groupId>ykken.rex</groupId>
     <artifactId>rex</artifactId>
     <version>0.5-SNAPSHOT</version>
     <inceptionYear>2010</inceptionYear>

     <developers>
         <developer>
             <id>kmcdonald</id>
             <name>Kenneth McDonald</name>
             <email>ykkenmcd [at] gmail com</email>
         </developer>
     </developers>

     <licenses>
         <license>
             <name>Lesser General Public License (LGPL)</name>
             <url>http://www.gnu.org/copyleft/lesser.txt</url>
             <distribution>repo</distribution>
         </license>
     </licenses>

     <properties>
         <scala.version>2.8.0</scala.version>
     </properties>

     <repositories>
         <repository>
             <id>scala-tools.org</id>
             <name>Scala-Tools Maven2 Repository</name>
             <url>http://scala-tools.org/repo-releases</url>
         </repository>
     </repositories>

     <pluginRepositories>
         <pluginRepository>
             <id>snapshots.scala-tools.org</id>
             <name>Scala-Tools Maven2 Repository</name>
             <url>http://scala-tools.org/repo-releases</url>
         </pluginRepository>
     </pluginRepositories>

     <dependencies>
         <dependency>
             <groupId>org.scala-lang</groupId>
             <artifactId>scala-compiler</artifactId>
             <version>${scala.version}</version>
         </dependency>
         <dependency>
             <groupId>org.scala-lang</groupId>
             <artifactId>scala-library</artifactId>
             <version>${scala.version}</version>
         </dependency>
         <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
             <version>4.8.1</version>
             <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>org.scalatest</groupId>
             <artifactId>scalatest</artifactId>
             <version>1.2</version>
             <scope>test</scope>
         </dependency>
     </dependencies>

     <build>
         <sourceDirectory>src/main/scala</sourceDirectory>
         <testSourceDirectory>src/test/scala</testSourceDirectory>
         <plugins>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-dependency-plugin</artifactId>
                 <version>2.1</version>
             </plugin>
             <plugin>
                 <groupId>org.scala-tools</groupId>
                 <artifactId>maven-scala-plugin</artifactId>
                 <version>2.14.1</version>
                 <executions>
                     <execution>
                         <goals>
                             <goal>compile</goal>
                             <goal>testCompile</goal>
                         </goals>
                     </execution>
                 </executions>
             </plugin>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>
                 <version>2.6</version>
                 <configuration>
                     <useManifestOnlyJar>false</useManifestOnlyJar>
                     <includes>
                         <include>**/*Test.*</include>
                         <include>**/*Suite.*</include>
                     </includes>
                 </configuration>
             </plugin>
         </plugins>
     </build>
     <reporting>
         <plugins>
             <plugin>
                 <groupId>org.scala-tools</groupId>
                 <artifactId>maven-scala-plugin</artifactId>
                 <version>2.14.1</version>
             </plugin>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-dependency-plugin</artifactId>
                 <version>2.1</version>
             </plugin>
         </plugins>
     </reporting>
</project>


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




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

Reply via email to