Well, I've finished a hacked-up set of maven projects and plugins that
build an update site.  The reason I call it "hacked-up" is that it does
not use the repository for anything but the final update site JAR file
and the original plugin JARs - it uses an "updateSite" directory under
the HOME directory for the intermediate JARs.

There are several pieces to this:

1. A maven plugin that copies all plugin POM dependencies to a lib
directory under target.
2. A maven plugin that copies plugin.xml to the target directory, then
replaces the dependencies in it with the POM transitive dependencies,
and which updates the version qualifier with the build number (which we
have configured in AntHill to be in a property passed to maven) or the
timestamp if that is not present.
3. An ant task that copies the plugin.xml file to
target/work/plugins/${plugin.id}_${plugin.version}, the dependency JARs
into target/work/plugins/${plugin.id}_${plugin.version}/lib, and the
plugin JAR to target/work/plugins/${plugin.id}_${plugin.version} (and
removes the version number); then builds a JAR with all these contents
that is named ${plugin.id}_${plugin.version}.jar, where plugin.id and
plugin.version come from the plugin.xml file, and finally copies that
JAR to $HOME/updateSite/plugins.
4. A maven plugin that copies feature.xml to the target directory,
updates the version number of the feature as above, and updates the
plugin version numbers and JAR file names to match what it finds in the
$HOME/updateSite/plugins.
5. An ant task that copies the feature.xml to
target/work/features/${feature.id}_${feature.version}, builds a JAR from
that, and puts the jar in $HOME/updateSite/features.  Note that
feature.id and feature.version come from the feature.xml file.
6. A maven plugin that copies site.xml to the target directory and
updates the feature version and name from the feature in
$HOME/updateSite/features.
7. An ant task that copies the site.xml file and the contents of
$HOME/updateSite to target/work/site, then creates a JAR with the name
${artifactId}-{version}, which is put into the repository.

The obvious limitation is that this can only build an update site with
one feature.  Also, I don't like how much ant stuff there is - I'm sure
that many of these things can be done in maven directly, but I just ran
out of time.  

When I can figure out an appropriate way to release these plugins, I'll
do it, but I will not likely have much more time to enhance it.  If this
description inspires someone to work on this themselves, be my guest -
if you want, I can send you the code for these plugins after I make sure
that it all has the appropriate copyrights.

Jim Babka
Senior Software Engineer
Main: (512) 334 3200
Direct: (512) 334 3237
Email: [EMAIL PROTECTED]
 
Webify Solutions
Enabling the On Demand Enterprise(tm)
www.webifysolutions.com

-----Original Message-----
From: Jim Babka 
Sent: Wednesday, January 11, 2006 10:59 AM
To: Maven Users List
Subject: RE: [m2] Maven2 building Eclipse plugins, features, and update
sites

So, the questions then are, (a) where and how do I specify the
"classifier", and (b) how do I write a custom plugin that creates a
second artifact?  Regarding the second, the source code for the Javadoc
plugin was not terribly helpful because it uses a MavenProjectHelper
class for which I could find no documentation (so I don't know what the
parameters mean).

In any case, because I have to get something done quickly, I am
abandoning the effort of putting a second JAR in the repository.  I'm
going to hack around this and use a temporary directory for all the
"meta-JARs" that I need, and then I'll have a feature build ANT goal
that pulls from that directory before it starts packaging things up.
This is certainly not even close to correct - it will only work because
we only need to build one feature - but I'm just stymied at every turn
by the lack of documentation right now.  I know that the documentation
situation will improve, but I've got to get something working by the end
of the week.  Hopefully, I'll have a chance to revisit this later after
more documentation is in place.

Jim Babka
Senior Software Engineer
Main: (512) 334 3200
Direct: (512) 334 3237
Email: [EMAIL PROTECTED]
 
Webify Solutions
Enabling the On Demand Enterprise(tm)
www.webifysolutions.com

-----Original Message-----
From: Brett Porter [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 10, 2006 5:06 PM
To: Maven Users List
Subject: Re: [m2] Maven2 building Eclipse plugins, features, and update
sites

Hi Jim,

Sorry I hadn't answered your other Q's yet, but this is what I meant.
There is an assembly:attached goal in the next release of the assembly
plugin that will enable you to do what javadoc and sources do. In the
mean time, you need to use assembly:assembly install to generate and
install both, or use a custom plugin that just creates the one.

The name can be changed with finalName configuration to the assembly
plugin. Note it only impacts the target/ generated file - it is still
installed in the repository with <artifactId>-<version>-<classifier>
as the name.

- Brett

On 1/11/06, Jim Babka <[EMAIL PROTECTED]> wrote:
> So, I've been told separately that it is possible to have a project
> generate multiple artifacts, because the sources and javadoc plugins
do
> just that.  The questions are (a) are they full artifacts that can be
> depended upon by other projects, and (b) can someone point me at the
> source code that does this?  I see that there's an addAttachedArtifact
> method on MavenProject - is that what I need to use?
>
> Jim Babka
> Senior Software Engineer
> Main: (512) 334 3200
> Direct: (512) 334 3237
> Email: [EMAIL PROTECTED]
>
> Webify Solutions
> Enabling the On Demand Enterprise(tm)
> www.webifysolutions.com
>
> -----Original Message-----
> From: Jim Babka
> Sent: Monday, January 09, 2006 7:27 PM
> To: Maven Users List
> Subject: RE: [m2] Maven2 building Eclipse plugins, features, and
update
> sites
>
> First of all, how do you tell the assembly plugin what name to give to
> the JAR it creates?  Second, how do you get that jar to be an artifact
> that gets put into the repository?
>
> I may be misunderstanding something here, so please bear with me.  I
> believe that the file names of any artifacts generated by a project
are
> fixed to be "{artifactId}-{version}", where artifactId and version
come
> from the POM file - is this correct?  If so, then the only thing you
can
> do to create multiple artifacts is to have different file extensions
for
> each - is that correct?  If these are both correct, then you see my
> dilemma - I need the same project (i.e. the same pom.xml) to generate
> two artifacts: a JAR, and a JAR of JARs.
>
> I would love to be mistaken here - am I?
>
> Jim Babka
> Senior Software Engineer
> Main: (512) 334 3200
> Direct: (512) 334 3237
> Email: [EMAIL PROTECTED]
>
> Webify Solutions
> Enabling the On Demand Enterprise(tm)
> www.webifysolutions.com
>
> -----Original Message-----
> From: Brett Porter [mailto:[EMAIL PROTECTED]
> Sent: Monday, January 09, 2006 7:05 PM
> To: Maven Users List
> Subject: Re: [m2] Maven2 building Eclipse plugins, features, and
update
> sites
>
> Those docs definitely look half-done. The latter parts are just pastes
> of the defaults. Documentation is high on the list for the next
> assembly plugin release.
>
> The assembly produced would have to have a different name to the
> original JAR which you are packaging up. The version would be the
> same, the name would just be different.
>
> However, you can create another plugin that does the custom behaviour
> and only produces one jar. I think that's what the felix osgi plugin
> does.
>
> - Brett
>
> On 1/10/06, Jim Babka <[EMAIL PROTECTED]> wrote:
> > Thanks for getting back to me.
> >
> > I looked at assemblies, but quickly got stuck there as well.  What
> does
> > the assembly plugin do about a version number?  Does it use the
> version
> > number for the project?  Since that is the same as the version
number
> > for the JAR, I would have do come up with a different name, right?
> But
> > I can't do that because the name is fixed by the project I'm in,
> > correct?  So how can it possibly generate a second artifact with the
> > same name from within the same project?
> >
> > Is there any better documentation on the assembly plugin than
> > http://maven.apache.org/guides/mini/guide-assemblies.html?  The
> examples
> > there (which is pretty much all there is right now) show <formats>
and
> > <outputDirectory> tags, but I can't see how the former would have
> > anything to do with the file generated (since there are multiple),
and
> > the latter makes it appear as though assemblies do not generate
> > artifacts (since there's only one place for an artifact to go - the
> > repository).
> >
> > Jim Babka
> > Senior Software Engineer
> > Main: (512) 334 3200
> > Direct: (512) 334 3237
> > Email: [EMAIL PROTECTED]
> >
> > Webify Solutions
> > Enabling the On Demand Enterprise(tm)
> > www.webifysolutions.com
> >
> > -----Original Message-----
> > From: Brett Porter [mailto:[EMAIL PROTECTED]
> > Sent: Monday, January 09, 2006 6:11 PM
> > To: Maven Users List
> > Subject: Re: [m2] Maven2 building Eclipse plugins, features, and
> update
> > sites
> >
> > Hi Jim,
> >
> > Sorry for not replying sooner. I've not done this, and I'm not sur
eif
> > anyone else has, but we have certainly discussed it in the past.
> > Members of the pde-build-dev team were here at one point. We'd
> > appreciate any feedback you have on it.
> >
> > Some pointers:
> > - the assembly plugin can create a jar that includes other jars, and
> > gets deployed alongside the original
> > - check out the Felix OSGi M2 plugin:
> > http://docs.safehaus.org/display/OSGI/OSGi+Plugin+for+Maven+2.0
> >
> > Hope these help for starters.
> >
> > - Brett
> >
> > On 1/10/06, Jim Babka <[EMAIL PROTECTED]> wrote:
> > > Eclipse does provide some ant tasks, but they require that Eclipse
> is
> > > running.  They have a way to run in headless mode, but you need to
> use
> > a
> > > script that invokes Eclipse, and then tell Eclipse to run its
> > antRunner
> > > process.  As far as I can tell, there is no way to have ant run
> these
> > > Eclipse tasks without running ant from Eclipse (which we clearly
> can't
> > > do if we need to run ant from maven).
> > >
> > > Since I got no other replies, I assume that somehow, no one has
done
> > > this before, so I need to dig into it.  I have gotten to the
> following
> > > stopping point, and I need help.  An Eclipse plugin consists of a
> JAR
> > > that contains 3 classes of items:
> > >
> > > 1. Another jar with the actual code.
> > > 2. The plugin.xml file
> > > 3. 0 or more JAR dependencies for the plugin.
> > >
> > > Maven builds item 1 without a problem, and we've hacked up a Mojo
to
> > > update item 2.  Then we have a separate ant goal that runs from
> Maven
> > to
> > > copy all 3 to the target directory, then zip it all up.  The
problem
> > is
> > > that we need to add a second artifact to the build once this ant
> step
> > is
> > > complete, because we need both the original jar (for other project
> > build
> > > dependencies) and the new jar (for the later Eclipse feature build
> > that
> > > I need to write).
> > >
> > > The question is, how do I add another artifact to the build when
> there
> > > is already an artifact that I must preserve, and when both
artifacts
> > are
> > > needed by different maven dependencies?  Also, how can I say that
I
> > > depend upon only one of those artifacts?
> > >
> > > Jim Babka
> > > Senior Software Engineer
> > > Main: (512) 334 3200
> > > Direct: (512) 334 3237
> > > Email: [EMAIL PROTECTED]
> > >
> > > Webify Solutions
> > > Enabling the On Demand Enterprise(tm)
> > > www.webifysolutions.com
> > > -----Original Message-----
> > > From: Milos Kleint [mailto:[EMAIL PROTECTED]
> > > Sent: Saturday, January 07, 2006 2:37 AM
> > > To: Maven Users List
> > > Subject: Re: [m2] Maven2 building Eclipse plugins, features, and
> > update
> > > sites
> > >
> > > does eclipse provide ant tasks to do the plugin building?
> > > I've done exactly the same for netbeans modules,
> > > a bunch of mojos and a custom lifecycle, internally reusing the
> > netbeans
> > > ant
> > > tasks.
> > > At least the lifecycle definition might be of interest you,
> > > http://cvs.mevenide.codehaus.org/mojos/maven-nbm-plugin/
> > >
> > > Regards
> > >
> > > Milos Kleint
> > >
> > > On 1/7/06, Jim Babka <[EMAIL PROTECTED]> wrote:
> > > >
> > > > I have been searching for this now for several days and have
found
> > > > nothing, so I thought I would ask here.  Is there a maven2
plugin
> > that
> > > > supports building of Eclipse plugins, features, and update
sites?
> > > Right
> > > > now we have several Eclipse plugins that are built into ZIP
files
> > that
> > > > can be unzipped into an Eclipse plugins directory.  However,
there
> > are
> > > > several problems with this:
> > > >
> > > > 1. There's no support for updating the plugin.xml with the
version
> > > > information of the plugin's jar.
> > > > 2. There's no support for putting the maven pom.xml dependencies
> > > (direct
> > > > or transitive) into the plugin.xml.
> > > > 3. There's no support for building an Eclipse feature that
> includes
> > > > those plugins.
> > > > 4. There's no support for building an Eclipse update site from
the
> > > > feature or for that matter deploying to an update site.
> > > >
> > > > Right now we have some hackery to at least get to the ZIP file,
> but
> > > > unless there is something already existing, I see a bunch of
long
> > > nights
> > > > ahead while I write my own stuff.  The requirement is that we
can
> > have
> > > > an update site automatically built/updated by our build system.
> > > >
> > > > So, is there anything that I can use here?  Even if there is an
> open
> > > > source project that goes only part of the way, it would possibly
> > give
> > > me
> > > > a head start.
> > > >
> > > > Thanks in advance for any help that anyone can give me.
> > > >
> > > > Jim Babka
> > > > Senior Software Engineer
> > > > Main: (512) 334 3200
> > > > Direct: (512) 334 3237
> > > > Email: [EMAIL PROTECTED]
> > > >
> > > > Webify Solutions
> > > > Enabling the On Demand Enterprise(tm)
> > > > www.webifysolutions.com
> > > >
> > > >
> > > >
> >
---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > >
> > > >
> > >
> > >
> > >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
> >
---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
> >
---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to