Sumsar1812
Sumsar1812

Reputation: 618

Maven distributionManagement for multimodule project

So I recently changed a project of mine to have multiple modules and a root module instead of just one module. Before the change I had this in my pom

    <distributionManagement>
    <repository>
        <id>github</id>
        <name>GitHub Freakyville Apache Maven Packages</name>
        <url>https://maven.pkg.github.com/Freakyville/Utils</url>
    </repository>
</distributionManagement>

But after I split it up into multiple modules it doesn't work anymore. This is my root module pom file now

<modules>
    <module>UtilsMain</module>
    <module>UtilsInterfaces</module>
    <module>UtilsV1_8</module>
    <module>UtilsV1_13</module>
</modules>
<distributionManagement>
    <repository>
        <id>github</id>
        <name>GitHub Freakyville Apache Maven Packages</name>
        <url>https://maven.pkg.github.com/Freakyville/Utils</url>
    </repository>
</distributionManagement>

However when trying to run mvn deploy with this configuration it just tries to upload the pom file which isn't what I want. I would want the jar file generated by the module UtilsMain. I tried putting the <distributionManagement> inside the UtilsMain module without any luck

Is there anyway for me to specify which module it should upload from?

Edit:

After the comment from @JF Meier I wanted to include the error when trying to deploy

transfer failed for https://maven.pkg.github.com/Freakyville/Utils/io/github/freakyville/Utils/1.16.26/Utils-1.16.26.pom 422 Unprocessable Entity

I suppose this is my project isnt setup to accept deployed pom files? Do I have to do that? And in that case how?

Upvotes: 1

Views: 842

Answers (1)

Andreas1803
Andreas1803

Reputation: 34

You just have to change your groupid to a new unused one

Upvotes: 1

Related Questions