I seem to recall that you can¹t use relocation on plugins, at least I know
it didn¹t work well when the dependency plugin moved from codehaus to
apache. I can also vaguely remember the behavior was different in some cases
based on if you specified the groupid only or added the artifactid and or
version in the relocation section.


On 10/27/08 4:38 PM, "Edelson, Justin" <[EMAIL PROTECTED]> wrote:

> I asked a few months ago on the user list about relocating a plugin and
> finally got around to doing it. Well, it didn't go as planned.
> 
> I had a plugin with groupId com.mtvi.plateng.maven and artifactId
> maven-hudson-plugin (yes, I know this should probably be
> hudson-maven-plugin and if I can get relocation to work with the
> groupId, maybe I'll try to tackle the artifactId next). I want to change
> the groupId to be org.jvnet.hudson.tools. The previous version was
> 2.0-alpha-1 and I just released 2.0-alpha-2 under the new groupId.
> 
> I edited /com/mtvi/plateng/maven/maven-hudson-plugin/maven-metadata.xml
> to be:
> <metadata>
>   <groupId>com.mtvi.plateng.maven</groupId>
>   <artifactId>maven-hudson-plugin</artifactId>
>   <version>2.0-alpha-2</version>
>   <versioning>
>     <latest>2.0-alpha-2</latest>
>     <release>2.0-alpha-2</release>
>     <versions>
>       <version>2.0-alpha-1</version>
>       <version>2.0-alpha-2</version>
>     </versions>
>     <lastUpdated>20081027131100</lastUpdated>
>   </versioning>
> </metadata>
> (and regenerated the hashes)
> 
> Then I created
> /com/mtvi/plateng/maven/maven-hudson-plugin/2.0-alpha-2/maven-hudson-plu
> gin-2.0-alpha-2.pom with this content:
> <project>
>   <modelVersion>4.0.0</modelVersion>
>   <groupId>com.mtvi.plateng.maven</groupId>
>   <artifactId>maven-hudson-plugin</artifactId>
>   <version>2.0-alpha-2</version>
>   <distributionManagement>
>     <relocation>
>       <groupId>org.jvnet.hudson.tools</groupId>
>     </relocation>
>   </distributionManagement>
> </project>
> (and generated hashes for this)
> 
> When running against a clean local repository and a settings file that
> contains ONLY com.mtvi.plateng.maven as a pluginGroup, I can see that
> the relocation is respected (in that I download
> /org/jvnet/hudson/tools/maven-hudson-plugin/2.0-alpha-2/maven-hudson-plu
> gin-2.0-alpha-2.pom), but I get an error that the JAR file is missing
> because Maven is attempting to download the JAR from the pre-reloation
> location:
> Downloading:
> http://download.java.net/maven/2/com/mtvi/plateng/maven/maven-hudson-plu
> gin/2.0-alpha-2/maven-hudson-plugin-2.0-alpha-2.jar
> 
> Instead of the relocated location.
> 
> Any ideas?
> 
> All of these (pre-relocation, relocation, and relocated) artifacts can
> be found on the java.net repository.
> 
> Thanks,
> 
> Justin Edelson
> VP, Platform Engineering
> MTV Networks Digital
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

Reply via email to