0

I have a very simple project which I want to be packaged as a .rar. Now, I'm using the maven-rar-plugin, and that works perfectly locally. When I package, I get my .rar and it's what I want. However, I have a <distributionManagement> section like this:

<distributionManagement>
   <repository>
      <id>deployment</id>
      <name>Release Repo</name>
      <url>http:// mynexus.com: 8081/nexus/content/repo/release</url>
   </repository>
</distributionManagement>

Then when I run deploy -DperformRelease='true', I get a .jar published to my nexus. Then when I include this project as a dependency in another project:

<dependency>
    <groupId>MyProject</groupId>
    <artifactId>myProject</artifactId>
    <version>v1</version>
    <type>rar</type>
</dependency>

It goes to mynexus and tries to download it but can't find it. When I browse nexus, the project is there in the releases dir, but it's a .jar in there and maven dependency fails saying the .rar isn't there

4
  • I've rarely seen this out in the wild - why would you do that?
    – gtonic
    Commented Oct 4, 2016 at 17:29
  • First can you show your full pom file?
    – khmarbaise
    Commented Oct 4, 2016 at 18:35
  • 1
    @gtonic, I wanted to use someone else's .rar, but their MANIFEST.MF did not include all of the dependencies I needed. So I extracted their .rar, created a project from it, adding the dependencies I needed. But I wanted the end result to be tracked / provided by my nexus, that's why I wanted publish as .rar because my dependent project includes / deploys the .rar it gets from mynexus.
    – DDoomUs
    Commented Oct 6, 2016 at 14:03
  • @DDoomUs: cool repackaging.
    – gtonic
    Commented Oct 6, 2016 at 14:45

1 Answer 1

1

In the pom.xml, add the

<packaging>rar</packaging>

element as a child of the <project> element.

This published as a .rar as desired.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.