Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

528
Views
Skip maven deploy for one module

I have a multi-module maven project. Parent pom looks like this:

<project>
    ...
    <packaging>pom</packaging>   
    <modules>
        <module>common</module>
        <module>a</module>
        <module>b</module>
    </modules>
</project>

common builds a jar, which is added as dependency in the other modules, like this:

<dependency>
    <groupId>my.project</groupId>
    <artifactId>common</artifactId>
    <version>${module.common.version}</version>
</dependency>

Modules a and b are Spring Boot projects having the spotify docker plugin.

I need to be able to run mvn deploy in order to get the spotify plugin push the docker image.

mvn install works fine, which builds the docker images. But in order to push them, when I run mvn deploy, it throws error for the common module:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project common: Deployment failed: repository element was not specified in the POM inside distributionManagement element or in -DaltDeploymentRepository=id::layout::url parameter

Searching for this error, this answer suggests adding the repository url in the distributionManagement section. But I don't want to deploy common. I just want to build it, so it gets injected as dependency in the other modules and deploy those other modules. How can I do that?

I tried to deploy only a and b using this command, but it gives the same error for common:

mvn clean \
   -DdockerRegistryHost=123.dkr.ecr.us-west-1.amazonaws.com/test1 \
   --projects a,b \
   --also-make \
   deploy
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

You can accomplish what you want by configuring the maven-deploy-plugin.

Try adding the following to your parent pom:

<build>
    ...
    <pluginManagement>
        <plugins>
            <plugin>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>3.0.0-M1</version>
                <configuration>
                    <skip>true</skip>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>
    ...
 </build>

or add -Dmaven.deploy.skip=true to your command line.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!