Thank you Kristopher. Sorry if I misunderstood your previous email. Actually
it's the bug you were talking about. I added the postGoal to my plugin,
redeployed it, and it worked! Thank you for that.
Marco
----- Original Message -----
From: "Kristopher Brown" <[EMAIL PROTECTED]>
To: "Marco Tedone" <[EMAIL PROTECTED]>
Sent: Tuesday, March 23, 2004 9:37 AM
Subject: RE: Plugin as dependency
Hi,
I think I'm not being very clear. I've tried to ask questions below, if
you could answer them in any response then I can understand your
environment a little better.
Are you using RC1? This was the version I had a problem with. If not
then no need to read any further :)
As far as I know, plugin:install and plugin:deploy work as you say, and
performs as you state. The plugin:install goal installs the jar file
into the ${maven.home}/plugins directory and the plugin:deploy goal
copies the expanded structure into the ${maven.local.repo}/plugins
directory.
If you open the plugin.jelly file in the plugin plugin, you'll see that
the plugin:install and plugin:deploy goals both have a prerequesite on
the plugin goal. This goal is the one which is in error in RC1 as it
copies the jar artifact that you use when making a dependency against a
plugin to the wrong location. i.e. it copies it to
${maven.local.repo}/maven/plugins rather than
${maven.local.repo}/maven-jemos-plugin/plugins.
If you check in your local repository under
${maven.local.repo}/maven-jemos-plugin do you have a plugin directory?
and if so do you have a maven-jemos-plugin-1.0.jar in it? If not then
this is the problem. Try copying the jar file to that location and see
if the dependant project then works. If so then you have the problem I
had.
So, the project that is dependent on the plugin, has the following entry
as you originally posted.
<dependency>
<groupId>maven-jemos-plugin</groupId>
<artifactId>maven-jemos-plugin</artifactId>
<version>1.0</version>
<url>${maven.plugin.dir}</url>
<type>plugin</type>
</dependency>
this is correct, but you do not need the url section though, it doesn't
provide any help in resolving the location of the dependency. When this
dependency is evaluated, it looks for the following...
${maven.local.repo}/${groupId}/${type}s/${artfactId}-${version}.jar
which equates to:
${maven.local.repo}/maven-jemos-plugin/plugins/maven-jemos-plugin-1.0.ja
r
On a side note, I'd advise you to use a group name like "jemos", then
all of your artifacts are in one convienient location.
Hope that helps, let me know how you get on. Of course, I could be
heading in a totally different direction :)
Kris.
> -----Original Message-----
> From: Marco Tedone [mailto:[EMAIL PROTECTED]
> Sent: 22 March 2004 22:17
> To: Kristopher Brown
> Subject: Re: Plugin as dependency
>
> Kristopher, thank you for your reply, but unfortunately this
> is not the kind
> of problem I'm running at the moment.
>
> I succesfully deployed a plugin. It has been copied to the
> unpacked and
> packed folders with the following name:
>
> maven-jemos-plugin-1.0.jar
>
> However, when I declare this plugin as a dependency in
> another project, I
> get the error stated in my previous email.
>
> Marco
> ----- Original Message -----
> From: "Kristopher Brown" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Monday, March 22, 2004 12:46 PM
> Subject: Re: Plugin as dependency
>
>
> Hi,
>
> Marco, presumably you are using RC1 as I've had a similar
> issue? If so
> there is a bug in the plugin goal that copies the jar file to
> maven/plugins in the repo rather than ${pom.groupId}/plugins, which I
> believe will be fixed in RC2 [see the goal lifted from plugin.jelly,
> specifically the copy todir attribute].
>
> <goal name="plugin"
> description="Build a plugin jar and install to the
> maven.repo.local">
>
> <!-- Plugins are just a jar. -->
> <attainGoal name="jar:jar"/>
>
> <copy file="${maven.build.dir}/${maven.final.name}.jar"
> todir="${maven.repo.local}/maven/plugins" />
>
> </goal>
>
> You can work around this for the timebeing by adding a
> post-goal to the
> plugin goal in your project specific maven.xml file to copy
> the jar file
> to the correct location. For example:
>
> <!--
> this is bugged in RC1 to copy to maven/plugins rather than
> ${pom.groupId}/plugins. Remove when moved to RC2.
> -->
> <postGoal name="plugin">
> <copy file="${maven.build.dir}/${maven.final.name}.jar"
> todir="${maven.repo.local}/${pom.groupId}/plugins" />
> </postGoal>
>
> Hopefully this fixes your problem.
>
> Kris.
>
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]