Ah.  Welcome to the land of Maven. :-)  At work we've got over 90
modules building with Maven, so I've got some experience setting it
up.  Hopefully I can provide some help.

On 9/20/05, Philip Johnson <[EMAIL PROTECTED]> wrote:
> --On Monday, September 19, 2005 10:55 PM -1000 Aaron Kagawa
> <[EMAIL PROTECTED]> wrote:
> 
> > Here is my initial version:
> > <http://csdl.ics.hawaii.edu/~kagawaa/hackyMaven-0.1.1.zip>.  With
> > Philip's permission, I will commit this module to CVS.
> 
> Sure thing.   Just so that I am clear on the intent: I assume that what
> this provides is the ability for Hackystat sensors to work in a project
> that uses Maven as its build facility? If so, then this module would
> probably be called hackyApp_Maven in version 7 of Hackystat.

Are you using any of the hackyMaven project that I started last year? 
It's fine if you're not.  IIRC, I had the sensors setup, and I started
on a Maven report that would download the graphs through the Hackystat
web UI, but I didn't finish that part.  Anyway.  Just curious.

> > 1) There is something wrong with the Maven plugin for LOCC (I it from
> > CVS).  Apparently, it creates an xml file with sizeType="javaLine".
> 
> Weird. Who wrote this plugin? (Tim?) Is this due to a simple typo
> somewhere?

Yes.  The blame is probably mine.  It's been so long, though, that I
don't remember the details.  I know, thought, that we had it working
on our daily build machine and sending data to Hackystat.  Maybe
things have changed?  Maybe they were just left in a mess in CVS?  I
dunno.  In either case, Lo siento.

> > 2) For some reason (probably because I don't understand it fully), Maven
> > wants to download sensorshell.jar as sensorshell-.jar and I couldn't get
> > rid of the "-"-".

(Apologies in advance if you're already familiar with these details...)

Ah.  Now you've reached one of the things that is uniquely Maven --
and one of the few departures from Ant that I truly appreciate.  All
dependencies in Maven MUST have a version number.  No exceptions. 
This is different from Ant, but after the initial adjustment period,
this is wonderful.  You can look at your files and always know
_exactly_ which versions you are using.  In the land of commercial
Java where the number of dependencies is high, this is essential.

Maven will attempt to download  artifact-version.jar.  Thus if it's
trying to get sensorshell-.jar, you're probably not providing a
version number.  In fact, Maven establishes a way to link to a central
repository at Ibiblio.  But it can be overridden.  So our 30
developers at work all point to a central repository locally, which
then proxies out to Ibiblio for public things but holds its own copies
of our local libraries.

I arranged to have the JBlanket jars put on ibiblio a while back.  you
can see them here:

http://ibiblio.org/maven/jblanket/jars/

You'll notice that the jar name has the version in it.  There's lots
of other magic that you can do with version names (especially nightly
builds), but that's probably another discussion.

Your sensorshell.jar should be renamed and placed in your Maven
repository.  This is likely
<home-dir>/.maven/repository/<groupid>/jars/sensorshell-version.jar. 
Your <groupid> is set in your dependency, and is often either your
organization name or your jar name.

> With respect to your Maven issue, if Maven requires the '-' in sensor
> names, then the hackyApp_Maven module can get this behavior by implementing
> a install-postsensorshell task that makes a copy of sensorshell.jar in the
> download directory called sensorshell-.jar.

While I can't really comment on the details, what I grasp seems to be
at odds with Maven's general approach to downloading dependencies. 
I'm sure you guys can figure it out, though.  If you'd like to
describe more about your infrastructure, I'd be happy to comment. 
Otherwise I'll just hang tight.
 
> > This was a little harder that I thought it was going to be... I think I
> > don't really like Maven anymore... :)
> 
> I have this attraction/repulsion relationship with Maven 1.x---the idea is
> so promising, but the execution seems a little off somehow.   (That's
> probably how a lot of folks feel about Hackystat!)

I have the same feeling about Maven.  There are things I love, and
things I hate.  Whenever I need to extend it, I find myself using Ant
tasks as the core, and then using their Jelly stuff to setup options
for the Ant tasks.  There are a couple big mindset shifts for Maven. 
First, every project builds one and only one piece.  Other projects
combine them.  For example, one project builds a JAR of shared code,
another builds the WAR that includes the JAR, another builds the EAR
that bundles 4 WARs and 5 JARs plus 12 third party JARs.  It works out
to be pretty modular, but it's a shift in thinking.

That said, I really do feel like the execution is off enough to be a
distraction bordering on a hinderance.  There's enough good to make it
worth the jump if there's some things that you like, but since Ant 1.6
that borderline has shifted I think.
 
> > but, I suppose its pretty cool
> > that our existing Ant Sensors can be called via Maven without very much
> > work.  Oh, and I have no idea on how hackyMaven would integrate with
> > Hackystat; not sure one how to write hackyInstaller code for this because
> > it isn't really a sensor and doesn't have sensor code.
> >
> > I plan to hack on this more later on: (1) make a maven jblanket sensor,
> > (2) think of some way to integrate this into hackystat, (3) more
> > exploration of maven, (4) take a look at the new version of maven.
> 
> The Maven 2.0 release seems worth taking a look at.

I hope it turns out good.  They seemed to take _forever_ to release
the 1.0 version of Maven.  I wonder if 2.0 will come in a reasonable
timeframe.

> Question: Is it possible to use Maven to build www.hackystat.org instead of
> hackyDevSite, but not 'infect' our current development environment?  In
> other words, can regular developers continue to build and run hackystat
> just as they do now without any knowledge of Maven (or hackyDevSite), but
> Maven would be used to build the www.hackystat.org website (instead of
> hackyDevSite)? And would moving from hackyDevSite to Maven be a step
> forward or a step backward?

The website feature is one that pushed us over the edge to using
Maven, but it was mainly for having a website built automatically for
each of our 90 projects that included unit test results, javadoc, any
custom documentaion, subversion commit logs, JIRA issues, JBlanket
test coverage, Checkstyle violations, and on and on.

That said, if you're looking to build your developer site, I think you
can do so without affecting your other projects.  There are also other
tools like Forrest and a couple others for generating websites.  Maven
is a pretty decent one to consider, though.
 
I hope this brain dump contains a smidgen of useful stuff.  Good luck
with any future Maven stuff you do...  I'm happy to help answer
questions if you'd like, and happy to wait for another time. :-)

Tim

Reply via email to