Nunn, Gerald wrote:
Jason,
It's a bad practice, and leads to coupling between plugins which is
bad. We've seen the aftermath of this happening in Maven 1.x.
Since I'm doing this already I'm curious how this could be done better and accomplish my goal, I'm a relative newbie to Mojos so I'm wondering if I am missing a better approach.
In my case, I needed a plugin that can handle a WebLogic shared library. A
shared library is a WAR or EAR that contains many different assets including
JARs and in order to be able to use these in Maven I've created a plugin that
temporarily unpacks the shared library and installs each JAR individually under
a library group name. It also creates a parent POM for the library that can be
used to drag in all the dependencies defined by the library.
In order to do this, my plugin needs to install each file individually. Rather
then rewrite the install plugin, I simply use my invoker class to invoke the
install plugin for each file I have unpacked passing in the necessary
parameters to make this work.
How could I accomplish the same goal using the approach you outlined?
This is a one-time setup, and really not part of the build.
You should have had those jars in the ears/wars in a repository already.
Either create a shellscript for it, or a pom, declaring a dependency on the
war/ear (i assume that one _is_
in a repository? if not - it shouldn't be part of the maven build lifecycle).
You use the maven-dependency-plugin to unpack the war/ear (for instance in
generate-resources), say to
${project.build.directory}/foo/
and specify a series of executions of the install plugin (for instance in
process-resources), each one configured
with the location a jar in ${project.build.directory}/foo/.
Anyway, this is not recommended practice, but I can see why your plugin is
useful.
The eclipse plugin has a similar mojo, that scans an eclipse installation
directory for plugins
and installs each plugin as a maven2 artifact in the local directory. It
doesn't use
the install mojo, afaik, but the maven api's.
I'm assuming your plugin is similar, in that it can unpack/install wars/ears
found in a bea weblogic installation
directory?
-- Kenney
Thanks,
Gerald
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]