dev@glassfish.java.net

Re: module directory name in maven output

From: Bill Shannon <bill.shannon_at_sun.com>
Date: Wed, 17 Mar 2010 13:52:39 -0700

Well, that does get the information out there, but it's pretty well
obscured in the maven chit-chat. Seems like a kludge to have to resort
to ant to do this too. :-) But, it's better than not having the
information at all.

What do other people think?


Timothy Quinn wrote on 03/17/2010 01:25 PM:
> How about defining something like this in the top-level pom's <plugins>
> section so it's inherited:
>
> <plugin>
> <artifactId>maven-antrun-plugin</artifactId>
> <executions>
> <execution>
> <id>showDir</id>
> <goals>
> <goal>run</goal>
> </goals>
> <phase>initialize</phase>
> <configuration>
> <tasks>
> <echo>Building in ${project.basedir}</echo>
> </tasks>
> </configuration>
> </execution>
> </executions>
> </plugin>
>
>
> which gives output like this (in this case I was building
> deployment/dol): (look 10-12 lines in)
>
> timothy-quinns-macbook-pro-2:dol Tim$ mvn install
> [INFO] Scanning for projects...
> WAGON_VERSION: 1.0-beta-2
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Building Deployment Object Library
> [INFO] task-segment: [install]
> [INFO]
> ------------------------------------------------------------------------
> [INFO] [enforcer:enforce {execution: enforce-versions}]
> [INFO] [osgiversion:compute-osgi-version {execution: compute-osgi-version}]
> [INFO] [antrun:run {execution: showDir}]
> *[INFO] Executing tasks*
> * [echo] Building in /Users/Tim/asgroup/v3/F/v3/deployment/dol*
> *[INFO] Executed tasks*
> [INFO] [resources:resources]
>
> On Mar 17, 2010, at 2:26 PM, Bill Shannon wrote:
>
>> I talked to Jane about this issue privately a few months ago.
>> I'd like to get more feedback...
>>
>> One of the things that makes it painful to debug maven failures is
>> that the maven output contains only the description of the module
>> it's building. What I really want to know is the directory the
>> module is in. I end up having to grep all the pom.xml files for
>> the description to find the directory.
>>
>> Am I the only one who has this problem?
>>
>> Would it be reasonable to update the descriptions of our modules
>> to include the directory name?
>>
>> Is there a better way?
>>
>>
>> Here's what I tried:
>>
>> v3_at_mbp$ svn diff pom.xml
>> Index: pom.xml
>> ===================================================================
>> --- pom.xml (revision 35319)
>> +++ pom.xml (working copy)
>> @@ -47,7 +47,8 @@
>>
>> <artifactId>admin-cli</artifactId>
>> <packaging>hk2-jar</packaging>
>> - <name>Admin CLI for v3</name>
>> + <name>Admin CLI for v3
>> + ${project.basedir}</name>
>>
>> <developers>
>> <developer>
>> v3_at_mbp$ mvn
>> Using Java version: 1.6
>> [INFO]
>> [INFO] Scanning for projects...
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] Building Admin CLI for v3
>> /Users/shannon/v3/admin/cli
>> [INFO] task-segment: [install]
>>
>>
>> I tried embedding "\n", but it wasn't interpreted.
>>
>> I don't really like the <name> element being split across lines,
>> and I don't really like that the output line doesn't start with
>> [INFO], but this is the best I've come up with.
>>
>> Note that some of the names are *very* long, and putting the
>> directory name on the same line as the module name will make
>> the line extremely long, and will wrap at some arbitrary point.
>> Personally, I prefer neater output that makes it easy to tell
>> at a glance what the directory name is.
>>
>> Any maven experts have any suggestions of a better way to solve
>> this problem?
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>> <mailto:dev-unsubscribe_at_glassfish.dev.java.net>
>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>> <mailto:dev-help_at_glassfish.dev.java.net>
>>
>